Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keccak code breaks on hardware better than SSE2. #266

Closed
magnumripper opened this issue Apr 17, 2013 · 1 comment
Closed

Keccak code breaks on hardware better than SSE2. #266

magnumripper opened this issue Apr 17, 2013 · 1 comment

Comments

@magnumripper
Copy link
Member

SSE2 build works fine here and on Bull. But AVX or XOP (or -native) builds fail after a wad of warnings. This also means GPU builds fail on most modern hardware since they also use -march=native.

This might be easy but I'm not sure where to start.

First couple of warnings for AVX:

KeccakF-1600-opt64_plug.c:135:6: error: #error "UseBebigokimisa cannot be used in combination with UseXOP"
     #error "UseBebigokimisa cannot be used in combination with UseXOP"
      ^
KeccakF-1600-opt64_plug.c: In function 'KeccakPermutationOnWords':
KeccakF-1600-opt64_plug.c:187:5: warning: implicit declaration of function '_mm_roti_epi64' [-Wimplicit-function-declaration]
     rounds
     ^
KeccakF-1600-opt64_plug.c:187:5: error: incompatible type for argument 2 of '_mm_xor_si128'
In file included from /usr/local/Cellar/gcc48/4.8.0/gcc/lib/gcc/x86_64-apple-darwin12.3.0/4.8.0/include/xmmintrin.h:1246:0,
                 from /usr/local/Cellar/gcc48/4.8.0/gcc/lib/gcc/x86_64-apple-darwin12.3.0/4.8.0/include/x86intrin.h:34,
                 from KeccakF-1600-opt64_plug.c:76:
/usr/local/Cellar/gcc48/4.8.0/gcc/lib/gcc/x86_64-apple-darwin12.3.0/4.8.0/include/emmintrin.h:1248:1: note: expected '__m128i' but argument is of type 'int'
 _mm_xor_si128 (__m128i __A, __m128i __B)
 ^

and for XOP:

KeccakF-1600-opt64_plug.c:135:6: error: #error "UseBebigokimisa cannot be used in combination with UseXOP"
KeccakF-1600-opt64_plug.c: In function 'KeccakPermutationOnWords':
KeccakF-1600-opt64_plug.c:181:5: warning: unused variable 'Dio' [-Wunused-variable]
KeccakF-1600-opt64_plug.c:181:5: warning: unused variable 'Dua' [-Wunused-variable]
KeccakF-1600-opt64_plug.c:181:5: warning: unused variable 'Ama' [-Wunused-variable]
KeccakF-1600-opt64_plug.c:181:5: warning: unused variable 'Aku' [-Wunused-variable]
KeccakF-1600-opt64_plug.c:181:5: warning: unused variable 'Amae' [-Wunused-variable]
KeccakF-1600-opt64_plug.c: In function 'KeccakPermutationOnWordsAfterXoring':
KeccakF-1600-opt64_plug.c:195:5: warning: unused variable 'Dio' [-Wunused-variable]
KeccakF-1600-opt64_plug.c:195:5: warning: unused variable 'Dua' [-Wunused-variable]
KeccakF-1600-opt64_plug.c:195:5: warning: unused variable 'Ama' [-Wunused-variable]
KeccakF-1600-opt64_plug.c:195:5: warning: unused variable 'Aku' [-Wunused-variable]
KeccakF-1600-opt64_plug.c:195:5: warning: unused variable 'Amae' [-Wunused-variable]

As a workaround until we get it straight, we could add some #undef __SSSE3__, #undef __XOP__ and so on in some of the headers for keccak.

@magnumripper
Copy link
Member Author

1fd965b seems to make it buildable on all systems. But there are tons of warnings we'd like to mute, and AVX doesn't seem to run optimal code (it's slower than SSE2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant