gcc/testsuite/gcc.target/s390/rotate-truncation-mask.c
raw| 1 | /* Check that we do not use (64 - sh) for rotating. */ |
| 2 | |
| 3 | /* { dg-options "-O1 -m64" } */ |
| 4 | |
| 5 | /* { dg-final { scan-assembler "lcr\t%r.+,%r.+" } } */ |
| 6 | /* { dg-final { scan-assembler-not "lhi\t%r.+,64" } } */ |
| 7 | /* { dg-final { scan-assembler-not "sr\t%r.+,%r.+" } } */ |
| 8 | unsigned long rotr (unsigned long in, unsigned long sh) |
| 9 | { |
| 10 | return (in >> sh) | (in << (64 - sh)); |
| 11 | } |