2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
7 #include "avx512f-helper.h"
9 #define SIZE (AVX512F_LEN / 64)
10 #include "avx512f-mask-type.h"
13 CALC (double *s1
, double *s2
, double *s3
, double *r
)
17 for (i
= 0; i
< SIZE
; i
++)
19 r
[i
] = s1
[i
] * s2
[i
] - s3
[i
];
26 UNION_TYPE (AVX512F_LEN
, d
) s1
, s2
, s3
, res1
, res2
, res3
, res4
;
27 MASK_TYPE mask
= MASK_VALUE
;
28 double res_ref1
[SIZE
];
29 double res_ref2
[SIZE
];
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 (_fmsub_pd
) (s1
.x
, s2
.x
, s3
.x
);
43 res2
.x
= INTRINSIC (_mask_fmsub_pd
) (s1
.x
, mask
, s2
.x
, s3
.x
);
44 res3
.x
= INTRINSIC (_mask3_fmsub_pd
) (s2
.x
, s3
.x
, s1
.x
, mask
);
45 res4
.x
= INTRINSIC (_maskz_fmsub_pd
) (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
, d
) (res1
, res_ref1
, 0.0001))
55 MASK_MERGE (d
) (res_ref1
, mask
, SIZE
);
56 if (UNION_ROUGH_CHECK (AVX512F_LEN
, d
) (res2
, res_ref1
, 0.0001))
59 MASK_MERGE (d
) (res_ref2
, mask
, SIZE
);
60 if (UNION_ROUGH_CHECK (AVX512F_LEN
, d
) (res3
, res_ref2
, 0.0001))
63 MASK_ZERO (d
) (res_ref1
, mask
, SIZE
);
64 if (UNION_ROUGH_CHECK (AVX512F_LEN
, d
) (res4
, res_ref1
, 0.0001))