1 /* { dg-do run } */ 2 /* { dg-options "-O3 -mavx512bw" } */ 3 /* { dg-require-effective-target avx512bw } */ 4 5 #define AVX512BW 6 #include "avx512f-helper.h" 7 8 unsigned long long int hash(unsigned long long int seed,unsigned long long int v)9hash(unsigned long long int seed, unsigned long long int v) 10 { 11 return seed ^ (v + 0x9e3779b9 + (seed<<6) + (seed>>2)); 12 } 13 14 unsigned int a [100]; 15 signed char b [100]; 16 signed char c [100]; 17 18 void init()19init () 20 { 21 for (int i = 0; i < 100; ++i) 22 { 23 a [i] = 1000L; 24 b [i] = 10; 25 c [i] = 5; 26 } 27 } 28 29 void foo()30foo () 31 { 32 for (int i = 0; i < 100; ++i) 33 b [i] = (!b [i] ^ (a [i] >= b [i])) + c [i]; 34 } 35 36 unsigned long long int checksum()37checksum () 38 { 39 unsigned long long int seed = 0ULL; 40 for (int i = 0; i < 100; ++i) 41 seed = hash (seed, b[i]); 42 return seed; 43 } 44 45 void TEST()46TEST () 47 { 48 init (); 49 foo (); 50 if (checksum () != 5785906989299578598ULL) 51 __builtin_abort (); 52 } 53