1 ; RUN: llc < %s -mtriple=ve-unknown-unknown | FileCheck %s
3 ; Function Attrs: norecurse nounwind readonly
4 define fp128 @loadf128(ptr nocapture readonly %0) {
5 ; CHECK-LABEL: loadf128:
7 ; CHECK-NEXT: ld %s2, 8(, %s0)
8 ; CHECK-NEXT: ld %s3, (, %s0)
9 ; CHECK-NEXT: or %s0, 0, %s2
10 ; CHECK-NEXT: or %s1, 0, %s3
11 ; CHECK-NEXT: b.l.t (, %s10)
12 %2 = load fp128, ptr %0, align 16
16 ; Function Attrs: norecurse nounwind readonly
17 define double @loadf64(ptr nocapture readonly %0) {
18 ; CHECK-LABEL: loadf64:
20 ; CHECK-NEXT: ld %s0, (, %s0)
21 ; CHECK-NEXT: b.l.t (, %s10)
22 %2 = load double, ptr %0, align 16
26 ; Function Attrs: norecurse nounwind readonly
27 define float @loadf32(ptr nocapture readonly %0) {
28 ; CHECK-LABEL: loadf32:
30 ; CHECK-NEXT: ldu %s0, (, %s0)
31 ; CHECK-NEXT: b.l.t (, %s10)
32 %2 = load float, ptr %0, align 16
36 ; Function Attrs: norecurse nounwind readonly
37 define i128 @loadi128(ptr nocapture readonly %0) {
38 ; CHECK-LABEL: loadi128:
40 ; CHECK-NEXT: ld %s2, (, %s0)
41 ; CHECK-NEXT: ld %s1, 8(, %s0)
42 ; CHECK-NEXT: or %s0, 0, %s2
43 ; CHECK-NEXT: b.l.t (, %s10)
44 %2 = load i128, ptr %0, align 16
48 ; Function Attrs: norecurse nounwind readonly
49 define i64 @loadi64(ptr nocapture readonly %0) {
50 ; CHECK-LABEL: loadi64:
52 ; CHECK-NEXT: ld %s0, (, %s0)
53 ; CHECK-NEXT: b.l.t (, %s10)
54 %2 = load i64, ptr %0, align 16
58 ; Function Attrs: norecurse nounwind readonly
59 define i32 @loadi32(ptr nocapture readonly %0) {
60 ; CHECK-LABEL: loadi32:
62 ; CHECK-NEXT: ldl.sx %s0, (, %s0)
63 ; CHECK-NEXT: b.l.t (, %s10)
64 %2 = load i32, ptr %0, align 16
68 ; Function Attrs: norecurse nounwind readonly
69 define i64 @loadi32sext(ptr nocapture readonly %0) {
70 ; CHECK-LABEL: loadi32sext:
72 ; CHECK-NEXT: ldl.sx %s0, (, %s0)
73 ; CHECK-NEXT: b.l.t (, %s10)
74 %2 = load i32, ptr %0, align 16
75 %3 = sext i32 %2 to i64
79 ; Function Attrs: norecurse nounwind readonly
80 define i64 @loadi32zext(ptr nocapture readonly %0) {
81 ; CHECK-LABEL: loadi32zext:
83 ; CHECK-NEXT: ldl.zx %s0, (, %s0)
84 ; CHECK-NEXT: b.l.t (, %s10)
85 %2 = load i32, ptr %0, align 16
86 %3 = zext i32 %2 to i64
90 ; Function Attrs: norecurse nounwind readonly
91 define i16 @loadi16(ptr nocapture readonly %0) {
92 ; CHECK-LABEL: loadi16:
94 ; CHECK-NEXT: ld2b.zx %s0, (, %s0)
95 ; CHECK-NEXT: b.l.t (, %s10)
96 %2 = load i16, ptr %0, align 16
100 ; Function Attrs: norecurse nounwind readonly
101 define i64 @loadi16sext(ptr nocapture readonly %0) {
102 ; CHECK-LABEL: loadi16sext:
104 ; CHECK-NEXT: ld2b.sx %s0, (, %s0)
105 ; CHECK-NEXT: b.l.t (, %s10)
106 %2 = load i16, ptr %0, align 16
107 %3 = sext i16 %2 to i64
111 ; Function Attrs: norecurse nounwind readonly
112 define i64 @loadi16zext(ptr nocapture readonly %0) {
113 ; CHECK-LABEL: loadi16zext:
115 ; CHECK-NEXT: ld2b.zx %s0, (, %s0)
116 ; CHECK-NEXT: b.l.t (, %s10)
117 %2 = load i16, ptr %0, align 16
118 %3 = zext i16 %2 to i64
122 ; Function Attrs: norecurse nounwind readonly
123 define i8 @loadi8(ptr nocapture readonly %0) {
124 ; CHECK-LABEL: loadi8:
126 ; CHECK-NEXT: ld1b.zx %s0, (, %s0)
127 ; CHECK-NEXT: b.l.t (, %s10)
128 %2 = load i8, ptr %0, align 16
132 ; Function Attrs: norecurse nounwind readonly
133 define i64 @loadi8sext(ptr nocapture readonly %0) {
134 ; CHECK-LABEL: loadi8sext:
136 ; CHECK-NEXT: ld1b.sx %s0, (, %s0)
137 ; CHECK-NEXT: b.l.t (, %s10)
138 %2 = load i8, ptr %0, align 16
139 %3 = sext i8 %2 to i64
143 ; Function Attrs: norecurse nounwind readonly
144 define i64 @loadi8zext(ptr nocapture readonly %0) {
145 ; CHECK-LABEL: loadi8zext:
147 ; CHECK-NEXT: ld1b.zx %s0, (, %s0)
148 ; CHECK-NEXT: b.l.t (, %s10)
149 %2 = load i8, ptr %0, align 16
150 %3 = zext i8 %2 to i64
154 ; Function Attrs: norecurse nounwind readonly
155 define fp128 @loadf128stk() {
156 ; CHECK-LABEL: loadf128stk:
157 ; CHECK: .LBB{{[0-9]+}}_2:
158 ; CHECK-NEXT: ld %s1, (, %s11)
159 ; CHECK-NEXT: ld %s0, 8(, %s11)
160 ; CHECK-NEXT: adds.l %s11, 16, %s11
161 ; CHECK-NEXT: b.l.t (, %s10)
162 %addr = alloca fp128, align 16
163 %1 = load fp128, ptr %addr, align 16
167 ; Function Attrs: norecurse nounwind readonly
168 define double @loadf64stk() {
169 ; CHECK-LABEL: loadf64stk:
170 ; CHECK: .LBB{{[0-9]+}}_2:
171 ; CHECK-NEXT: ld %s0, (, %s11)
172 ; CHECK-NEXT: adds.l %s11, 16, %s11
173 ; CHECK-NEXT: b.l.t (, %s10)
174 %addr = alloca double, align 16
175 %1 = load double, ptr %addr, align 16
179 ; Function Attrs: norecurse nounwind readonly
180 define float @loadf32stk() {
181 ; CHECK-LABEL: loadf32stk:
182 ; CHECK: .LBB{{[0-9]+}}_2:
183 ; CHECK-NEXT: ldu %s0, (, %s11)
184 ; CHECK-NEXT: adds.l %s11, 16, %s11
185 ; CHECK-NEXT: b.l.t (, %s10)
186 %addr = alloca float, align 16
187 %1 = load float, ptr %addr, align 16
191 ; Function Attrs: norecurse nounwind readonly
192 define i128 @loadi128stk() {
193 ; CHECK-LABEL: loadi128stk:
194 ; CHECK: .LBB{{[0-9]+}}_2:
195 ; CHECK-NEXT: ld %s0, (, %s11)
196 ; CHECK-NEXT: ld %s1, 8(, %s11)
197 ; CHECK-NEXT: adds.l %s11, 16, %s11
198 ; CHECK-NEXT: b.l.t (, %s10)
199 %addr = alloca i128, align 16
200 %1 = load i128, ptr %addr, align 16
204 ; Function Attrs: norecurse nounwind readonly
205 define i64 @loadi64stk() {
206 ; CHECK-LABEL: loadi64stk:
207 ; CHECK: .LBB{{[0-9]+}}_2:
208 ; CHECK-NEXT: ld %s0, (, %s11)
209 ; CHECK-NEXT: adds.l %s11, 16, %s11
210 ; CHECK-NEXT: b.l.t (, %s10)
211 %addr = alloca i64, align 16
212 %1 = load i64, ptr %addr, align 16
216 ; Function Attrs: norecurse nounwind readonly
217 define i32 @loadi32stk() {
218 ; CHECK-LABEL: loadi32stk:
219 ; CHECK: .LBB{{[0-9]+}}_2:
220 ; CHECK-NEXT: ldl.sx %s0, (, %s11)
221 ; CHECK-NEXT: adds.l %s11, 16, %s11
222 ; CHECK-NEXT: b.l.t (, %s10)
223 %addr = alloca i32, align 16
224 %1 = load i32, ptr %addr, align 16
228 ; Function Attrs: norecurse nounwind readonly
229 define i16 @loadi16stk() {
230 ; CHECK-LABEL: loadi16stk:
231 ; CHECK: .LBB{{[0-9]+}}_2:
232 ; CHECK-NEXT: ld2b.zx %s0, (, %s11)
233 ; CHECK-NEXT: adds.l %s11, 16, %s11
234 ; CHECK-NEXT: b.l.t (, %s10)
235 %addr = alloca i16, align 16
236 %1 = load i16, ptr %addr, align 16
240 ; Function Attrs: norecurse nounwind readonly
241 define i8 @loadi8stk() {
242 ; CHECK-LABEL: loadi8stk:
243 ; CHECK: .LBB{{[0-9]+}}_2:
244 ; CHECK-NEXT: ld1b.zx %s0, (, %s11)
245 ; CHECK-NEXT: adds.l %s11, 16, %s11
246 ; CHECK-NEXT: b.l.t (, %s10)
247 %addr = alloca i8, align 16
248 %1 = load i8, ptr %addr, align 16