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