1 /* { dg-do run } */ 2 /* { dg-require-effective-target avx2 } */ 3 /* { dg-options "-O2 -mavx2" } */ 4 5 #include <string.h> 6 #include "avx2-check.h" 7 8 void static avx2_test(void)9avx2_test (void) 10 { 11 union128 s1; 12 union256 res; 13 float res_ref[8]; 14 int i, j; 15 int fail = 0; 16 17 for (i = 0; i < 10; i++) 18 { 19 s1.a[0] = i * 3.14; 20 21 res.x = _mm256_broadcastss_ps (s1.x); 22 23 for (j = 0; j < 8; j++) 24 memcpy (res_ref + j, s1.a, 4); 25 26 fail += check_union256 (res, res_ref); 27 } 28 29 if (fail != 0) 30 abort (); 31 32 } 33