cryptest.exe f[eature] option?

瀏覽次數:6 次
跳到第一則未讀訊息

Jeffrey Walton

未讀,
2016年6月4日 晚上8:55:012016/6/4
收件者:Crypto++ Users
Hi Everyone,

This caught my eye recently: "cryptest.exe reports wrong CPU features for Core2 duo", http://github.com/weidai11/cryptopp/issues/176. I think it managed to stay under the radar because most of the hardware today is fully featured.

I'm trying to craft a test for cryptest.sh to detect the condition, but its turning out to be tricky. We can parse the output of 'cryptest.exe v' and capture hasMMX, hasSSE2, etc. We can then compare it against what we expect from `-march=native` preprocessor macros when `-march=native` is available. However, the tricky part is capturing all the features in one execution of 'cryptest.exe'.

I was thinking we may want a 'cryptest.exe f' to dump the feature strings shown in this line:

    passed:  hasMMX == 1, hasISSE == 1, hasSSE2 == 1, hasSSSE3 == 0,
    hasSSE4 == 1, hasAESNI == 0, hasRDRAND == 0, hasRDSEED == 0,
    hasCLMUL == 0, isP4 == 0, cacheLineSize == 64, AESNI_INTRINSICS == 1

We could also add information on the features from the compile-time environment, like:

    $ g++ -march=native -dM -E - </dev/null | egrep -i '(sse|aes|rdrnd|rdseed|bmi)'
    #define __SSE4_1__ 1
    #define __SSE4_2__ 1
    #define __SSE2_MATH__ 1
    #define __SSE_MATH__ 1
    #define __SSE2__ 1
    #define __SSSE3__ 1
    #define __RDRND__ 1
    #define __SSE__ 1
    #define __RDSEED__ 1
    #define __BMI2__ 1
    #define __AES__ 1
    #define __BMI__ 1
    #define __SSE3__ 1

What does everyone think?

Jeff




回覆所有人
回覆作者
轉寄
0 則新訊息