jedisct1 / libsodium

A modern, portable, easy to use crypto library.
https://libsodium.org
Other
12.22k stars 1.74k forks source link

sse2_64_32.h: Fix compile errors under 32bit GCC #1074

Closed Alcaro closed 3 years ago

Alcaro commented 3 years ago
In file included from .../src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c:9:
.../src/libsodium/include/sodium/private/sse2_64_32.h: In function 'sodium__mm_set_epi64x':
.../src/libsodium/include/sodium/private/sse2_64_32.h:21:1: warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi]
 {
 ^
In file included from .../src/libsodium/include/sodium/private/sse2_64_32.h:14,
                 from .../src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c:9:
.../i686-w64-mingw32/8.1.0/include/emmintrin.h:601:1: error: inlining failed in call to always_inline '_mm_set_epi32': target specific option mismatch
 _mm_set_epi32 (int __q3, int __q2, int __q1, int __q0)
 ^~~~~~~~~~~~~
In file included from .../src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c:9:
.../src/libsodium/include/sodium/private/sse2_64_32.h:24:12: note: called from here
     return _mm_set_epi32(x1.as32[1], x1.as32[0], x0.as32[1], x0.as32[0]);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

pragma GCC push_options was added in GCC 4.4, same as #pragma GCC target (source), so this doesn't raise compiler requirements.

jedisct1 commented 3 years ago

Thanks!

Actually it doesn't make sense to include this where SSE2 code is not expected.

So, instead of including it with general headers, it's been moved closer to other Intel intrinsics related headers.