PR target/80969 - Fix ICE with -mabi=ms -mavx512f, reduce wasted space when realignin...
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx-vmaskmovps-1.c
blob360a04dbaaa7785cb7de64ca6d03cebaf74f0522
1 /* { dg-do run } */
2 /* { dg-require-effective-target avx } */
3 /* { dg-options "-O2 -mavx" } */
5 #include "avx-check.h"
7 #ifndef MASK
8 #define MASK 134
9 #endif
11 #define mask_v(pos) (((MASK & (0x1 << (pos))) >> (pos)) << 31)
13 void static
14 avx_test (void)
16 int i;
17 int m[4] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3)};
18 float s[4] = {1,2,3,4};
19 union128 u;
20 union128i_d mask;
21 float e[4] = {0.0};
23 mask.x = _mm_loadu_si128 ((__m128i *)m);
24 u.x = _mm_maskload_ps (s, mask.x);
26 for (i = 0 ; i < 4; i++)
27 e[i] = m[i] ? s[i] : 0;
29 if (check_union128 (u, e))
30 abort ();