| 1 |
/* { dg-do compile { target {! ia32 } } } */ |
| 2 |
/* { dg-options "-O2 -fdump-rtl-ree" } */ |
| 3 |
|
| 4 |
|
| 5 |
#include <stdint.h> |
| 6 |
|
| 7 |
typedef int (*inst_t)(int64_t rdi, int64_t rsi, int64_t rdx); |
| 8 |
|
| 9 |
int16_t code[256]; |
| 10 |
inst_t dispatch[256]; |
| 11 |
|
| 12 |
void an_inst(int64_t rdi, int64_t rsi, int64_t rdx) { |
| 13 |
rdx = code[rdx]; |
| 14 |
uint8_t inst = (uint8_t) rdx; |
| 15 |
rdx >>= 8; |
| 16 |
dispatch[inst](rdi, rsi, rdx); |
| 17 |
} |
| 18 |
|
| 19 |
int main(void) { |
| 20 |
return 0; |
| 21 |
} |
| 22 |
|
| 23 |
/* { dg-final { scan-rtl-dump "copy needed" "ree" } } */ |
| 24 |
|