1 /* { dg-do run } */ 2 /* { dg-options "-O2 -mavx512f -mvaes" } */ 3 /* { dg-require-effective-target avx512f } */ 4 /* { dg-require-effective-target avx512vaes } */ 5 6 #define AVX512F 7 8 #define VAES 9 #include "avx512f-helper.h" 10 11 #define SIZE (AVX512F_LEN / 32) 12 13 #include "avx512f-mask-type.h" 14 15 static void CALC(unsigned int * r)16CALC (unsigned int *r) 17 { 18 for (int i = 0; i < SIZE; i+=4) 19 { 20 r[i] = 0x5fb152c4; 21 r[i + 1] = 0x7ba60590; 22 r[i + 2] = 0x69e541f9; 23 r[i + 3] = 0xe2bd22fb; 24 } 25 } 26 27 void TEST(void)28TEST (void) 29 { 30 int i; 31 UNION_TYPE (AVX512F_LEN, i_ud) res1, src1, src2; 32 MASK_TYPE mask = MASK_VALUE; 33 unsigned int res_ref[SIZE]; 34 35 for (int i = 0; i < SIZE; i+=4) 36 { 37 src1.a[i] = 0x5d53475d; 38 src1.a[i + 1] = 0x63746f72; 39 src1.a[i + 2] = 0x73745665; 40 src1.a[i + 3] = 0x7b5b5465; 41 src2.a[i] = 0x726f6e5d; 42 src2.a[i + 1] = 0x5b477565; 43 src2.a[i + 2] = 0x68617929; 44 src2.a[i + 3] = 0x48692853; 45 } 46 47 CALC (res_ref); 48 res1.x = INTRINSIC (_aesenc_epi128) (src2.x, src1.x); 49 50 if (UNION_CHECK (AVX512F_LEN, i_ud) (res1, res_ref)) 51 abort (); 52 } 53