Dan Gohman | b7c0b24 | 2009-09-11 18:36:27 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=cellspu > %t1.s |
| 2 | ; RUN: llc < %s -march=cellspu -mattr=large_mem > %t2.s |
Scott Michel | 053c1da | 2008-01-29 02:16:57 +0000 | [diff] [blame] | 3 | ; RUN: grep lqa %t1.s | count 5 |
| 4 | ; RUN: grep lqd %t1.s | count 11 |
| 5 | ; RUN: grep rotqbyi %t1.s | count 7 |
Evan Cheng | 3927f43 | 2009-03-25 20:20:11 +0000 | [diff] [blame] | 6 | ; RUN: grep xshw %t1.s | count 1 |
| 7 | ; RUN: grep andi %t1.s | count 5 |
Chris Lattner | 994d6cf | 2008-01-18 19:53:43 +0000 | [diff] [blame] | 8 | ; RUN: grep cbd %t1.s | count 3 |
| 9 | ; RUN: grep chd %t1.s | count 1 |
| 10 | ; RUN: grep cwd %t1.s | count 3 |
| 11 | ; RUN: grep shufb %t1.s | count 7 |
Scott Michel | 053c1da | 2008-01-29 02:16:57 +0000 | [diff] [blame] | 12 | ; RUN: grep stqd %t1.s | count 7 |
| 13 | ; RUN: grep iohl %t2.s | count 16 |
| 14 | ; RUN: grep ilhu %t2.s | count 16 |
| 15 | ; RUN: grep lqd %t2.s | count 16 |
| 16 | ; RUN: grep rotqbyi %t2.s | count 7 |
Evan Cheng | 3927f43 | 2009-03-25 20:20:11 +0000 | [diff] [blame] | 17 | ; RUN: grep xshw %t2.s | count 1 |
| 18 | ; RUN: grep andi %t2.s | count 5 |
Scott Michel | 053c1da | 2008-01-29 02:16:57 +0000 | [diff] [blame] | 19 | ; RUN: grep cbd %t2.s | count 3 |
| 20 | ; RUN: grep chd %t2.s | count 1 |
| 21 | ; RUN: grep cwd %t2.s | count 3 |
Chris Lattner | 994d6cf | 2008-01-18 19:53:43 +0000 | [diff] [blame] | 22 | ; RUN: grep shufb %t2.s | count 7 |
Scott Michel | 053c1da | 2008-01-29 02:16:57 +0000 | [diff] [blame] | 23 | ; RUN: grep stqd %t2.s | count 7 |
Scott Michel | 497e888 | 2008-01-11 21:01:19 +0000 | [diff] [blame] | 24 | |
Dan Gohman | 65fd656 | 2011-11-03 21:49:52 +0000 | [diff] [blame] | 25 | ; CellSPU legalization is over-sensitive to Legalize's traversal order. |
| 26 | ; XFAIL: * |
| 27 | |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 28 | ; ModuleID = 'struct_1.bc' |
| 29 | target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128" |
| 30 | target triple = "spu" |
| 31 | |
| 32 | ; struct hackstate { |
| 33 | ; unsigned char c1; // offset 0 (rotate left by 13 bytes to byte 3) |
| 34 | ; unsigned char c2; // offset 1 (rotate left by 14 bytes to byte 3) |
| 35 | ; unsigned char c3; // offset 2 (rotate left by 15 bytes to byte 3) |
| 36 | ; int i1; // offset 4 (rotate left by 4 bytes to byte 0) |
| 37 | ; short s1; // offset 8 (rotate left by 6 bytes to byte 2) |
| 38 | ; int i2; // offset 12 [ignored] |
| 39 | ; unsigned char c4; // offset 16 [ignored] |
| 40 | ; unsigned char c5; // offset 17 [ignored] |
Scott Michel | f0569be | 2008-12-27 04:51:36 +0000 | [diff] [blame] | 41 | ; unsigned char c6; // offset 18 (rotate left by 14 bytes to byte 3) |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 42 | ; unsigned char c7; // offset 19 (no rotate, in preferred slot) |
| 43 | ; int i3; // offset 20 [ignored] |
| 44 | ; int i4; // offset 24 [ignored] |
| 45 | ; int i5; // offset 28 [ignored] |
| 46 | ; int i6; // offset 32 (no rotate, in preferred slot) |
| 47 | ; } |
| 48 | %struct.hackstate = type { i8, i8, i8, i32, i16, i32, i8, i8, i8, i8, i32, i32, i32, i32 } |
| 49 | |
| 50 | ; struct hackstate state = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } |
| 51 | @state = global %struct.hackstate zeroinitializer, align 16 |
| 52 | |
Chris Lattner | 26b0000 | 2011-06-17 03:14:27 +0000 | [diff] [blame] | 53 | define zeroext i8 @get_hackstate_c1() nounwind { |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 54 | entry: |
Scott Michel | 53dec47 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 55 | %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 0), align 16 |
| 56 | ret i8 %tmp2 |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 57 | } |
| 58 | |
Chris Lattner | 26b0000 | 2011-06-17 03:14:27 +0000 | [diff] [blame] | 59 | define zeroext i8 @get_hackstate_c2() nounwind { |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 60 | entry: |
Scott Michel | 53dec47 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 61 | %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 1), align 16 |
| 62 | ret i8 %tmp2 |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 63 | } |
| 64 | |
Chris Lattner | 26b0000 | 2011-06-17 03:14:27 +0000 | [diff] [blame] | 65 | define zeroext i8 @get_hackstate_c3() nounwind { |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 66 | entry: |
Scott Michel | 53dec47 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 67 | %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 2), align 16 |
| 68 | ret i8 %tmp2 |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 69 | } |
| 70 | |
Scott Michel | 053c1da | 2008-01-29 02:16:57 +0000 | [diff] [blame] | 71 | define i32 @get_hackstate_i1() nounwind { |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 72 | entry: |
Scott Michel | 53dec47 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 73 | %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 3), align 16 |
| 74 | ret i32 %tmp2 |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 75 | } |
| 76 | |
Chris Lattner | 26b0000 | 2011-06-17 03:14:27 +0000 | [diff] [blame] | 77 | define signext i16 @get_hackstate_s1() nounwind { |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 78 | entry: |
Scott Michel | 53dec47 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 79 | %tmp2 = load i16* getelementptr (%struct.hackstate* @state, i32 0, i32 4), align 16 |
| 80 | ret i16 %tmp2 |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 81 | } |
| 82 | |
Chris Lattner | 26b0000 | 2011-06-17 03:14:27 +0000 | [diff] [blame] | 83 | define zeroext i8 @get_hackstate_c6() nounwind { |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 84 | entry: |
Scott Michel | 53dec47 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 85 | %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 8), align 16 |
| 86 | ret i8 %tmp2 |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 87 | } |
| 88 | |
Chris Lattner | 26b0000 | 2011-06-17 03:14:27 +0000 | [diff] [blame] | 89 | define zeroext i8 @get_hackstate_c7() nounwind { |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 90 | entry: |
Scott Michel | 53dec47 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 91 | %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 9), align 16 |
| 92 | ret i8 %tmp2 |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 93 | } |
| 94 | |
Scott Michel | 053c1da | 2008-01-29 02:16:57 +0000 | [diff] [blame] | 95 | define i32 @get_hackstate_i3() nounwind { |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 96 | entry: |
Scott Michel | 53dec47 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 97 | %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 10), align 16 |
| 98 | ret i32 %tmp2 |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 99 | } |
| 100 | |
Scott Michel | 053c1da | 2008-01-29 02:16:57 +0000 | [diff] [blame] | 101 | define i32 @get_hackstate_i6() nounwind { |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 102 | entry: |
Scott Michel | 53dec47 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 103 | %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 13), align 16 |
| 104 | ret i32 %tmp2 |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 105 | } |
| 106 | |
Scott Michel | 053c1da | 2008-01-29 02:16:57 +0000 | [diff] [blame] | 107 | define void @set_hackstate_c1(i8 zeroext %c) nounwind { |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 108 | entry: |
Scott Michel | 53dec47 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 109 | store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 0), align 16 |
| 110 | ret void |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 111 | } |
| 112 | |
Scott Michel | 053c1da | 2008-01-29 02:16:57 +0000 | [diff] [blame] | 113 | define void @set_hackstate_c2(i8 zeroext %c) nounwind { |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 114 | entry: |
Scott Michel | 53dec47 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 115 | store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 1), align 16 |
| 116 | ret void |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 117 | } |
| 118 | |
Scott Michel | 053c1da | 2008-01-29 02:16:57 +0000 | [diff] [blame] | 119 | define void @set_hackstate_c3(i8 zeroext %c) nounwind { |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 120 | entry: |
Scott Michel | 53dec47 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 121 | store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 2), align 16 |
| 122 | ret void |
Scott Michel | 9de5d0d | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 123 | } |
Scott Michel | 497e888 | 2008-01-11 21:01:19 +0000 | [diff] [blame] | 124 | |
Scott Michel | 053c1da | 2008-01-29 02:16:57 +0000 | [diff] [blame] | 125 | define void @set_hackstate_i1(i32 %i) nounwind { |
Scott Michel | 497e888 | 2008-01-11 21:01:19 +0000 | [diff] [blame] | 126 | entry: |
Scott Michel | 53dec47 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 127 | store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 3), align 16 |
| 128 | ret void |
Scott Michel | 497e888 | 2008-01-11 21:01:19 +0000 | [diff] [blame] | 129 | } |
| 130 | |
Scott Michel | 053c1da | 2008-01-29 02:16:57 +0000 | [diff] [blame] | 131 | define void @set_hackstate_s1(i16 signext %s) nounwind { |
Scott Michel | 497e888 | 2008-01-11 21:01:19 +0000 | [diff] [blame] | 132 | entry: |
Scott Michel | 53dec47 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 133 | store i16 %s, i16* getelementptr (%struct.hackstate* @state, i32 0, i32 4), align 16 |
| 134 | ret void |
Scott Michel | 497e888 | 2008-01-11 21:01:19 +0000 | [diff] [blame] | 135 | } |
| 136 | |
Scott Michel | 053c1da | 2008-01-29 02:16:57 +0000 | [diff] [blame] | 137 | define void @set_hackstate_i3(i32 %i) nounwind { |
| 138 | entry: |
Scott Michel | 53dec47 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 139 | store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 10), align 16 |
| 140 | ret void |
Scott Michel | 053c1da | 2008-01-29 02:16:57 +0000 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | define void @set_hackstate_i6(i32 %i) nounwind { |
| 144 | entry: |
Scott Michel | 53dec47 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 145 | store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 13), align 16 |
| 146 | ret void |
Scott Michel | 053c1da | 2008-01-29 02:16:57 +0000 | [diff] [blame] | 147 | } |