1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
4 /* The integer variable shift and rotate instructions truncate their
5 shift amounts by the datasize. Make sure that we don't emit a redundant
15 f2 (unsigned long long x
, int y
)
21 f3 (unsigned long long bit_addr
, int y
)
23 unsigned long bitnumb
= bit_addr
& 63;
24 return (1LL << bitnumb
);
28 f4 (unsigned int x
, unsigned int y
)
31 return x
>> y
| (x
<< (32 - y
));
35 f5 (unsigned long long x
, unsigned long long y
)
38 return x
>> y
| (x
<< (64 - y
));
42 f6 (unsigned int x
, unsigned int y
)
44 return (x
<< (32 - (y
& 31)));
48 f7 (unsigned long long x
, unsigned long long y
)
50 return (x
<< (64 - (y
& 63)));
54 f8 (unsigned long long x
, unsigned long long y
)
56 return (x
<< -(y
& 63));
59 /* { dg-final { scan-assembler-times "lsl\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+" 2 } } */
60 /* { dg-final { scan-assembler-times "lsl\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+" 4 } } */
61 /* { dg-final { scan-assembler-times "ror\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+" 1 } } */
62 /* { dg-final { scan-assembler-times "ror\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+" 1 } } */
63 /* { dg-final { scan-assembler-not "and\tw\[0-9\]+, w\[0-9\]+, 31" } } */
64 /* { dg-final { scan-assembler-not "and\tx\[0-9\]+, x\[0-9\]+, 63" } } */
65 /* { dg-final { scan-assembler-not "sub\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+" } } */