1 ; RUN: llc < %s -mtriple=ve-unknown-unknown -mattr=+vpu | FileCheck %s
6 define fastcc i64 @extract_rr_v256i64(i32 signext %idx, <256 x i64> %v) {
7 ; CHECK-LABEL: extract_rr_v256i64:
9 ; CHECK-NEXT: lvs %s0, %v0(%s0)
10 ; CHECK-NEXT: b.l.t (, %s10)
11 %ret = extractelement <256 x i64> %v, i32 %idx
15 define fastcc i64 @extract_ri7_v256i64(<256 x i64> %v) {
16 ; CHECK-LABEL: extract_ri7_v256i64:
18 ; CHECK-NEXT: lvs %s0, %v0(127)
19 ; CHECK-NEXT: b.l.t (, %s10)
20 %ret = extractelement <256 x i64> %v, i32 127
24 define fastcc i64 @extract_ri8_v256i64(<256 x i64> %v) {
25 ; CHECK-LABEL: extract_ri8_v256i64:
27 ; CHECK-NEXT: lea %s0, 128
28 ; CHECK-NEXT: lvs %s0, %v0(%s0)
29 ; CHECK-NEXT: b.l.t (, %s10)
30 %ret = extractelement <256 x i64> %v, i32 128
34 define fastcc i64 @extract_ri_v512i64(<512 x i64> %v) {
35 ; CHECK-LABEL: extract_ri_v512i64:
37 ; CHECK-NEXT: lvs %s0, %v1(116)
38 ; CHECK-NEXT: b.l.t (, %s10)
39 %ret = extractelement <512 x i64> %v, i32 372
45 define fastcc i32 @extract_rr_v256i32(i32 signext %idx, <256 x i32> %v) {
46 ; CHECK-LABEL: extract_rr_v256i32:
48 ; CHECK-NEXT: lvs %s0, %v0(%s0)
49 ; CHECK-NEXT: b.l.t (, %s10)
50 %ret = extractelement <256 x i32> %v, i32 %idx
54 define fastcc i32 @extract_ri7_v256i32(<256 x i32> %v) {
55 ; CHECK-LABEL: extract_ri7_v256i32:
57 ; CHECK-NEXT: lvs %s0, %v0(127)
58 ; CHECK-NEXT: b.l.t (, %s10)
59 %ret = extractelement <256 x i32> %v, i32 127
63 define fastcc i32 @extract_ri8_v256i32(<256 x i32> %v) {
64 ; CHECK-LABEL: extract_ri8_v256i32:
66 ; CHECK-NEXT: lea %s0, 128
67 ; CHECK-NEXT: lvs %s0, %v0(%s0)
68 ; CHECK-NEXT: b.l.t (, %s10)
69 %ret = extractelement <256 x i32> %v, i32 128
73 define fastcc i32 @extract_ri_v512i32(<512 x i32> %v) {
74 ; CHECK-LABEL: extract_ri_v512i32:
76 ; CHECK-NEXT: lea %s0, 186
77 ; CHECK-NEXT: lvs %s0, %v0(%s0)
78 ; CHECK-NEXT: srl %s0, %s0, 32
79 ; CHECK-NEXT: b.l.t (, %s10)
80 %ret = extractelement <512 x i32> %v, i32 372
84 define fastcc i32 @extract_rr_v512i32(<512 x i32> %v, i32 signext %idx) {
85 ; CHECK-LABEL: extract_rr_v512i32:
87 ; CHECK-NEXT: srl %s1, %s0, 1
88 ; CHECK-NEXT: lvs %s1, %v0(%s1)
89 ; CHECK-NEXT: nnd %s0, %s0, (63)0
90 ; CHECK-NEXT: sla.w.sx %s0, %s0, 5
91 ; CHECK-NEXT: srl %s0, %s1, %s0
92 ; CHECK-NEXT: and %s0, %s0, (32)0
93 ; CHECK-NEXT: b.l.t (, %s10)
94 %ret = extractelement <512 x i32> %v, i32 %idx
100 define fastcc double @extract_rr_v256f64(i32 signext %idx, <256 x double> %v) {
101 ; CHECK-LABEL: extract_rr_v256f64:
103 ; CHECK-NEXT: lvs %s0, %v0(%s0)
104 ; CHECK-NEXT: b.l.t (, %s10)
105 %ret = extractelement <256 x double> %v, i32 %idx
109 define fastcc double @extract_ri7_v256f64(<256 x double> %v) {
110 ; CHECK-LABEL: extract_ri7_v256f64:
112 ; CHECK-NEXT: lvs %s0, %v0(127)
113 ; CHECK-NEXT: b.l.t (, %s10)
114 %ret = extractelement <256 x double> %v, i32 127
118 define fastcc double @extract_ri8_v256f64(<256 x double> %v) {
119 ; CHECK-LABEL: extract_ri8_v256f64:
121 ; CHECK-NEXT: lea %s0, 128
122 ; CHECK-NEXT: lvs %s0, %v0(%s0)
123 ; CHECK-NEXT: b.l.t (, %s10)
124 %ret = extractelement <256 x double> %v, i32 128
128 define fastcc double @extract_ri_v512f64(<512 x double> %v) {
129 ; CHECK-LABEL: extract_ri_v512f64:
131 ; CHECK-NEXT: lvs %s0, %v1(116)
132 ; CHECK-NEXT: b.l.t (, %s10)
133 %ret = extractelement <512 x double> %v, i32 372
139 define fastcc float @extract_rr_v256f32(i32 signext %idx, <256 x float> %v) {
140 ; CHECK-LABEL: extract_rr_v256f32:
142 ; CHECK-NEXT: lvs %s0, %v0(%s0)
143 ; CHECK-NEXT: b.l.t (, %s10)
144 %ret = extractelement <256 x float> %v, i32 %idx
148 define fastcc float @extract_ri7_v256f32(<256 x float> %v) {
149 ; CHECK-LABEL: extract_ri7_v256f32:
151 ; CHECK-NEXT: lvs %s0, %v0(127)
152 ; CHECK-NEXT: b.l.t (, %s10)
153 %ret = extractelement <256 x float> %v, i32 127
157 define fastcc float @extract_ri8_v256f32(<256 x float> %v) {
158 ; CHECK-LABEL: extract_ri8_v256f32:
160 ; CHECK-NEXT: lea %s0, 128
161 ; CHECK-NEXT: lvs %s0, %v0(%s0)
162 ; CHECK-NEXT: b.l.t (, %s10)
163 %ret = extractelement <256 x float> %v, i32 128
167 define fastcc float @extract_ri_v512f32(<512 x float> %v) {
168 ; CHECK-LABEL: extract_ri_v512f32:
170 ; CHECK-NEXT: lea %s0, 186
171 ; CHECK-NEXT: lvs %s0, %v0(%s0)
172 ; CHECK-NEXT: srl %s0, %s0, 32
173 ; CHECK-NEXT: sll %s0, %s0, 32
174 ; CHECK-NEXT: b.l.t (, %s10)
175 %ret = extractelement <512 x float> %v, i32 372
179 define fastcc float @extract_rr_v512f32(<512 x float> %v, i32 signext %idx) {
180 ; CHECK-LABEL: extract_rr_v512f32:
182 ; CHECK-NEXT: srl %s1, %s0, 1
183 ; CHECK-NEXT: lvs %s1, %v0(%s1)
184 ; CHECK-NEXT: nnd %s0, %s0, (63)0
185 ; CHECK-NEXT: sla.w.sx %s0, %s0, 5
186 ; CHECK-NEXT: srl %s0, %s1, %s0
187 ; CHECK-NEXT: and %s0, %s0, (32)0
188 ; CHECK-NEXT: sll %s0, %s0, 32
189 ; CHECK-NEXT: b.l.t (, %s10)
190 %ret = extractelement <512 x float> %v, i32 %idx