2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
7 #include "avx512f-helper.h"
9 #define SIZE (AVX512F_LEN / 32)
10 #include "avx512f-mask-type.h"
13 CALC (float *s1
, float *s2
, float *s3
, float *r
)
17 for (i
= 0; i
< SIZE
; i
++)
19 r
[i
] = -s1
[i
] * s2
[i
] + s3
[i
];
26 UNION_TYPE (AVX512F_LEN
, ) s1
, s2
, s3
, res1
, res2
, res3
, res4
;
27 MASK_TYPE mask
= MASK_VALUE
;
32 for (i
= 0; i
< SIZE
; i
++)
34 s1
.a
[i
] = DEFAULT_VALUE
;
35 s2
.a
[i
] = 56.78 * (i
+ 1) * sign
;
36 s3
.a
[i
] = 90.12 * (i
+ 2) * sign
;
40 #if AVX512F_LEN == 512
41 res1
.x
= INTRINSIC (_fnmadd_ps
) (s1
.x
, s2
.x
, s3
.x
);
43 res2
.x
= INTRINSIC (_mask_fnmadd_ps
) (s1
.x
, mask
, s2
.x
, s3
.x
);
44 res3
.x
= INTRINSIC (_mask3_fnmadd_ps
) (s2
.x
, s3
.x
, s1
.x
, mask
);
45 res4
.x
= INTRINSIC (_maskz_fnmadd_ps
) (mask
, s1
.x
, s2
.x
, s3
.x
);
47 CALC (s1
.a
, s2
.a
, s3
.a
, res_ref1
);
48 CALC (s2
.a
, s3
.a
, s1
.a
, res_ref2
);
50 #if AVX512F_LEN == 512
51 if (UNION_ROUGH_CHECK (AVX512F_LEN
, ) (res1
, res_ref1
, 0.0001))
55 MASK_MERGE () (res_ref1
, mask
, SIZE
);
56 if (UNION_ROUGH_CHECK (AVX512F_LEN
, ) (res2
, res_ref1
, 0.0001))
59 MASK_MERGE () (res_ref2
, mask
, SIZE
);
60 if (UNION_ROUGH_CHECK (AVX512F_LEN
, ) (res3
, res_ref2
, 0.0001))
63 MASK_ZERO () (res_ref1
, mask
, SIZE
);
64 if (UNION_ROUGH_CHECK (AVX512F_LEN
, ) (res4
, res_ref1
, 0.0001))