2 /* { dg-options "-O2 --save-temps -fno-inline" } */
4 extern void abort (void);
7 bics_si_test1 (int a
, int b
, int c
)
11 /* { dg-final { scan-assembler-not "bics\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+" } } */
12 /* { dg-final { scan-assembler-times "bic\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+" 2 } } */
20 bics_si_test2 (int a
, int b
, int c
)
22 int d
= a
& ~(b
<< 3);
24 /* { dg-final { scan-assembler-not "bics\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+, lsl 3" } } */
25 /* { dg-final { scan-assembler "bic\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+, lsl 3" } } */
32 typedef long long s64
;
35 bics_di_test1 (s64 a
, s64 b
, s64 c
)
39 /* { dg-final { scan-assembler-not "bics\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+" } } */
40 /* { dg-final { scan-assembler-times "bic\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+" 2 } } */
48 bics_di_test2 (s64 a
, s64 b
, s64 c
)
50 s64 d
= a
& ~(b
<< 3);
52 /* { dg-final { scan-assembler-not "bics\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+, lsl 3" } } */
53 /* { dg-final { scan-assembler "bic\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+, lsl 3" } } */
66 x
= bics_si_test1 (29, ~4, 5);
67 if (x
!= ((29 & 4) + ~4 + 5))
70 x
= bics_si_test1 (5, ~2, 20);
74 x
= bics_si_test2 (35, ~4, 5);
75 if (x
!= ((35 & ~(~4 << 3)) + ~4 + 5))
78 x
= bics_si_test2 (96, ~2, 20);
82 y
= bics_di_test1 (0x130000029ll
,
86 if (y
!= ((0x130000029ll
& 0x320000004ll
) + ~0x320000004ll
+ 0x505050505ll
))
89 y
= bics_di_test1 (0x5000500050005ll
,
92 if (y
!= 0x5000500052025ll
)
95 y
= bics_di_test2 (0x130000029ll
,
98 if (y
!= ((0x130000029ll
& ~(~0x064000008ll
<< 3))
99 + ~0x064000008ll
+ 0x505050505ll
))
102 y
= bics_di_test2 (0x130002900ll
,
105 if (y
!= (0x130002900ll
+ 0x505050505ll
))