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

Side by Side Diff: tests_lit/llvm2ice_tests/vector-ops.ll

Issue 412353005: Use movss to implement insertelement when elements = 4 and index = 0. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 5 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
« src/IceInstX8632.h ('K') | « src/IceTargetLoweringX8632.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ; This checks support for insertelement and extractelement. 1 ; This checks support for insertelement and extractelement.
2 2
3 ; RUN: %llvm2ice --verbose inst %s | FileCheck %s 3 ; RUN: %llvm2ice --verbose inst %s | FileCheck %s
4 ; RUN: %llvm2ice -O2 --verbose none %s \ 4 ; RUN: %llvm2ice -O2 --verbose none %s \
5 ; RUN: | llvm-mc -arch=x86 -x86-asm-syntax=intel -filetype=obj 5 ; RUN: | llvm-mc -arch=x86 -x86-asm-syntax=intel -filetype=obj
6 ; RUN: %llvm2ice -Om1 --verbose none %s \ 6 ; RUN: %llvm2ice -Om1 --verbose none %s \
7 ; RUN: | llvm-mc -arch=x86 -x86-asm-syntax=intel -filetype=obj 7 ; RUN: | llvm-mc -arch=x86 -x86-asm-syntax=intel -filetype=obj
8 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s 8 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s
9 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s 9 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s
10 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ 10 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \
11 ; RUN: | FileCheck --check-prefix=DUMP %s 11 ; RUN: | FileCheck --check-prefix=DUMP %s
12 12
13 ; insertelement operations 13 ; insertelement operations
14 14
15 define <4 x float> @insertelement_v4f32(<4 x float> %vec, float %elt) { 15 define <4 x float> @insertelement_v4f32_0(<4 x float> %vec, float %elt) {
16 entry:
17 %res = insertelement <4 x float> %vec, float %elt, i32 0
18 ret <4 x float> %res
19 ; CHECK-LABEL: insertelement_v4f32_0:
20 ; CHECK: movss
21 }
22
23 define <4 x i32> @insertelement_v4i32_0(<4 x i32> %vec, i32 %elt) {
24 entry:
25 %res = insertelement <4 x i32> %vec, i32 %elt, i32 0
26 ret <4 x i32> %res
27 ; CHECK-LABEL: insertelement_v4i32_0:
28 ; CHECK: movss
29 }
30
31
32 define <4 x float> @insertelement_v4f32_1(<4 x float> %vec, float %elt) {
16 entry: 33 entry:
17 %res = insertelement <4 x float> %vec, float %elt, i32 1 34 %res = insertelement <4 x float> %vec, float %elt, i32 1
18 ret <4 x float> %res 35 ret <4 x float> %res
19 ; CHECK-LABEL: insertelement_v4f32: 36 ; CHECK-LABEL: insertelement_v4f32_1:
20 ; CHECK: shufps 37 ; CHECK: shufps
21 ; CHECK: shufps 38 ; CHECK: shufps
22 } 39 }
23 40
24 define <4 x i32> @insertelement_v4i32(<4 x i32> %vec, i32 %elt) { 41 define <4 x i32> @insertelement_v4i32_1(<4 x i32> %vec, i32 %elt) {
25 entry: 42 entry:
26 %res = insertelement <4 x i32> %vec, i32 %elt, i32 1 43 %res = insertelement <4 x i32> %vec, i32 %elt, i32 1
27 ret <4 x i32> %res 44 ret <4 x i32> %res
28 ; CHECK-LABEL: insertelement_v4i32: 45 ; CHECK-LABEL: insertelement_v4i32_1:
29 ; CHECK: shufps 46 ; CHECK: shufps
30 ; CHECK: shufps 47 ; CHECK: shufps
31 } 48 }
32 49
33 define <8 x i16> @insertelement_v8i16(<8 x i16> %vec, i32 %elt.arg) { 50 define <8 x i16> @insertelement_v8i16(<8 x i16> %vec, i32 %elt.arg) {
34 entry: 51 entry:
35 %elt = trunc i32 %elt.arg to i16 52 %elt = trunc i32 %elt.arg to i16
36 %res = insertelement <8 x i16> %vec, i16 %elt, i32 1 53 %res = insertelement <8 x i16> %vec, i16 %elt, i32 1
37 ret <8 x i16> %res 54 ret <8 x i16> %res
38 ; CHECK-LABEL: insertelement_v8i16 55 ; CHECK-LABEL: insertelement_v8i16
39 ; CHECK: pinsrw 56 ; CHECK: pinsrw
40 } 57 }
41 58
42 define <16 x i8> @insertelement_v16i8(<16 x i8> %vec, i32 %elt.arg) { 59 define <16 x i8> @insertelement_v16i8(<16 x i8> %vec, i32 %elt.arg) {
43 entry: 60 entry:
44 %elt = trunc i32 %elt.arg to i8 61 %elt = trunc i32 %elt.arg to i8
45 %res = insertelement <16 x i8> %vec, i8 %elt, i32 1 62 %res = insertelement <16 x i8> %vec, i8 %elt, i32 1
46 ret <16 x i8> %res 63 ret <16 x i8> %res
47 ; CHECK-LABEL: insertelement_v16i8: 64 ; CHECK-LABEL: insertelement_v16i8:
48 ; CHECK: movups 65 ; CHECK: movups
49 ; CHECK: lea 66 ; CHECK: lea
50 ; CHECK: mov 67 ; CHECK: mov
51 } 68 }
52 69
53 define <4 x i1> @insertelement_v4i1(<4 x i1> %vec, i32 %elt.arg) { 70 define <4 x i1> @insertelement_v4i1_0(<4 x i1> %vec, i32 %elt.arg) {
71 entry:
72 %elt = trunc i32 %elt.arg to i1
73 %res = insertelement <4 x i1> %vec, i1 %elt, i32 0
74 ret <4 x i1> %res
75 ; CHECK-LABEL: insertelement_v4i1_0:
76 ; CHECK: movss
77 }
78
79 define <4 x i1> @insertelement_v4i1_1(<4 x i1> %vec, i32 %elt.arg) {
54 entry: 80 entry:
55 %elt = trunc i32 %elt.arg to i1 81 %elt = trunc i32 %elt.arg to i1
56 %res = insertelement <4 x i1> %vec, i1 %elt, i32 1 82 %res = insertelement <4 x i1> %vec, i1 %elt, i32 1
57 ret <4 x i1> %res 83 ret <4 x i1> %res
58 ; CHECK-LABEL: insertelement_v4i1: 84 ; CHECK-LABEL: insertelement_v4i1_1:
59 ; CHECK: shufps 85 ; CHECK: shufps
60 ; CHECK: shufps 86 ; CHECK: shufps
61 } 87 }
62 88
63 define <8 x i1> @insertelement_v8i1(<8 x i1> %vec, i32 %elt.arg) { 89 define <8 x i1> @insertelement_v8i1(<8 x i1> %vec, i32 %elt.arg) {
64 entry: 90 entry:
65 %elt = trunc i32 %elt.arg to i1 91 %elt = trunc i32 %elt.arg to i1
66 %res = insertelement <8 x i1> %vec, i1 %elt, i32 1 92 %res = insertelement <8 x i1> %vec, i1 %elt, i32 1
67 ret <8 x i1> %res 93 ret <8 x i1> %res
68 ; CHECK-LABEL: insertelement_v8i1: 94 ; CHECK-LABEL: insertelement_v8i1:
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 %res.ext = zext i1 %res to i32 168 %res.ext = zext i1 %res to i32
143 ret i32 %res.ext 169 ret i32 %res.ext
144 ; CHECK-LABEL: extractelement_v16i1: 170 ; CHECK-LABEL: extractelement_v16i1:
145 ; CHECK: movups 171 ; CHECK: movups
146 ; CHECK: lea 172 ; CHECK: lea
147 ; CHECK: mov 173 ; CHECK: mov
148 } 174 }
149 175
150 ; ERRORS-NOT: ICE translation error 176 ; ERRORS-NOT: ICE translation error
151 ; DUMP-NOT: SZ 177 ; DUMP-NOT: SZ
OLDNEW
« src/IceInstX8632.h ('K') | « src/IceTargetLoweringX8632.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698