| OLD | NEW |
| 1 ; This file tests bitcasts of vector type. For most operations, these | 1 ; This file tests bitcasts of vector type. For most operations, these |
| 2 ; should be lowered to a no-op on -O2. | 2 ; should be lowered to a no-op on -O2. |
| 3 | 3 |
| 4 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ | 4 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ |
| 5 ; RUN: | FileCheck %s | 5 ; RUN: | FileCheck %s |
| 6 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \ | 6 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \ |
| 7 ; RUN: | FileCheck --check-prefix=OPTM1 %s | 7 ; RUN: | FileCheck --check-prefix=OPTM1 %s |
| 8 | 8 |
| 9 define <16 x i8> @test_bitcast_v16i8_to_v16i8(<16 x i8> %arg) { | 9 define internal <16 x i8> @test_bitcast_v16i8_to_v16i8(<16 x i8> %arg) { |
| 10 entry: | 10 entry: |
| 11 %res = bitcast <16 x i8> %arg to <16 x i8> | 11 %res = bitcast <16 x i8> %arg to <16 x i8> |
| 12 ret <16 x i8> %res | 12 ret <16 x i8> %res |
| 13 | 13 |
| 14 ; CHECK-LABEL: test_bitcast_v16i8_to_v16i8 | 14 ; CHECK-LABEL: test_bitcast_v16i8_to_v16i8 |
| 15 ; CHECK-NEXT: ret | 15 ; CHECK-NEXT: ret |
| 16 } | 16 } |
| 17 | 17 |
| 18 define <8 x i16> @test_bitcast_v16i8_to_v8i16(<16 x i8> %arg) { | 18 define internal <8 x i16> @test_bitcast_v16i8_to_v8i16(<16 x i8> %arg) { |
| 19 entry: | 19 entry: |
| 20 %res = bitcast <16 x i8> %arg to <8 x i16> | 20 %res = bitcast <16 x i8> %arg to <8 x i16> |
| 21 ret <8 x i16> %res | 21 ret <8 x i16> %res |
| 22 | 22 |
| 23 ; CHECK-LABEL: test_bitcast_v16i8_to_v8i16 | 23 ; CHECK-LABEL: test_bitcast_v16i8_to_v8i16 |
| 24 ; CHECK-NEXT: ret | 24 ; CHECK-NEXT: ret |
| 25 } | 25 } |
| 26 | 26 |
| 27 define <4 x i32> @test_bitcast_v16i8_to_v4i32(<16 x i8> %arg) { | 27 define internal <4 x i32> @test_bitcast_v16i8_to_v4i32(<16 x i8> %arg) { |
| 28 entry: | 28 entry: |
| 29 %res = bitcast <16 x i8> %arg to <4 x i32> | 29 %res = bitcast <16 x i8> %arg to <4 x i32> |
| 30 ret <4 x i32> %res | 30 ret <4 x i32> %res |
| 31 | 31 |
| 32 ; CHECK-LABEL: test_bitcast_v16i8_to_v4i32 | 32 ; CHECK-LABEL: test_bitcast_v16i8_to_v4i32 |
| 33 ; CHECK-NEXT: ret | 33 ; CHECK-NEXT: ret |
| 34 } | 34 } |
| 35 | 35 |
| 36 define <4 x float> @test_bitcast_v16i8_to_v4f32(<16 x i8> %arg) { | 36 define internal <4 x float> @test_bitcast_v16i8_to_v4f32(<16 x i8> %arg) { |
| 37 entry: | 37 entry: |
| 38 %res = bitcast <16 x i8> %arg to <4 x float> | 38 %res = bitcast <16 x i8> %arg to <4 x float> |
| 39 ret <4 x float> %res | 39 ret <4 x float> %res |
| 40 | 40 |
| 41 ; CHECK-LABEL: test_bitcast_v16i8_to_v4f32 | 41 ; CHECK-LABEL: test_bitcast_v16i8_to_v4f32 |
| 42 ; CHECK-NEXT: ret | 42 ; CHECK-NEXT: ret |
| 43 } | 43 } |
| 44 | 44 |
| 45 define <16 x i8> @test_bitcast_v8i16_to_v16i8(<8 x i16> %arg) { | 45 define internal <16 x i8> @test_bitcast_v8i16_to_v16i8(<8 x i16> %arg) { |
| 46 entry: | 46 entry: |
| 47 %res = bitcast <8 x i16> %arg to <16 x i8> | 47 %res = bitcast <8 x i16> %arg to <16 x i8> |
| 48 ret <16 x i8> %res | 48 ret <16 x i8> %res |
| 49 | 49 |
| 50 ; CHECK-LABEL: test_bitcast_v8i16_to_v16i8 | 50 ; CHECK-LABEL: test_bitcast_v8i16_to_v16i8 |
| 51 ; CHECK-NEXT: ret | 51 ; CHECK-NEXT: ret |
| 52 } | 52 } |
| 53 | 53 |
| 54 define <8 x i16> @test_bitcast_v8i16_to_v8i16(<8 x i16> %arg) { | 54 define internal <8 x i16> @test_bitcast_v8i16_to_v8i16(<8 x i16> %arg) { |
| 55 entry: | 55 entry: |
| 56 %res = bitcast <8 x i16> %arg to <8 x i16> | 56 %res = bitcast <8 x i16> %arg to <8 x i16> |
| 57 ret <8 x i16> %res | 57 ret <8 x i16> %res |
| 58 | 58 |
| 59 ; CHECK-LABEL: test_bitcast_v8i16_to_v8i16 | 59 ; CHECK-LABEL: test_bitcast_v8i16_to_v8i16 |
| 60 ; CHECK-NEXT: ret | 60 ; CHECK-NEXT: ret |
| 61 } | 61 } |
| 62 | 62 |
| 63 define <4 x i32> @test_bitcast_v8i16_to_v4i32(<8 x i16> %arg) { | 63 define internal <4 x i32> @test_bitcast_v8i16_to_v4i32(<8 x i16> %arg) { |
| 64 entry: | 64 entry: |
| 65 %res = bitcast <8 x i16> %arg to <4 x i32> | 65 %res = bitcast <8 x i16> %arg to <4 x i32> |
| 66 ret <4 x i32> %res | 66 ret <4 x i32> %res |
| 67 | 67 |
| 68 ; CHECK-LABEL: test_bitcast_v8i16_to_v4i32 | 68 ; CHECK-LABEL: test_bitcast_v8i16_to_v4i32 |
| 69 ; CHECK-NEXT: ret | 69 ; CHECK-NEXT: ret |
| 70 } | 70 } |
| 71 | 71 |
| 72 define <4 x float> @test_bitcast_v8i16_to_v4f32(<8 x i16> %arg) { | 72 define internal <4 x float> @test_bitcast_v8i16_to_v4f32(<8 x i16> %arg) { |
| 73 entry: | 73 entry: |
| 74 %res = bitcast <8 x i16> %arg to <4 x float> | 74 %res = bitcast <8 x i16> %arg to <4 x float> |
| 75 ret <4 x float> %res | 75 ret <4 x float> %res |
| 76 | 76 |
| 77 ; CHECK-LABEL: test_bitcast_v8i16_to_v4f32 | 77 ; CHECK-LABEL: test_bitcast_v8i16_to_v4f32 |
| 78 ; CHECK-NEXT: ret | 78 ; CHECK-NEXT: ret |
| 79 } | 79 } |
| 80 | 80 |
| 81 define <16 x i8> @test_bitcast_v4i32_to_v16i8(<4 x i32> %arg) { | 81 define internal <16 x i8> @test_bitcast_v4i32_to_v16i8(<4 x i32> %arg) { |
| 82 entry: | 82 entry: |
| 83 %res = bitcast <4 x i32> %arg to <16 x i8> | 83 %res = bitcast <4 x i32> %arg to <16 x i8> |
| 84 ret <16 x i8> %res | 84 ret <16 x i8> %res |
| 85 | 85 |
| 86 ; CHECK-LABEL: test_bitcast_v4i32_to_v16i8 | 86 ; CHECK-LABEL: test_bitcast_v4i32_to_v16i8 |
| 87 ; CHECK-NEXT: ret | 87 ; CHECK-NEXT: ret |
| 88 } | 88 } |
| 89 | 89 |
| 90 define <8 x i16> @test_bitcast_v4i32_to_v8i16(<4 x i32> %arg) { | 90 define internal <8 x i16> @test_bitcast_v4i32_to_v8i16(<4 x i32> %arg) { |
| 91 entry: | 91 entry: |
| 92 %res = bitcast <4 x i32> %arg to <8 x i16> | 92 %res = bitcast <4 x i32> %arg to <8 x i16> |
| 93 ret <8 x i16> %res | 93 ret <8 x i16> %res |
| 94 | 94 |
| 95 ; CHECK-LABEL: test_bitcast_v4i32_to_v8i16 | 95 ; CHECK-LABEL: test_bitcast_v4i32_to_v8i16 |
| 96 ; CHECK-NEXT: ret | 96 ; CHECK-NEXT: ret |
| 97 } | 97 } |
| 98 | 98 |
| 99 define <4 x i32> @test_bitcast_v4i32_to_v4i32(<4 x i32> %arg) { | 99 define internal <4 x i32> @test_bitcast_v4i32_to_v4i32(<4 x i32> %arg) { |
| 100 entry: | 100 entry: |
| 101 %res = bitcast <4 x i32> %arg to <4 x i32> | 101 %res = bitcast <4 x i32> %arg to <4 x i32> |
| 102 ret <4 x i32> %res | 102 ret <4 x i32> %res |
| 103 | 103 |
| 104 ; CHECK-LABEL: test_bitcast_v4i32_to_v4i32 | 104 ; CHECK-LABEL: test_bitcast_v4i32_to_v4i32 |
| 105 ; CHECK-NEXT: ret | 105 ; CHECK-NEXT: ret |
| 106 } | 106 } |
| 107 | 107 |
| 108 define <4 x float> @test_bitcast_v4i32_to_v4f32(<4 x i32> %arg) { | 108 define internal <4 x float> @test_bitcast_v4i32_to_v4f32(<4 x i32> %arg) { |
| 109 entry: | 109 entry: |
| 110 %res = bitcast <4 x i32> %arg to <4 x float> | 110 %res = bitcast <4 x i32> %arg to <4 x float> |
| 111 ret <4 x float> %res | 111 ret <4 x float> %res |
| 112 | 112 |
| 113 ; CHECK-LABEL: test_bitcast_v4i32_to_v4f32 | 113 ; CHECK-LABEL: test_bitcast_v4i32_to_v4f32 |
| 114 ; CHECK-NEXT: ret | 114 ; CHECK-NEXT: ret |
| 115 } | 115 } |
| 116 | 116 |
| 117 define <16 x i8> @test_bitcast_v4f32_to_v16i8(<4 x float> %arg) { | 117 define internal <16 x i8> @test_bitcast_v4f32_to_v16i8(<4 x float> %arg) { |
| 118 entry: | 118 entry: |
| 119 %res = bitcast <4 x float> %arg to <16 x i8> | 119 %res = bitcast <4 x float> %arg to <16 x i8> |
| 120 ret <16 x i8> %res | 120 ret <16 x i8> %res |
| 121 | 121 |
| 122 ; CHECK-LABEL: test_bitcast_v4f32_to_v16i8 | 122 ; CHECK-LABEL: test_bitcast_v4f32_to_v16i8 |
| 123 ; CHECK-NEXT: ret | 123 ; CHECK-NEXT: ret |
| 124 } | 124 } |
| 125 | 125 |
| 126 define <8 x i16> @test_bitcast_v4f32_to_v8i16(<4 x float> %arg) { | 126 define internal <8 x i16> @test_bitcast_v4f32_to_v8i16(<4 x float> %arg) { |
| 127 entry: | 127 entry: |
| 128 %res = bitcast <4 x float> %arg to <8 x i16> | 128 %res = bitcast <4 x float> %arg to <8 x i16> |
| 129 ret <8 x i16> %res | 129 ret <8 x i16> %res |
| 130 | 130 |
| 131 ; CHECK-LABEL: test_bitcast_v4f32_to_v8i16 | 131 ; CHECK-LABEL: test_bitcast_v4f32_to_v8i16 |
| 132 ; CHECK-NEXT: ret | 132 ; CHECK-NEXT: ret |
| 133 } | 133 } |
| 134 | 134 |
| 135 define <4 x i32> @test_bitcast_v4f32_to_v4i32(<4 x float> %arg) { | 135 define internal <4 x i32> @test_bitcast_v4f32_to_v4i32(<4 x float> %arg) { |
| 136 entry: | 136 entry: |
| 137 %res = bitcast <4 x float> %arg to <4 x i32> | 137 %res = bitcast <4 x float> %arg to <4 x i32> |
| 138 ret <4 x i32> %res | 138 ret <4 x i32> %res |
| 139 | 139 |
| 140 ; CHECK-LABEL: test_bitcast_v4f32_to_v4i32 | 140 ; CHECK-LABEL: test_bitcast_v4f32_to_v4i32 |
| 141 ; CHECK-NEXT: ret | 141 ; CHECK-NEXT: ret |
| 142 } | 142 } |
| 143 | 143 |
| 144 define <4 x float> @test_bitcast_v4f32_to_v4f32(<4 x float> %arg) { | 144 define internal <4 x float> @test_bitcast_v4f32_to_v4f32(<4 x float> %arg) { |
| 145 entry: | 145 entry: |
| 146 %res = bitcast <4 x float> %arg to <4 x float> | 146 %res = bitcast <4 x float> %arg to <4 x float> |
| 147 ret <4 x float> %res | 147 ret <4 x float> %res |
| 148 | 148 |
| 149 ; CHECK-LABEL: test_bitcast_v4f32_to_v4f32 | 149 ; CHECK-LABEL: test_bitcast_v4f32_to_v4f32 |
| 150 ; CHECK-NEXT: ret | 150 ; CHECK-NEXT: ret |
| 151 } | 151 } |
| 152 | 152 |
| 153 define i8 @test_bitcast_v8i1_to_i8(<8 x i1> %arg) { | 153 define internal i8 @test_bitcast_v8i1_to_i8(<8 x i1> %arg) { |
| 154 entry: | 154 entry: |
| 155 %res = bitcast <8 x i1> %arg to i8 | 155 %res = bitcast <8 x i1> %arg to i8 |
| 156 ret i8 %res | 156 ret i8 %res |
| 157 | 157 |
| 158 ; CHECK-LABEL: test_bitcast_v8i1_to_i8 | 158 ; CHECK-LABEL: test_bitcast_v8i1_to_i8 |
| 159 ; CHECK: call {{.*}} R_{{.*}} __Sz_bitcast_8xi1_i8 | 159 ; CHECK: call {{.*}} R_{{.*}} __Sz_bitcast_8xi1_i8 |
| 160 | 160 |
| 161 ; OPTM1-LABEL: test_bitcast_v8i1_to_i8 | 161 ; OPTM1-LABEL: test_bitcast_v8i1_to_i8 |
| 162 ; OPMT1: call -4 | 162 ; OPMT1: call -4 |
| 163 } | 163 } |
| 164 | 164 |
| 165 define i16 @test_bitcast_v16i1_to_i16(<16 x i1> %arg) { | 165 define internal i16 @test_bitcast_v16i1_to_i16(<16 x i1> %arg) { |
| 166 entry: | 166 entry: |
| 167 %res = bitcast <16 x i1> %arg to i16 | 167 %res = bitcast <16 x i1> %arg to i16 |
| 168 ret i16 %res | 168 ret i16 %res |
| 169 | 169 |
| 170 ; CHECK-LABEL: test_bitcast_v16i1_to_i16 | 170 ; CHECK-LABEL: test_bitcast_v16i1_to_i16 |
| 171 ; CHECK: call {{.*}} R_{{.*}} __Sz_bitcast_16xi1_i16 | 171 ; CHECK: call {{.*}} R_{{.*}} __Sz_bitcast_16xi1_i16 |
| 172 | 172 |
| 173 ; OPTM1-LABEL: test_bitcast_v16i1_to_i16 | 173 ; OPTM1-LABEL: test_bitcast_v16i1_to_i16 |
| 174 ; OPMT1: call -4 | 174 ; OPMT1: call -4 |
| 175 } | 175 } |
| 176 | 176 |
| 177 define <8 x i1> @test_bitcast_i8_to_v8i1(i32 %arg) { | 177 define internal <8 x i1> @test_bitcast_i8_to_v8i1(i32 %arg) { |
| 178 entry: | 178 entry: |
| 179 %arg.trunc = trunc i32 %arg to i8 | 179 %arg.trunc = trunc i32 %arg to i8 |
| 180 %res = bitcast i8 %arg.trunc to <8 x i1> | 180 %res = bitcast i8 %arg.trunc to <8 x i1> |
| 181 ret <8 x i1> %res | 181 ret <8 x i1> %res |
| 182 | 182 |
| 183 ; CHECK-LABEL: test_bitcast_i8_to_v8i1 | 183 ; CHECK-LABEL: test_bitcast_i8_to_v8i1 |
| 184 ; CHECK: call {{.*}} R_{{.*}} __Sz_bitcast_i8_8xi1 | 184 ; CHECK: call {{.*}} R_{{.*}} __Sz_bitcast_i8_8xi1 |
| 185 | 185 |
| 186 ; OPTM1-LABEL: test_bitcast_i8_to_v8i1 | 186 ; OPTM1-LABEL: test_bitcast_i8_to_v8i1 |
| 187 ; OPTM1: call {{.*}} R_{{.*}} __Sz_bitcast_i8_8xi1 | 187 ; OPTM1: call {{.*}} R_{{.*}} __Sz_bitcast_i8_8xi1 |
| 188 } | 188 } |
| 189 | 189 |
| 190 define <16 x i1> @test_bitcast_i16_to_v16i1(i32 %arg) { | 190 define internal <16 x i1> @test_bitcast_i16_to_v16i1(i32 %arg) { |
| 191 entry: | 191 entry: |
| 192 %arg.trunc = trunc i32 %arg to i16 | 192 %arg.trunc = trunc i32 %arg to i16 |
| 193 %res = bitcast i16 %arg.trunc to <16 x i1> | 193 %res = bitcast i16 %arg.trunc to <16 x i1> |
| 194 ret <16 x i1> %res | 194 ret <16 x i1> %res |
| 195 | 195 |
| 196 ; CHECK-LABEL: test_bitcast_i16_to_v16i1 | 196 ; CHECK-LABEL: test_bitcast_i16_to_v16i1 |
| 197 ; CHECK: call {{.*}} R_{{.*}} __Sz_bitcast_i16_16xi1 | 197 ; CHECK: call {{.*}} R_{{.*}} __Sz_bitcast_i16_16xi1 |
| 198 | 198 |
| 199 ; OPTM1-LABEL: test_bitcast_i16_to_v16i1 | 199 ; OPTM1-LABEL: test_bitcast_i16_to_v16i1 |
| 200 ; OPTM1: call {{.*}} R_{{.*}} __Sz_bitcast_i16_16xi1 | 200 ; OPTM1: call {{.*}} R_{{.*}} __Sz_bitcast_i16_16xi1 |
| 201 } | 201 } |
| OLD | NEW |