| 1 |
/* PR target/100056 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2" } */ |
| 4 |
/* { dg-final { scan-assembler-not {\t[us]bfiz\tw[0-9]+, w[0-9]+, 11} { xfail *-*-* } } } */ |
| 5 |
/* { dg-final { scan-assembler-times {\t[us]bfiz\tw[0-9]+, w[0-9]+, 11} 2 } } */ |
| 6 |
/* { dg-final { scan-assembler-times {\tadd\tw[0-9]+, w[0-9]+, w[0-9]+, uxtb\n} 2 } } */ |
| 7 |
|
| 8 |
int |
| 9 |
or_shift_u8 (unsigned char i) |
| 10 |
{ |
| 11 |
return i | (i << 11); |
| 12 |
} |
| 13 |
|
| 14 |
int |
| 15 |
or_shift_u3a (unsigned i) |
| 16 |
{ |
| 17 |
i &= 7; |
| 18 |
return i | (i << 11); |
| 19 |
} |
| 20 |
|
| 21 |
int |
| 22 |
or_shift_u3b (unsigned i) |
| 23 |
{ |
| 24 |
i = (i << 29) >> 29; |
| 25 |
return i | (i << 11); |
| 26 |
} |
| 27 |
|
| 28 |
int |
| 29 |
or_shift_s16 (signed short i) |
| 30 |
{ |
| 31 |
return i | (i << 11); |
| 32 |
} |
| 33 |
|
| 34 |
int |
| 35 |
or_shift_s8 (signed char i) |
| 36 |
{ |
| 37 |
return i | (i << 11); |
| 38 |
} |
| 39 |
|
| 40 |
int |
| 41 |
or_shift_s13 (int i) |
| 42 |
{ |
| 43 |
i = (i << 19) >> 19; |
| 44 |
return i | (i << 11); |
| 45 |
} |
| 46 |
|
| 47 |
int |
| 48 |
or_shift_s3 (int i) |
| 49 |
{ |
| 50 |
i = (i << 29) >> 29; |
| 51 |
return i | (i << 11); |
| 52 |
} |
| 53 |
|
| 54 |
int |
| 55 |
or_shift_u8_asm (unsigned char x) |
| 56 |
{ |
| 57 |
unsigned char i = x; |
| 58 |
asm volatile ("" : "+r" (i)); |
| 59 |
return i | (i << 11); |
| 60 |
} |