2 /* { dg-options "-O2 --save-temps -fno-inline" } */
4 extern void abort (void);
7 tst_si_test1 (int a
, int b
, int c
)
11 /* { dg-final { scan-assembler-not "tst\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+" } } */
12 /* { dg-final { scan-assembler-times "and\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+" 2 } } */
20 tst_si_test2 (int a
, int b
, int c
)
22 int d
= a
& 0x99999999;
24 /* { dg-final { scan-assembler-not "tst\tw\[0-9\]+, w\[0-9\]+, -1717986919" } } */
25 /* { dg-final { scan-assembler "and\tw\[0-9\]+, w\[0-9\]+, -1717986919" } } */
33 tst_si_test3 (int a
, int b
, int c
)
37 /* { dg-final { scan-assembler-not "tst\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+, lsl 3" } } */
38 /* { dg-final { scan-assembler "and\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+, lsl 3" } } */
45 typedef long long s64
;
48 tst_di_test1 (s64 a
, s64 b
, s64 c
)
52 /* { dg-final { scan-assembler-not "tst\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+" } } */
53 /* { dg-final { scan-assembler-times "and\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+" 2 } } */
61 tst_di_test2 (s64 a
, s64 b
, s64 c
)
63 s64 d
= a
& 0xaaaaaaaaaaaaaaaall
;
65 /* { dg-final { scan-assembler-not "tst\tx\[0-9\]+, x\[0-9\]+, -6148914691236517206" } } */
66 /* { dg-final { scan-assembler "and\tx\[0-9\]+, x\[0-9\]+, -6148914691236517206" } } */
74 tst_di_test3 (s64 a
, s64 b
, s64 c
)
78 /* { dg-final { scan-assembler-not "tst\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+, lsl 3" } } */
79 /* { dg-final { scan-assembler "and\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+, lsl 3" } } */
92 x
= tst_si_test1 (29, 4, 5);
96 x
= tst_si_test1 (5, 2, 20);
100 x
= tst_si_test2 (29, 4, 5);
104 x
= tst_si_test2 (1024, 2, 20);
108 x
= tst_si_test3 (35, 4, 5);
112 x
= tst_si_test3 (5, 2, 20);
116 y
= tst_di_test1 (0x130000029ll
,
123 y
= tst_di_test1 (0x5000500050005ll
,
129 y
= tst_di_test2 (0x130000029ll
,
135 y
= tst_di_test2 (0x540004100ll
,
141 y
= tst_di_test3 (0x130000029ll
,
147 y
= tst_di_test3 (0x130002900ll
,