| 1 |
/* { dg-do assemble } */ |
| 2 |
/* { dg-final { scan-assembler "movu.w \\\$r10,\\\$|movu.w 2045," } } */ |
| 3 |
/* { dg-final { scan-assembler "and.w 2045,\\\$|and.d \\\$r10," } } */ |
| 4 |
/* { dg-final { scan-assembler-not "move.d \\\$r10,\\\$" } } */ |
| 5 |
/* { dg-final { scan-assembler "movu.b \\\$r10,\\\$|movu.b 95," } } */ |
| 6 |
/* { dg-final { scan-assembler "and.b 95,\\\$|and.d \\\$r10," } } */ |
| 7 |
/* { dg-final { scan-assembler "andq -2,\\\$" } } */ |
| 8 |
/* { dg-final { scan-assembler-not "movu.b 254,\\\$" } } */ |
| 9 |
/* { dg-options "-O2 -save-temps" } */ |
| 10 |
|
| 11 |
/* Originally used to test the "andu" peephole2 trivially, register operand. |
| 12 |
Due to reload changes (r186861), the suboptimal sequence isn't |
| 13 |
generated and the peephole2 doesn't trig for this trivial code |
| 14 |
anymore. Another minimal sequence is generated, where the constant |
| 15 |
is loaded to a free register first. Instead another case is exposed; |
| 16 |
handled by the "andqu" peephole2, trigged by and_peep2_q (the andq |
| 17 |
and scan-assembler-not-movu.b lines above). */ |
| 18 |
|
| 19 |
unsigned int |
| 20 |
and_peep2_hi (unsigned int y, unsigned int *x) |
| 21 |
{ |
| 22 |
*x = y & 0x7fd; |
| 23 |
return y; |
| 24 |
} |
| 25 |
|
| 26 |
unsigned int |
| 27 |
and_peep2_qi (unsigned int y, unsigned int *x) |
| 28 |
{ |
| 29 |
*x = y & 0x5f; |
| 30 |
return y; |
| 31 |
} |
| 32 |
|
| 33 |
|
| 34 |
unsigned int |
| 35 |
and_peep2_q (unsigned int y, unsigned int *x) |
| 36 |
{ |
| 37 |
*x = y & 0xfe; |
| 38 |
return y; |
| 39 |
} |