2 /* { dg-options "-O2 -mavx512ifma" } */
3 /* { dg-require-effective-target avx512ifma } */
7 #include "avx512f-helper.h"
9 #define SIZE (AVX512F_LEN / 64)
10 #include "avx512f-mask-type.h"
13 CALC (long long *r
, long long *s1
, long long *s2
, long long *s3
)
18 for (i
= 0; i
< SIZE
; i
++)
20 /* Simulate higher 52 bits out of 104 bit,
21 by shifting opernads with 0 in lower 26 bits. */
31 UNION_TYPE (AVX512F_LEN
, i_q
) src1
, src2
, dst1
, dst2
, dst3
;
32 long long dst_ref
[SIZE
];
34 MASK_TYPE mask
= MASK_VALUE
;
36 for (i
= 0; i
< SIZE
; i
++)
38 src1
.a
[i
] = 15 + 3467 * i
;
40 src1
.a
[i
] = src1
.a
[i
] << 26;
41 src1
.a
[i
] = src1
.a
[i
] << 26;
42 src1
.a
[i
] &= ((1LL << 52) - 1);
43 src2
.a
[i
] &= ((1LL << 52) - 1);
44 dst1
.a
[i
] = DEFAULT_VALUE
;
45 dst2
.a
[i
] = DEFAULT_VALUE
;
46 dst3
.a
[i
] = DEFAULT_VALUE
;
49 CALC (dst_ref
, dst1
.a
, src1
.a
, src2
.a
);
50 dst1
.x
= INTRINSIC (_madd52hi_epu64
) (dst1
.x
, src1
.x
, src2
.x
);
51 dst2
.x
= INTRINSIC (_mask_madd52hi_epu64
) (dst2
.x
, mask
, src1
.x
, src2
.x
);
52 dst3
.x
= INTRINSIC (_maskz_madd52hi_epu64
) (mask
, dst3
.x
, src1
.x
, src2
.x
);
54 if (UNION_CHECK (AVX512F_LEN
, i_q
) (dst1
, dst_ref
))
57 MASK_MERGE (i_q
) (dst_ref
, mask
, SIZE
);
58 if (UNION_CHECK (AVX512F_LEN
, i_q
) (dst2
, dst_ref
))
61 MASK_ZERO (i_q
) (dst_ref
, mask
, SIZE
);
62 if (UNION_CHECK (AVX512F_LEN
, i_q
) (dst3
, dst_ref
))