1 /* The dynamic shift library functions truncate the shift count to 5 bits.
2 Verify that this is taken into account and no extra shift count
3 truncations are generated before the library call. */
4 /* { dg-do compile { target { ! has_dyn_shift } } } */
5 /* { dg-options "-O1" } */
6 /* { dg-final { scan-assembler-not "and" } } */
7 /* { dg-final { scan-assembler-not "#31" } } */
8
9 int
10 test00 (unsigned int a, int* b, int c, int* d, unsigned int e)
11 {
12 int s = 0;
13 int i;
14 for (i = 0; i < c; ++i)
15 s += d[i] + b[i] + (e << (i & 31));
16 return s;
17 }
18
19 int
20 test01 (unsigned int a, int* b, int c, int* d, unsigned int e)
21 {
22 int s = 0;
23 int i;
24 for (i = 0; i < c; ++i)
25 s += d[i] + b[i] + (e >> (i & 31));
26 return s;
27 }
28
29 int
30 test03 (unsigned int a, unsigned int b)
31 {
32 return b << (a & 31);
33 }
34
35 unsigned int
36 test04 (unsigned int a, int b)
37 {
38 return a >> (b & 31);
39 }