2018-05-17 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / bmi-andn-1.c
blobbf0685ad380984c8f4715bc1790f163be69a3b06
1 /* { dg-do run { target { bmi && { ! ia32 } } } } */
2 /* { dg-options "-O2 -mbmi -fno-inline" } */
4 #include <x86intrin.h>
6 #include "bmi-check.h"
8 long long calc_andn_u64 (long long src1,
9 long long src2,
10 long long dummy)
12 return (~src1 + dummy) & (src2);
15 static void
16 bmi_test()
18 unsigned i;
20 long long src = 0xfacec0ffeefacec0;
21 long long res, res_ref;
23 for (i=0; i<5; ++i) {
24 src = i + src << i;
26 res_ref = calc_andn_u64 (src, src+i, 0);
27 res = __andn_u64 (src, src+i);
29 if (res != res_ref)
30 abort();