| OLD | NEW |
| 1 ; This file tests casting / conversion operations that apply to vector types. | 1 ; This file tests casting / conversion operations that apply to vector types. |
| 2 ; bitcast operations are in vector-bitcast.ll. | 2 ; bitcast operations are in vector-bitcast.ll. |
| 3 | 3 |
| 4 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 | FileCheck %s | 4 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 | FileCheck %s |
| 5 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 | FileCheck %s | 5 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 | FileCheck %s |
| 6 | 6 |
| 7 ; sext operations | 7 ; sext operations |
| 8 | 8 |
| 9 define <16 x i8> @test_sext_v16i1_to_v16i8(<16 x i1> %arg) { | 9 define internal <16 x i8> @test_sext_v16i1_to_v16i8(<16 x i1> %arg) { |
| 10 entry: | 10 entry: |
| 11 %res = sext <16 x i1> %arg to <16 x i8> | 11 %res = sext <16 x i1> %arg to <16 x i8> |
| 12 ret <16 x i8> %res | 12 ret <16 x i8> %res |
| 13 | 13 |
| 14 ; CHECK-LABEL: test_sext_v16i1_to_v16i8 | 14 ; CHECK-LABEL: test_sext_v16i1_to_v16i8 |
| 15 ; CHECK: pxor | 15 ; CHECK: pxor |
| 16 ; CHECK: pcmpeqb | 16 ; CHECK: pcmpeqb |
| 17 ; CHECK: psubb | 17 ; CHECK: psubb |
| 18 ; CHECK: pand | 18 ; CHECK: pand |
| 19 ; CHECK: pxor | 19 ; CHECK: pxor |
| 20 ; CHECK: pcmpgtb | 20 ; CHECK: pcmpgtb |
| 21 } | 21 } |
| 22 | 22 |
| 23 define <8 x i16> @test_sext_v8i1_to_v8i16(<8 x i1> %arg) { | 23 define internal <8 x i16> @test_sext_v8i1_to_v8i16(<8 x i1> %arg) { |
| 24 entry: | 24 entry: |
| 25 %res = sext <8 x i1> %arg to <8 x i16> | 25 %res = sext <8 x i1> %arg to <8 x i16> |
| 26 ret <8 x i16> %res | 26 ret <8 x i16> %res |
| 27 | 27 |
| 28 ; CHECK-LABEL: test_sext_v8i1_to_v8i16 | 28 ; CHECK-LABEL: test_sext_v8i1_to_v8i16 |
| 29 ; CHECK: psllw {{.*}},0xf | 29 ; CHECK: psllw {{.*}},0xf |
| 30 ; CHECK: psraw {{.*}},0xf | 30 ; CHECK: psraw {{.*}},0xf |
| 31 } | 31 } |
| 32 | 32 |
| 33 define <4 x i32> @test_sext_v4i1_to_v4i32(<4 x i1> %arg) { | 33 define internal <4 x i32> @test_sext_v4i1_to_v4i32(<4 x i1> %arg) { |
| 34 entry: | 34 entry: |
| 35 %res = sext <4 x i1> %arg to <4 x i32> | 35 %res = sext <4 x i1> %arg to <4 x i32> |
| 36 ret <4 x i32> %res | 36 ret <4 x i32> %res |
| 37 | 37 |
| 38 ; CHECK-LABEL: test_sext_v4i1_to_v4i32 | 38 ; CHECK-LABEL: test_sext_v4i1_to_v4i32 |
| 39 ; CHECK: pslld {{.*}},0x1f | 39 ; CHECK: pslld {{.*}},0x1f |
| 40 ; CHECK: psrad {{.*}},0x1f | 40 ; CHECK: psrad {{.*}},0x1f |
| 41 } | 41 } |
| 42 | 42 |
| 43 ; zext operations | 43 ; zext operations |
| 44 | 44 |
| 45 define <16 x i8> @test_zext_v16i1_to_v16i8(<16 x i1> %arg) { | 45 define internal <16 x i8> @test_zext_v16i1_to_v16i8(<16 x i1> %arg) { |
| 46 entry: | 46 entry: |
| 47 %res = zext <16 x i1> %arg to <16 x i8> | 47 %res = zext <16 x i1> %arg to <16 x i8> |
| 48 ret <16 x i8> %res | 48 ret <16 x i8> %res |
| 49 | 49 |
| 50 ; CHECK-LABEL: test_zext_v16i1_to_v16i8 | 50 ; CHECK-LABEL: test_zext_v16i1_to_v16i8 |
| 51 ; CHECK: pxor | 51 ; CHECK: pxor |
| 52 ; CHECK: pcmpeqb | 52 ; CHECK: pcmpeqb |
| 53 ; CHECK: psubb | 53 ; CHECK: psubb |
| 54 ; CHECK: pand | 54 ; CHECK: pand |
| 55 } | 55 } |
| 56 | 56 |
| 57 define <8 x i16> @test_zext_v8i1_to_v8i16(<8 x i1> %arg) { | 57 define internal <8 x i16> @test_zext_v8i1_to_v8i16(<8 x i1> %arg) { |
| 58 entry: | 58 entry: |
| 59 %res = zext <8 x i1> %arg to <8 x i16> | 59 %res = zext <8 x i1> %arg to <8 x i16> |
| 60 ret <8 x i16> %res | 60 ret <8 x i16> %res |
| 61 | 61 |
| 62 ; CHECK-LABEL: test_zext_v8i1_to_v8i16 | 62 ; CHECK-LABEL: test_zext_v8i1_to_v8i16 |
| 63 ; CHECK: pxor | 63 ; CHECK: pxor |
| 64 ; CHECK: pcmpeqw | 64 ; CHECK: pcmpeqw |
| 65 ; CHECK: psubw | 65 ; CHECK: psubw |
| 66 ; CHECK: pand | 66 ; CHECK: pand |
| 67 } | 67 } |
| 68 | 68 |
| 69 define <4 x i32> @test_zext_v4i1_to_v4i32(<4 x i1> %arg) { | 69 define internal <4 x i32> @test_zext_v4i1_to_v4i32(<4 x i1> %arg) { |
| 70 entry: | 70 entry: |
| 71 %res = zext <4 x i1> %arg to <4 x i32> | 71 %res = zext <4 x i1> %arg to <4 x i32> |
| 72 ret <4 x i32> %res | 72 ret <4 x i32> %res |
| 73 | 73 |
| 74 ; CHECK-LABEL: test_zext_v4i1_to_v4i32 | 74 ; CHECK-LABEL: test_zext_v4i1_to_v4i32 |
| 75 ; CHECK: pxor | 75 ; CHECK: pxor |
| 76 ; CHECK: pcmpeqd | 76 ; CHECK: pcmpeqd |
| 77 ; CHECK: psubd | 77 ; CHECK: psubd |
| 78 ; CHECK: pand | 78 ; CHECK: pand |
| 79 } | 79 } |
| 80 | 80 |
| 81 ; trunc operations | 81 ; trunc operations |
| 82 | 82 |
| 83 define <16 x i1> @test_trunc_v16i8_to_v16i1(<16 x i8> %arg) { | 83 define internal <16 x i1> @test_trunc_v16i8_to_v16i1(<16 x i8> %arg) { |
| 84 entry: | 84 entry: |
| 85 %res = trunc <16 x i8> %arg to <16 x i1> | 85 %res = trunc <16 x i8> %arg to <16 x i1> |
| 86 ret <16 x i1> %res | 86 ret <16 x i1> %res |
| 87 | 87 |
| 88 ; CHECK-LABEL: test_trunc_v16i8_to_v16i1 | 88 ; CHECK-LABEL: test_trunc_v16i8_to_v16i1 |
| 89 ; CHECK: pxor | 89 ; CHECK: pxor |
| 90 ; CHECK: pcmpeqb | 90 ; CHECK: pcmpeqb |
| 91 ; CHECK: psubb | 91 ; CHECK: psubb |
| 92 ; CHECK: pand | 92 ; CHECK: pand |
| 93 } | 93 } |
| 94 | 94 |
| 95 define <8 x i1> @test_trunc_v8i16_to_v8i1(<8 x i16> %arg) { | 95 define internal <8 x i1> @test_trunc_v8i16_to_v8i1(<8 x i16> %arg) { |
| 96 entry: | 96 entry: |
| 97 %res = trunc <8 x i16> %arg to <8 x i1> | 97 %res = trunc <8 x i16> %arg to <8 x i1> |
| 98 ret <8 x i1> %res | 98 ret <8 x i1> %res |
| 99 | 99 |
| 100 ; CHECK-LABEL: test_trunc_v8i16_to_v8i1 | 100 ; CHECK-LABEL: test_trunc_v8i16_to_v8i1 |
| 101 ; CHECK: pxor | 101 ; CHECK: pxor |
| 102 ; CHECK: pcmpeqw | 102 ; CHECK: pcmpeqw |
| 103 ; CHECK: psubw | 103 ; CHECK: psubw |
| 104 ; CHECK: pand | 104 ; CHECK: pand |
| 105 } | 105 } |
| 106 | 106 |
| 107 define <4 x i1> @test_trunc_v4i32_to_v4i1(<4 x i32> %arg) { | 107 define internal <4 x i1> @test_trunc_v4i32_to_v4i1(<4 x i32> %arg) { |
| 108 entry: | 108 entry: |
| 109 %res = trunc <4 x i32> %arg to <4 x i1> | 109 %res = trunc <4 x i32> %arg to <4 x i1> |
| 110 ret <4 x i1> %res | 110 ret <4 x i1> %res |
| 111 | 111 |
| 112 ; CHECK-LABEL: test_trunc_v4i32_to_v4i1 | 112 ; CHECK-LABEL: test_trunc_v4i32_to_v4i1 |
| 113 ; CHECK: pxor | 113 ; CHECK: pxor |
| 114 ; CHECK: pcmpeqd | 114 ; CHECK: pcmpeqd |
| 115 ; CHECK: psubd | 115 ; CHECK: psubd |
| 116 ; CHECK: pand | 116 ; CHECK: pand |
| 117 } | 117 } |
| 118 | 118 |
| 119 ; fpto[us]i operations | 119 ; fpto[us]i operations |
| 120 | 120 |
| 121 define <4 x i32> @test_fptosi_v4f32_to_v4i32(<4 x float> %arg) { | 121 define internal <4 x i32> @test_fptosi_v4f32_to_v4i32(<4 x float> %arg) { |
| 122 entry: | 122 entry: |
| 123 %res = fptosi <4 x float> %arg to <4 x i32> | 123 %res = fptosi <4 x float> %arg to <4 x i32> |
| 124 ret <4 x i32> %res | 124 ret <4 x i32> %res |
| 125 | 125 |
| 126 ; CHECK-LABEL: test_fptosi_v4f32_to_v4i32 | 126 ; CHECK-LABEL: test_fptosi_v4f32_to_v4i32 |
| 127 ; CHECK: cvttps2dq | 127 ; CHECK: cvttps2dq |
| 128 } | 128 } |
| 129 | 129 |
| 130 define <4 x i32> @test_fptoui_v4f32_to_v4i32(<4 x float> %arg) { | 130 define internal <4 x i32> @test_fptoui_v4f32_to_v4i32(<4 x float> %arg) { |
| 131 entry: | 131 entry: |
| 132 %res = fptoui <4 x float> %arg to <4 x i32> | 132 %res = fptoui <4 x float> %arg to <4 x i32> |
| 133 ret <4 x i32> %res | 133 ret <4 x i32> %res |
| 134 | 134 |
| 135 ; CHECK-LABEL: test_fptoui_v4f32_to_v4i32 | 135 ; CHECK-LABEL: test_fptoui_v4f32_to_v4i32 |
| 136 ; CHECK: call {{.*}} R_{{.*}} __Sz_fptoui_4xi32_f32 | 136 ; CHECK: call {{.*}} R_{{.*}} __Sz_fptoui_4xi32_f32 |
| 137 } | 137 } |
| 138 | 138 |
| 139 ; [su]itofp operations | 139 ; [su]itofp operations |
| 140 | 140 |
| 141 define <4 x float> @test_sitofp_v4i32_to_v4f32(<4 x i32> %arg) { | 141 define internal <4 x float> @test_sitofp_v4i32_to_v4f32(<4 x i32> %arg) { |
| 142 entry: | 142 entry: |
| 143 %res = sitofp <4 x i32> %arg to <4 x float> | 143 %res = sitofp <4 x i32> %arg to <4 x float> |
| 144 ret <4 x float> %res | 144 ret <4 x float> %res |
| 145 | 145 |
| 146 ; CHECK-LABEL: test_sitofp_v4i32_to_v4f32 | 146 ; CHECK-LABEL: test_sitofp_v4i32_to_v4f32 |
| 147 ; CHECK: cvtdq2ps | 147 ; CHECK: cvtdq2ps |
| 148 } | 148 } |
| 149 | 149 |
| 150 define <4 x float> @test_uitofp_v4i32_to_v4f32(<4 x i32> %arg) { | 150 define internal <4 x float> @test_uitofp_v4i32_to_v4f32(<4 x i32> %arg) { |
| 151 entry: | 151 entry: |
| 152 %res = uitofp <4 x i32> %arg to <4 x float> | 152 %res = uitofp <4 x i32> %arg to <4 x float> |
| 153 ret <4 x float> %res | 153 ret <4 x float> %res |
| 154 | 154 |
| 155 ; CHECK-LABEL: test_uitofp_v4i32_to_v4f32 | 155 ; CHECK-LABEL: test_uitofp_v4i32_to_v4f32 |
| 156 ; CHECK: call {{.*}} R_{{.*}} __Sz_uitofp_4xi32_4xf32 | 156 ; CHECK: call {{.*}} R_{{.*}} __Sz_uitofp_4xi32_4xf32 |
| 157 } | 157 } |
| OLD | NEW |