Skip to content

Commit 6162525

Browse files
riptl0x0ece
authored andcommitted
chacha: _mm_load_epi32 not portable
_mm_load_epi32 is an AVX-512 extension which GCC 10 doesn't have. Use _mm_load_si128 instead.
1 parent 5222f85 commit 6162525

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ballet/chacha/fd_chacha_rng_avx512.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ fd_chacha_rng_refill_avx512( fd_chacha_rng_t * rng,
3535
...
3636
cB = wwu_bcast( (uint const *)(rng->key)[7] ); */
3737

38-
wwu_t key_lo = _mm512_broadcast_i32x4( _mm_load_epi32( rng->key ) ); /* [0,1,2,3,0,1,2,3] */
39-
wwu_t key_hi = _mm512_broadcast_i32x4( _mm_load_epi32( rng->key+16 ) ); /* [4,5,6,7,4,5,6,7] */
38+
__m128i key_lo_v = _mm_load_si128( (__m128i const *)rng->key ); /* [0,1,2,3] */
39+
__m128i key_hi_v = _mm_load_si128( (__m128i const *)rng->key+1 ); /* [4,5,6,7] */
40+
wwu_t key_lo = _mm512_broadcast_i32x4( key_lo_v ); /* [0,1,2,3,0,1,2,3] */
41+
wwu_t key_hi = _mm512_broadcast_i32x4( key_hi_v ); /* [4,5,6,7,4,5,6,7] */
4042
wwu_t k0 = _mm512_shuffle_epi32( key_lo, 0x00 );
4143
wwu_t k1 = _mm512_shuffle_epi32( key_lo, 0x55 );
4244
wwu_t k2 = _mm512_shuffle_epi32( key_lo, 0xaa );

0 commit comments

Comments
 (0)