2 /* { dg-options "-O2 --save-temps -fno-inline" } */
4 extern void abort (void);
7 ands_si_test1 (int a
, int b
, int c
)
11 /* { dg-final { scan-assembler-times "ands\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+" 2 } } */
19 ands_si_test2 (int a
, int b
, int c
)
23 /* { dg-final { scan-assembler "ands\tw\[0-9\]+, w\[0-9\]+, 255" } } */
31 ands_si_test3 (int a
, int b
, int c
)
35 /* { dg-final { scan-assembler "ands\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+, lsl 3" } } */
42 typedef long long s64
;
45 ands_di_test1 (s64 a
, s64 b
, s64 c
)
49 /* { dg-final { scan-assembler-times "ands\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+" 2 } } */
57 ands_di_test2 (s64 a
, s64 b
, s64 c
)
61 /* { dg-final { scan-assembler "ands\tx\[0-9\]+, x\[0-9\]+, 255" } } */
69 ands_di_test3 (s64 a
, s64 b
, s64 c
)
73 /* { dg-final { scan-assembler "ands\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+, lsl 3" } } */
86 x
= ands_si_test1 (29, 4, 5);
90 x
= ands_si_test1 (5, 2, 20);
94 x
= ands_si_test2 (29, 4, 5);
98 x
= ands_si_test2 (1024, 2, 20);
102 x
= ands_si_test3 (35, 4, 5);
106 x
= ands_si_test3 (5, 2, 20);
110 y
= ands_di_test1 (0x130000029ll
,
114 if (y
!= ((0x130000029ll
& 0x320000004ll
) + 0x320000004ll
+ 0x505050505ll
))
117 y
= ands_di_test1 (0x5000500050005ll
,
120 if (y
!= 0x5000500052025ll
)
123 y
= ands_di_test2 (0x130000029ll
,
126 if (y
!= ((0x130000029ll
& 0xff) + 0x320000004ll
+ 0x505050505ll
))
129 y
= ands_di_test2 (0x130002900ll
,
132 if (y
!= (0x130002900ll
+ 0x505050505ll
))
135 y
= ands_di_test3 (0x130000029ll
,
138 if (y
!= ((0x130000029ll
& (0x064000008ll
<< 3))
139 + 0x064000008ll
+ 0x505050505ll
))
142 y
= ands_di_test3 (0x130002900ll
,
145 if (y
!= (0x130002900ll
+ 0x505050505ll
))
151 /* { dg-final { cleanup-saved-temps } } */