OLD | NEW |
(Empty) | |
| 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 |
| 3 ; follow a usual pattern). |
| 4 |
| 5 ; RUN: %p2i -i %s --args -O2 -mattr=sse4.1 --verbose none \ |
| 6 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ |
| 7 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s |
| 8 ; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s |
| 9 ; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s |
| 10 |
| 11 define <8 x i16> @test_mul_v8i16(<8 x i16> %arg0, <8 x i16> %arg1) { |
| 12 entry: |
| 13 %res = mul <8 x i16> %arg0, %arg1 |
| 14 ret <8 x i16> %res |
| 15 ; CHECK-LABEL: test_mul_v8i16 |
| 16 ; CHECK: 66 0f d5 c1 pmullw xmm0, xmm1 |
| 17 } |
| 18 |
| 19 ; Test register and address mode encoding. |
| 20 define <8 x i16> @test_mul_v8i16_more_regs(<8 x i1> %cond, <8 x i16> %arg0, <8 x
i16> %arg1, <8 x i16> %arg2, <8 x i16> %arg3, <8 x i16> %arg4, <8 x i16> %arg5,
<8 x i16> %arg6, <8 x i16> %arg7, <8 x i16> %arg8) { |
| 21 entry: |
| 22 %res1 = mul <8 x i16> %arg0, %arg1 |
| 23 %res2 = mul <8 x i16> %arg0, %arg2 |
| 24 %res3 = mul <8 x i16> %arg0, %arg3 |
| 25 %res4 = mul <8 x i16> %arg0, %arg4 |
| 26 %res5 = mul <8 x i16> %arg0, %arg5 |
| 27 %res6 = mul <8 x i16> %arg0, %arg6 |
| 28 %res7 = mul <8 x i16> %arg0, %arg7 |
| 29 %res8 = mul <8 x i16> %arg0, %arg8 |
| 30 %res_acc1 = select <8 x i1> %cond, <8 x i16> %res1, <8 x i16> %res2 |
| 31 %res_acc2 = select <8 x i1> %cond, <8 x i16> %res3, <8 x i16> %res4 |
| 32 %res_acc3 = select <8 x i1> %cond, <8 x i16> %res5, <8 x i16> %res6 |
| 33 %res_acc4 = select <8 x i1> %cond, <8 x i16> %res7, <8 x i16> %res8 |
| 34 %res_acc1_3 = select <8 x i1> %cond, <8 x i16> %res_acc1, <8 x i16> %res_acc3 |
| 35 %res_acc2_4 = select <8 x i1> %cond, <8 x i16> %res_acc2, <8 x i16> %res_acc4 |
| 36 %res = select <8 x i1> %cond, <8 x i16> %res_acc1_3, <8 x i16> %res_acc2_4 |
| 37 ret <8 x i16> %res |
| 38 ; CHECK-LABEL: test_mul_v8i16_more_regs |
| 39 ; CHECK-DAG: 66 0f d5 c2 pmullw xmm0, xmm2 |
| 40 ; CHECK-DAG: 66 0f d5 c3 pmullw xmm0, xmm3 |
| 41 ; CHECK-DAG: 66 0f d5 c4 pmullw xmm0, xmm4 |
| 42 ; CHECK-DAG: 66 0f d5 c5 pmullw xmm0, xmm5 |
| 43 ; CHECK-DAG: 66 0f d5 c6 pmullw xmm0, xmm6 |
| 44 ; CHECK-DAG: 66 0f d5 c7 pmullw xmm0, xmm7 |
| 45 ; CHECK-DAG: 66 0f d5 44 24 70 pmullw xmm0, xmmword ptr [esp + 112] |
| 46 ; CHECK-DAG: 66 0f d5 8c 24 80 00 00 00 pmullw xmm1, xmmword ptr [esp + 128] |
| 47 } |
| 48 |
| 49 define <4 x i32> @test_mul_v4i32(<4 x i32> %arg0, <4 x i32> %arg1) { |
| 50 entry: |
| 51 %res = mul <4 x i32> %arg0, %arg1 |
| 52 ret <4 x i32> %res |
| 53 ; CHECK-LABEL: test_mul_v4i32 |
| 54 ; CHECK: 66 0f 38 40 c1 pmulld xmm0, xmm1 |
| 55 } |
| 56 |
| 57 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) { |
| 58 entry: |
| 59 %res1 = mul <4 x i32> %arg0, %arg1 |
| 60 %res2 = mul <4 x i32> %arg0, %arg2 |
| 61 %res3 = mul <4 x i32> %arg0, %arg3 |
| 62 %res4 = mul <4 x i32> %arg0, %arg4 |
| 63 %res5 = mul <4 x i32> %arg0, %arg5 |
| 64 %res6 = mul <4 x i32> %arg0, %arg6 |
| 65 %res7 = mul <4 x i32> %arg0, %arg7 |
| 66 %res8 = mul <4 x i32> %arg0, %arg8 |
| 67 %res_acc1 = select <4 x i1> %cond, <4 x i32> %res1, <4 x i32> %res2 |
| 68 %res_acc2 = select <4 x i1> %cond, <4 x i32> %res3, <4 x i32> %res4 |
| 69 %res_acc3 = select <4 x i1> %cond, <4 x i32> %res5, <4 x i32> %res6 |
| 70 %res_acc4 = select <4 x i1> %cond, <4 x i32> %res7, <4 x i32> %res8 |
| 71 %res_acc1_3 = select <4 x i1> %cond, <4 x i32> %res_acc1, <4 x i32> %res_acc3 |
| 72 %res_acc2_4 = select <4 x i1> %cond, <4 x i32> %res_acc2, <4 x i32> %res_acc4 |
| 73 %res = select <4 x i1> %cond, <4 x i32> %res_acc1_3, <4 x i32> %res_acc2_4 |
| 74 ret <4 x i32> %res |
| 75 ; CHECK-LABEL: test_mul_v4i32_more_regs |
| 76 ; CHECK-DAG: 66 0f 38 40 c2 pmulld xmm0, xmm2 |
| 77 ; CHECK-DAG: 66 0f 38 40 c3 pmulld xmm0, xmm3 |
| 78 ; CHECK-DAG: 66 0f 38 40 c4 pmulld xmm0, xmm4 |
| 79 ; CHECK-DAG: 66 0f 38 40 c5 pmulld xmm0, xmm5 |
| 80 ; CHECK-DAG: 66 0f 38 40 c6 pmulld xmm0, xmm6 |
| 81 ; CHECK-DAG: 66 0f 38 40 c7 pmulld xmm0, xmm7 |
| 82 ; CHECK-DAG: 66 0f 38 40 44 24 70 pmulld xmm0, xmmword ptr [esp + 112] |
| 83 ; CHECK-DAG: 66 0f 38 40 8c 24 80 00 00 00 pmulld xmm1, xmmword ptr [esp + 128] |
| 84 } |
| 85 |
| 86 ; ERRORS-NOT: ICE translation error |
| 87 ; DUMP-NOT: SZ |
OLD | NEW |