gcc/testsuite/g++.target/i386/pr110792.C
raw| 1 | /* { dg-do compile { target ia32 } } */ |
| 2 | /* { dg-options "-O2" } */ |
| 3 | |
| 4 | template <int ROT, typename T> |
| 5 | inline T rotr(T input) |
| 6 | { |
| 7 | return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT))); |
| 8 | } |
| 9 | |
| 10 | unsigned long long WHIRL_S[256] = {0x18186018C07830D8}; |
| 11 | unsigned long long whirl(unsigned char x0) |
| 12 | { |
| 13 | const unsigned long long s4 = WHIRL_S[x0&0xFF]; |
| 14 | return rotr<32>(s4); |
| 15 | } |
| 16 | /* { dg-final { scan-assembler-not "movl\tWHIRL_S\\+4\\(,%eax,8\\), %eax" } } */ |