Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: tests_lit/assembler/x86/opcode_register_encodings.ll

Issue 1371703003: Generate better two address code by using commutativity (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Address code review comments in test Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceTargetLoweringX86BaseImpl.h ('k') | tests_lit/llvm2ice_tests/commutativity.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 ret <8 x i16> %res 11 ret <8 x i16> %res
12 ; CHECK-LABEL: test_mul_v8i16 12 ; CHECK-LABEL: test_mul_v8i16
13 ; CHECK: 66 0f d5 c1 pmullw xmm0,xmm1 13 ; CHECK: 66 0f d5 c1 pmullw xmm0,xmm1
14 } 14 }
15 15
16 ; Test register and address mode encoding. 16 ; Test register and address mode encoding.
17 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) { 17 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) {
18 entry: 18 entry:
19 %res1 = mul <8 x i16> %arg0, %arg1 19 %res1 = sub <8 x i16> %arg0, %arg1
20 %res2 = mul <8 x i16> %arg0, %arg2 20 %res2 = sub <8 x i16> %arg0, %arg2
21 %res3 = mul <8 x i16> %arg0, %arg3 21 %res3 = sub <8 x i16> %arg0, %arg3
22 %res4 = mul <8 x i16> %arg0, %arg4 22 %res4 = sub <8 x i16> %arg0, %arg4
23 %res5 = mul <8 x i16> %arg0, %arg5 23 %res5 = sub <8 x i16> %arg0, %arg5
24 %res6 = mul <8 x i16> %arg0, %arg6 24 %res6 = sub <8 x i16> %arg0, %arg6
25 %res7 = mul <8 x i16> %arg0, %arg7 25 %res7 = sub <8 x i16> %arg0, %arg7
26 %res8 = mul <8 x i16> %arg0, %arg8 26 %res8 = sub <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: pmullw xmm0,{{xmm[0-7]|xmmword ptr\[esp}} 36 ; CHECK-DAG: psubw xmm0,{{xmm[0-7]|xmmword ptr\[esp}}
37 ; CHECK-DAG: pmullw xmm0,{{xmm[0-7]|xmmword ptr\[esp}} 37 ; CHECK-DAG: psubw xmm0,{{xmm[0-7]|xmmword ptr\[esp}}
38 ; CHECK-DAG: pmullw xmm0,{{xmm[0-7]|xmmword ptr\[esp}} 38 ; CHECK-DAG: psubw xmm0,{{xmm[0-7]|xmmword ptr\[esp}}
39 ; CHECK-DAG: pmullw xmm0,{{xmm[0-7]|xmmword ptr\[esp}} 39 ; CHECK-DAG: psubw xmm0,{{xmm[0-7]|xmmword ptr\[esp}}
40 ; CHECK-DAG: pmullw xmm0,{{xmm[0-7]|xmmword ptr\[esp}} 40 ; CHECK-DAG: psubw xmm0,{{xmm[0-7]|xmmword ptr\[esp}}
41 ; CHECK-DAG: pmullw xmm0,{{xmm[0-7]|xmmword ptr\[esp}} 41 ; CHECK-DAG: psubw xmm0,{{xmm[0-7]|xmmword ptr\[esp}}
42 ; CHECK-DAG: pmullw xmm0,XMMWORD PTR [esp 42 ; CHECK-DAG: psubw xmm0,XMMWORD PTR [esp
43 ; CHECK-DAG: pmullw xmm1,XMMWORD PTR [esp 43 ; CHECK-DAG: psubw 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 = sub <4 x i32> %arg0, %arg1
57 %res2 = mul <4 x i32> %arg0, %arg2 57 %res2 = sub <4 x i32> %arg0, %arg2
58 %res3 = mul <4 x i32> %arg0, %arg3 58 %res3 = sub <4 x i32> %arg0, %arg3
59 %res4 = mul <4 x i32> %arg0, %arg4 59 %res4 = sub <4 x i32> %arg0, %arg4
60 %res5 = mul <4 x i32> %arg0, %arg5 60 %res5 = sub <4 x i32> %arg0, %arg5
61 %res6 = mul <4 x i32> %arg0, %arg6 61 %res6 = sub <4 x i32> %arg0, %arg6
62 %res7 = mul <4 x i32> %arg0, %arg7 62 %res7 = sub <4 x i32> %arg0, %arg7
63 %res8 = mul <4 x i32> %arg0, %arg8 63 %res8 = sub <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: pmulld xmm0,{{xmm[0-7]|xmmword ptr\[esp}} 73 ; CHECK-DAG: psubd xmm0,{{xmm[0-7]|xmmword ptr\[esp}}
74 ; CHECK-DAG: pmulld xmm0,{{xmm[0-7]|xmmword ptr\[esp}} 74 ; CHECK-DAG: psubd xmm0,{{xmm[0-7]|xmmword ptr\[esp}}
75 ; CHECK-DAG: pmulld xmm0,{{xmm[0-7]|xmmword ptr\[esp}} 75 ; CHECK-DAG: psubd xmm0,{{xmm[0-7]|xmmword ptr\[esp}}
76 ; CHECK-DAG: pmulld xmm0,{{xmm[0-7]|xmmword ptr\[esp}} 76 ; CHECK-DAG: psubd xmm0,{{xmm[0-7]|xmmword ptr\[esp}}
77 ; CHECK-DAG: pmulld xmm0,{{xmm[0-7]|xmmword ptr\[esp}} 77 ; CHECK-DAG: psubd xmm0,{{xmm[0-7]|xmmword ptr\[esp}}
78 ; CHECK-DAG: pmulld xmm0,{{xmm[0-7]|xmmword ptr\[esp}} 78 ; CHECK-DAG: psubd xmm0,{{xmm[0-7]|xmmword ptr\[esp}}
79 ; CHECK-DAG: pmulld xmm0,XMMWORD PTR [esp 79 ; CHECK-DAG: psubd xmm0,XMMWORD PTR [esp
80 ; CHECK-DAG: pmulld xmm1,XMMWORD PTR [esp 80 ; CHECK-DAG: psubd 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX86BaseImpl.h ('k') | tests_lit/llvm2ice_tests/commutativity.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698