| OLD | NEW |
| 1 ; Tests various aspects of x86 opcode encodings. E.g., some opcodes like | 1 ; Tests various aspects of x86 opcode encodings. E.g., some opcodes like |
| 2 ; those for pmull vary more wildly depending on operand size (rather than | 2 ; those for pmull vary more wildly depending on operand size (rather than |
| 3 ; follow a usual pattern). | 3 ; follow a usual pattern). |
| 4 | 4 |
| 5 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 -mattr=sse4.1 \ | 5 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 -mattr=sse4.1 \ |
| 6 ; RUN: -sandbox | FileCheck %s | 6 ; RUN: -sandbox | FileCheck %s |
| 7 | 7 |
| 8 define <8 x i16> @test_mul_v8i16(<8 x i16> %arg0, <8 x i16> %arg1) { | 8 define <8 x i16> @test_mul_v8i16(<8 x i16> %arg0, <8 x i16> %arg1) { |
| 9 entry: | 9 entry: |
| 10 %res = mul <8 x i16> %arg0, %arg1 | 10 %res = mul <8 x i16> %arg0, %arg1 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 %res8 = mul <8 x i16> %arg0, %arg8 | 26 %res8 = mul <8 x i16> %arg0, %arg8 |
| 27 %res_acc1 = select <8 x i1> %cond, <8 x i16> %res1, <8 x i16> %res2 | 27 %res_acc1 = select <8 x i1> %cond, <8 x i16> %res1, <8 x i16> %res2 |
| 28 %res_acc2 = select <8 x i1> %cond, <8 x i16> %res3, <8 x i16> %res4 | 28 %res_acc2 = select <8 x i1> %cond, <8 x i16> %res3, <8 x i16> %res4 |
| 29 %res_acc3 = select <8 x i1> %cond, <8 x i16> %res5, <8 x i16> %res6 | 29 %res_acc3 = select <8 x i1> %cond, <8 x i16> %res5, <8 x i16> %res6 |
| 30 %res_acc4 = select <8 x i1> %cond, <8 x i16> %res7, <8 x i16> %res8 | 30 %res_acc4 = select <8 x i1> %cond, <8 x i16> %res7, <8 x i16> %res8 |
| 31 %res_acc1_3 = select <8 x i1> %cond, <8 x i16> %res_acc1, <8 x i16> %res_acc3 | 31 %res_acc1_3 = select <8 x i1> %cond, <8 x i16> %res_acc1, <8 x i16> %res_acc3 |
| 32 %res_acc2_4 = select <8 x i1> %cond, <8 x i16> %res_acc2, <8 x i16> %res_acc4 | 32 %res_acc2_4 = select <8 x i1> %cond, <8 x i16> %res_acc2, <8 x i16> %res_acc4 |
| 33 %res = select <8 x i1> %cond, <8 x i16> %res_acc1_3, <8 x i16> %res_acc2_4 | 33 %res = select <8 x i1> %cond, <8 x i16> %res_acc1_3, <8 x i16> %res_acc2_4 |
| 34 ret <8 x i16> %res | 34 ret <8 x i16> %res |
| 35 ; CHECK-LABEL: test_mul_v8i16_more_regs | 35 ; CHECK-LABEL: test_mul_v8i16_more_regs |
| 36 ; CHECK-DAG: 66 0f d5 c2 pmullw xmm0,xmm2 | 36 ; CHECK-DAG: pmullw xmm0,{{xmm[0-7]|xmmword ptr\[esp}} |
| 37 ; CHECK-DAG: 66 0f d5 c3 pmullw xmm0,xmm3 | 37 ; CHECK-DAG: pmullw xmm0,{{xmm[0-7]|xmmword ptr\[esp}} |
| 38 ; CHECK-DAG: 66 0f d5 c4 pmullw xmm0,xmm4 | 38 ; CHECK-DAG: pmullw xmm0,{{xmm[0-7]|xmmword ptr\[esp}} |
| 39 ; CHECK-DAG: 66 0f d5 c5 pmullw xmm0,xmm5 | 39 ; CHECK-DAG: pmullw xmm0,{{xmm[0-7]|xmmword ptr\[esp}} |
| 40 ; CHECK-DAG: 66 0f d5 c6 pmullw xmm0,xmm6 | 40 ; CHECK-DAG: pmullw xmm0,{{xmm[0-7]|xmmword ptr\[esp}} |
| 41 ; CHECK-DAG: 66 0f d5 c7 pmullw xmm0,xmm7 | 41 ; CHECK-DAG: pmullw xmm0,{{xmm[0-7]|xmmword ptr\[esp}} |
| 42 ; CHECK-DAG: 66 0f d5 44 24 70 pmullw xmm0,XMMWORD PTR [esp | 42 ; CHECK-DAG: pmullw xmm0,XMMWORD PTR [esp |
| 43 ; CHECK-DAG: 66 0f d5 8c 24 80 00 00 00 pmullw xmm1,XMMWORD PTR [esp | 43 ; CHECK-DAG: pmullw xmm1,XMMWORD PTR [esp |
| 44 } | 44 } |
| 45 | 45 |
| 46 define <4 x i32> @test_mul_v4i32(<4 x i32> %arg0, <4 x i32> %arg1) { | 46 define <4 x i32> @test_mul_v4i32(<4 x i32> %arg0, <4 x i32> %arg1) { |
| 47 entry: | 47 entry: |
| 48 %res = mul <4 x i32> %arg0, %arg1 | 48 %res = mul <4 x i32> %arg0, %arg1 |
| 49 ret <4 x i32> %res | 49 ret <4 x i32> %res |
| 50 ; CHECK-LABEL: test_mul_v4i32 | 50 ; CHECK-LABEL: test_mul_v4i32 |
| 51 ; CHECK: 66 0f 38 40 c1 pmulld xmm0,xmm1 | 51 ; CHECK: 66 0f 38 40 c1 pmulld xmm0,xmm1 |
| 52 } | 52 } |
| 53 | 53 |
| 54 define <4 x i32> @test_mul_v4i32_more_regs(<4 x i1> %cond, <4 x i32> %arg0, <4 x
i32> %arg1, <4 x i32> %arg2, <4 x i32> %arg3, <4 x i32> %arg4, <4 x i32> %arg5,
<4 x i32> %arg6, <4 x i32> %arg7, <4 x i32> %arg8) { | 54 define <4 x i32> @test_mul_v4i32_more_regs(<4 x i1> %cond, <4 x i32> %arg0, <4 x
i32> %arg1, <4 x i32> %arg2, <4 x i32> %arg3, <4 x i32> %arg4, <4 x i32> %arg5,
<4 x i32> %arg6, <4 x i32> %arg7, <4 x i32> %arg8) { |
| 55 entry: | 55 entry: |
| 56 %res1 = mul <4 x i32> %arg0, %arg1 | 56 %res1 = mul <4 x i32> %arg0, %arg1 |
| 57 %res2 = mul <4 x i32> %arg0, %arg2 | 57 %res2 = mul <4 x i32> %arg0, %arg2 |
| 58 %res3 = mul <4 x i32> %arg0, %arg3 | 58 %res3 = mul <4 x i32> %arg0, %arg3 |
| 59 %res4 = mul <4 x i32> %arg0, %arg4 | 59 %res4 = mul <4 x i32> %arg0, %arg4 |
| 60 %res5 = mul <4 x i32> %arg0, %arg5 | 60 %res5 = mul <4 x i32> %arg0, %arg5 |
| 61 %res6 = mul <4 x i32> %arg0, %arg6 | 61 %res6 = mul <4 x i32> %arg0, %arg6 |
| 62 %res7 = mul <4 x i32> %arg0, %arg7 | 62 %res7 = mul <4 x i32> %arg0, %arg7 |
| 63 %res8 = mul <4 x i32> %arg0, %arg8 | 63 %res8 = mul <4 x i32> %arg0, %arg8 |
| 64 %res_acc1 = select <4 x i1> %cond, <4 x i32> %res1, <4 x i32> %res2 | 64 %res_acc1 = select <4 x i1> %cond, <4 x i32> %res1, <4 x i32> %res2 |
| 65 %res_acc2 = select <4 x i1> %cond, <4 x i32> %res3, <4 x i32> %res4 | 65 %res_acc2 = select <4 x i1> %cond, <4 x i32> %res3, <4 x i32> %res4 |
| 66 %res_acc3 = select <4 x i1> %cond, <4 x i32> %res5, <4 x i32> %res6 | 66 %res_acc3 = select <4 x i1> %cond, <4 x i32> %res5, <4 x i32> %res6 |
| 67 %res_acc4 = select <4 x i1> %cond, <4 x i32> %res7, <4 x i32> %res8 | 67 %res_acc4 = select <4 x i1> %cond, <4 x i32> %res7, <4 x i32> %res8 |
| 68 %res_acc1_3 = select <4 x i1> %cond, <4 x i32> %res_acc1, <4 x i32> %res_acc3 | 68 %res_acc1_3 = select <4 x i1> %cond, <4 x i32> %res_acc1, <4 x i32> %res_acc3 |
| 69 %res_acc2_4 = select <4 x i1> %cond, <4 x i32> %res_acc2, <4 x i32> %res_acc4 | 69 %res_acc2_4 = select <4 x i1> %cond, <4 x i32> %res_acc2, <4 x i32> %res_acc4 |
| 70 %res = select <4 x i1> %cond, <4 x i32> %res_acc1_3, <4 x i32> %res_acc2_4 | 70 %res = select <4 x i1> %cond, <4 x i32> %res_acc1_3, <4 x i32> %res_acc2_4 |
| 71 ret <4 x i32> %res | 71 ret <4 x i32> %res |
| 72 ; CHECK-LABEL: test_mul_v4i32_more_regs | 72 ; CHECK-LABEL: test_mul_v4i32_more_regs |
| 73 ; CHECK-DAG: 66 0f 38 40 c2 pmulld xmm0,xmm2 | 73 ; CHECK-DAG: pmulld xmm0,{{xmm[0-7]|xmmword ptr\[esp}} |
| 74 ; CHECK-DAG: 66 0f 38 40 c3 pmulld xmm0,xmm3 | 74 ; CHECK-DAG: pmulld xmm0,{{xmm[0-7]|xmmword ptr\[esp}} |
| 75 ; CHECK-DAG: 66 0f 38 40 c4 pmulld xmm0,xmm4 | 75 ; CHECK-DAG: pmulld xmm0,{{xmm[0-7]|xmmword ptr\[esp}} |
| 76 ; CHECK-DAG: 66 0f 38 40 c5 pmulld xmm0,xmm5 | 76 ; CHECK-DAG: pmulld xmm0,{{xmm[0-7]|xmmword ptr\[esp}} |
| 77 ; CHECK-DAG: 66 0f 38 40 c6 pmulld xmm0,xmm6 | 77 ; CHECK-DAG: pmulld xmm0,{{xmm[0-7]|xmmword ptr\[esp}} |
| 78 ; CHECK-DAG: 66 0f 38 40 c7 pmulld xmm0,xmm7 | 78 ; CHECK-DAG: pmulld xmm0,{{xmm[0-7]|xmmword ptr\[esp}} |
| 79 ; CHECK-DAG: 66 0f 38 40 44 24 70 pmulld xmm0,XMMWORD PTR [esp | 79 ; CHECK-DAG: pmulld xmm0,XMMWORD PTR [esp |
| 80 ; CHECK-DAG: 66 0f 38 40 8c 24 80 00 00 00 pmulld xmm1,XMMWORD PTR [esp | 80 ; CHECK-DAG: pmulld xmm1,XMMWORD PTR [esp |
| 81 } | 81 } |
| 82 | 82 |
| 83 ; Test movq, which is used by atomic stores. | 83 ; Test movq, which is used by atomic stores. |
| 84 declare void @llvm.nacl.atomic.store.i64(i64, i64*, i32) | 84 declare void @llvm.nacl.atomic.store.i64(i64, i64*, i32) |
| 85 | 85 |
| 86 define void @test_atomic_store_64(i32 %iptr, i32 %iptr2, i32 %iptr3, i64 %v) { | 86 define void @test_atomic_store_64(i32 %iptr, i32 %iptr2, i32 %iptr3, i64 %v) { |
| 87 entry: | 87 entry: |
| 88 %ptr = inttoptr i32 %iptr to i64* | 88 %ptr = inttoptr i32 %iptr to i64* |
| 89 %ptr2 = inttoptr i32 %iptr2 to i64* | 89 %ptr2 = inttoptr i32 %iptr2 to i64* |
| 90 %ptr3 = inttoptr i32 %iptr3 to i64* | 90 %ptr3 = inttoptr i32 %iptr3 to i64* |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 %elt12 = add i8 %elt1, %elt2 | 185 %elt12 = add i8 %elt1, %elt2 |
| 186 %elt34 = add i8 %elt3, %elt4 | 186 %elt34 = add i8 %elt3, %elt4 |
| 187 %res1 = insertelement <16 x i8> %vec, i8 %elt12, i32 1 | 187 %res1 = insertelement <16 x i8> %vec, i8 %elt12, i32 1 |
| 188 %res2 = insertelement <16 x i8> %res1, i8 %elt34, i32 7 | 188 %res2 = insertelement <16 x i8> %res1, i8 %elt34, i32 7 |
| 189 %res3 = insertelement <16 x i8> %res2, i8 %elt1, i32 15 | 189 %res3 = insertelement <16 x i8> %res2, i8 %elt1, i32 15 |
| 190 ret <16 x i8> %res3 | 190 ret <16 x i8> %res3 |
| 191 } | 191 } |
| 192 ; CHECK-LABEL: test_pinsrb | 192 ; CHECK-LABEL: test_pinsrb |
| 193 ; CHECK-DAG: 66 0f 3a 20 c{{.*}} 01 pinsrb xmm0,e{{.*}} | 193 ; CHECK-DAG: 66 0f 3a 20 c{{.*}} 01 pinsrb xmm0,e{{.*}} |
| 194 ; CHECK-DAG: 66 0f 3a 20 c{{.*}} 07 pinsrb xmm0,e{{.*}} | 194 ; CHECK-DAG: 66 0f 3a 20 c{{.*}} 07 pinsrb xmm0,e{{.*}} |
| 195 ; CHECK-DAG: 66 0f 3a 20 {{.*}} 0f pinsrb xmm0,BYTE PTR {{.*}} | 195 ; CHECK-DAG: 66 0f 3a 20 c{{.*}} 0f pinsrb xmm0,e{{.*}} |
| 196 | 196 |
| 197 define <8 x i16> @test_pinsrw(<8 x i16> %vec, i32 %elt1_w, i32 %elt2_w, i32 %elt
3_w, i32 %elt4_w) { | 197 define <8 x i16> @test_pinsrw(<8 x i16> %vec, i32 %elt1_w, i32 %elt2_w, i32 %elt
3_w, i32 %elt4_w) { |
| 198 entry: | 198 entry: |
| 199 %elt1 = trunc i32 %elt1_w to i16 | 199 %elt1 = trunc i32 %elt1_w to i16 |
| 200 %elt2 = trunc i32 %elt2_w to i16 | 200 %elt2 = trunc i32 %elt2_w to i16 |
| 201 %elt3 = trunc i32 %elt3_w to i16 | 201 %elt3 = trunc i32 %elt3_w to i16 |
| 202 %elt4 = trunc i32 %elt4_w to i16 | 202 %elt4 = trunc i32 %elt4_w to i16 |
| 203 %elt12 = add i16 %elt1, %elt2 | 203 %elt12 = add i16 %elt1, %elt2 |
| 204 %elt34 = add i16 %elt3, %elt4 | 204 %elt34 = add i16 %elt3, %elt4 |
| 205 %res1 = insertelement <8 x i16> %vec, i16 %elt12, i32 1 | 205 %res1 = insertelement <8 x i16> %vec, i16 %elt12, i32 1 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 three: | 284 three: |
| 285 %res3 = extractelement <8 x i16> %vec4, i32 7 | 285 %res3 = extractelement <8 x i16> %vec4, i32 7 |
| 286 %res3_ext = zext i16 %res3 to i32 | 286 %res3_ext = zext i16 %res3 to i32 |
| 287 ret i32 %res3_ext | 287 ret i32 %res3_ext |
| 288 } | 288 } |
| 289 ; CHECK-LABEL: test_pextrw | 289 ; CHECK-LABEL: test_pextrw |
| 290 ; CHECK-DAG: 66 0f c5 c0 00 pextrw eax,xmm0 | 290 ; CHECK-DAG: 66 0f c5 c0 00 pextrw eax,xmm0 |
| 291 ; CHECK-DAG: 66 0f c5 c1 02 pextrw eax,xmm1 | 291 ; CHECK-DAG: 66 0f c5 c1 02 pextrw eax,xmm1 |
| 292 ; CHECK-DAG: 66 0f c5 c2 05 pextrw eax,xmm2 | 292 ; CHECK-DAG: 66 0f c5 c2 05 pextrw eax,xmm2 |
| 293 ; CHECK-DAG: 66 0f c5 c3 07 pextrw eax,xmm3 | 293 ; CHECK-DAG: 66 0f c5 c3 07 pextrw eax,xmm3 |
| OLD | NEW |