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