|
| 1 | +/* { dg-do compile } */ |
| 2 | +/* { dg-require-effective-target rv64 } */ |
| 3 | +/* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Oz" "-Os" "-Og" } } */ |
| 4 | +/* { dg-options "-mtune=arc-v-rpx-100-series -march=rv64imd -mabi=lp64d -fdump-rtl-sched2 -Wno-int-to-pointer-cast" } */ |
| 5 | + |
| 6 | +void |
| 7 | +foo (int *a) |
| 8 | +{ |
| 9 | + a[2] = a[1] * a[0]; |
| 10 | + |
| 11 | +} |
| 12 | + |
| 13 | +void foo_high(long *b) { |
| 14 | + b[2] = ((__int128)b[1] * (__int128)b[0]) >> 64; |
| 15 | +} |
| 16 | + |
| 17 | +void foo_low(long *b) { |
| 18 | + b[2] = b[1] * b[0]; |
| 19 | +} |
| 20 | + |
| 21 | +void |
| 22 | +bar (int *a) |
| 23 | +{ |
| 24 | + int *addr = (int *) (a[1] * a[2]); |
| 25 | + *addr = 0; |
| 26 | +} |
| 27 | + |
| 28 | +void |
| 29 | +bar_low (long *a) |
| 30 | +{ |
| 31 | + long *addr = (long *) (a[1] * a[2]); |
| 32 | + *addr = 0; |
| 33 | +} |
| 34 | + |
| 35 | +void |
| 36 | +bar_high (long *a) |
| 37 | +{ |
| 38 | + long *addr = (long *) (((__int128) a[1] * (__int128) a[2]) >> 64); |
| 39 | + *addr = 0; |
| 40 | +} |
| 41 | + |
| 42 | +int |
| 43 | +baz (int *a) |
| 44 | +{ |
| 45 | + int *addr = (int *) (a[1] * a[2]); |
| 46 | + return *addr; |
| 47 | +} |
| 48 | + |
| 49 | +long |
| 50 | +baz_low (long *a) |
| 51 | +{ |
| 52 | + long *addr = (long *) (a[1] * a[2]); |
| 53 | + return *addr; |
| 54 | +} |
| 55 | + |
| 56 | +long baz_high(long *a) { |
| 57 | + long *addr = (long *)(((__int128) a[1] * (__int128) a[2]) >> 64); |
| 58 | + return *addr; |
| 59 | +} |
| 60 | + |
| 61 | +/* Verify MULW to STORE data delay is 1 cycle. */ |
| 62 | +/* { dg-final { scan-rtl-dump "(?s);; Function foo.*?;;\\s+1-->.*i\\s+\\d+\\s+.*\\*.*:\\(arcv.*?;;\\s+2-->.*\\\[.*0x8\\\]=" "sched2" } } */ |
| 63 | +/* Verify MULW to STORE address delay is 7 cycles. */ |
| 64 | +/* { dg-final { scan-rtl-dump "(?s);; Function bar.*?;;\\s+1-->.*i\\s+\\d+\\s+.*\\*.*:\\(arcv.*?;;\\s+8-->.*\\\[.*\\\]=0" "sched2" } } */ |
| 65 | +/* Verify MULW to LOAD address delay is 7 cycles. */ |
| 66 | +/* { dg-final { scan-rtl-dump "(?s);; Function baz.*?;;\\s+1-->.*i\\s+\\d+\\s+.*\\*.*:\\(arcv.*?;;\\s+8-->.*=.*\\\[.*\\\]" "sched2" } } */ |
| 67 | + |
| 68 | +/* Verify MUL to STORE data delay is 1 cycle. */ |
| 69 | +/* { dg-final { scan-rtl-dump "(?s);; Function foo_low.*?;;\\s+1-->.*i\\s+\\d+\\s+.*\\*.*:\\(arcv.*?;;\\s+2-->.*\\\[.*0x10\\\]=" "sched2" } } */ |
| 70 | +/* Verify MUL to STORE address delay is 9 cycles. */ |
| 71 | +/* { dg-final { scan-rtl-dump "(?s);; Function bar_low.*?;;\\s+1-->.*i\\s+\\d+\\s+.*\\*.*:\\(arcv.*?;;\\s+10-->.*\\\[.*\\\]=0" "sched2" } } */ |
| 72 | +/* Verify MUL to LOAD address delay is 9 cycles. */ |
| 73 | +/* { dg-final { scan-rtl-dump "(?s);; Function baz_low.*?;;\\s+1-->.*i\\s+\\d+\\s+.*\\*.*:\\(arcv.*?;;\\s+10-->.*=.*\\\[.*\\\]" "sched2" } } */ |
| 74 | + |
| 75 | +/* Verify MULH to STORE data delay is 1 cycle. */ |
| 76 | +/* { dg-final { scan-rtl-dump "(?s);; Function foo_high.*?;;\\s+1-->.*i\\s+\\d+\\s+.*\\*.*:\\(arcv.*?;;\\s+2-->.*\\\[.*0x10\\\]=" "sched2" } } */ |
| 77 | +/* Verify MULH to STORE address delay is 10 cycles. */ |
| 78 | +/* { dg-final { scan-rtl-dump "(?s);; Function bar_high.*?;;\\s+1-->.*i\\s+\\d+\\s+.*\\*.*:\\(arcv.*?;;\\s+11-->.*\\\[.*\\\]=0" "sched2" } } */ |
| 79 | +/* Verify MULH to LOAD address delay is 10 cycles. */ |
| 80 | +/* { dg-final { scan-rtl-dump "(?s);; Function baz_high.*?;;\\s+1-->.*i\\s+\\d+\\s+.*\\*.*:\\(arcv.*?;;\\s+11-->.*=.*\\\[.*\\\]" "sched2" } } */ |
0 commit comments