1 ; RUN: llc < %s -mtriple=ve-unknown-unknown | FileCheck %s
3 @vi8 = common dso_local local_unnamed_addr global i8 0, align 4
4 @vi16 = common dso_local local_unnamed_addr global i16 0, align 4
5 @vi32 = common dso_local local_unnamed_addr global i32 0, align 4
6 @vi64 = common dso_local local_unnamed_addr global i64 0, align 4
7 @vf32 = common dso_local local_unnamed_addr global float 0.000000e+00, align 4
8 @vf64 = common dso_local local_unnamed_addr global double 0.000000e+00, align 4
10 ; Function Attrs: norecurse nounwind readonly
11 define double @loadf64stk() {
12 ; CHECK-LABEL: loadf64stk:
13 ; CHECK: .LBB{{[0-9]+}}_2:
14 ; CHECK-NEXT: ld %s0, 8(, %s11)
15 ; CHECK-NEXT: adds.l %s11, 16, %s11
16 ; CHECK-NEXT: b.l.t (, %s10)
17 %addr = alloca double, align 4
18 %1 = load double, ptr %addr, align 4
22 ; Function Attrs: norecurse nounwind readonly
23 define float @loadf32stk() {
24 ; CHECK-LABEL: loadf32stk:
25 ; CHECK: .LBB{{[0-9]+}}_2:
26 ; CHECK-NEXT: ldu %s0, 12(, %s11)
27 ; CHECK-NEXT: adds.l %s11, 16, %s11
28 ; CHECK-NEXT: b.l.t (, %s10)
29 %addr = alloca float, align 4
30 %1 = load float, ptr %addr, align 4
34 ; Function Attrs: norecurse nounwind readonly
35 define i64 @loadi64stk() {
36 ; CHECK-LABEL: loadi64stk:
37 ; CHECK: .LBB{{[0-9]+}}_2:
38 ; CHECK-NEXT: ld %s0, 8(, %s11)
39 ; CHECK-NEXT: adds.l %s11, 16, %s11
40 ; CHECK-NEXT: b.l.t (, %s10)
41 %addr = alloca i64, align 4
42 %1 = load i64, ptr %addr, align 4
46 ; Function Attrs: norecurse nounwind readonly
47 define i32 @loadi32stk() {
48 ; CHECK-LABEL: loadi32stk:
49 ; CHECK: .LBB{{[0-9]+}}_2:
50 ; CHECK-NEXT: ldl.sx %s0, 12(, %s11)
51 ; CHECK-NEXT: adds.l %s11, 16, %s11
52 ; CHECK-NEXT: b.l.t (, %s10)
53 %addr = alloca i32, align 4
54 %1 = load i32, ptr %addr, align 4
58 ; Function Attrs: norecurse nounwind readonly
59 define i16 @loadi16stk() {
60 ; CHECK-LABEL: loadi16stk:
61 ; CHECK: .LBB{{[0-9]+}}_2:
62 ; CHECK-NEXT: ld2b.zx %s0, 12(, %s11)
63 ; CHECK-NEXT: adds.l %s11, 16, %s11
64 ; CHECK-NEXT: b.l.t (, %s10)
65 %addr = alloca i16, align 4
66 %1 = load i16, ptr %addr, align 4
70 ; Function Attrs: norecurse nounwind readonly
71 define i8 @loadi8stk() {
72 ; CHECK-LABEL: loadi8stk:
73 ; CHECK: .LBB{{[0-9]+}}_2:
74 ; CHECK-NEXT: ld1b.zx %s0, 12(, %s11)
75 ; CHECK-NEXT: adds.l %s11, 16, %s11
76 ; CHECK-NEXT: b.l.t (, %s10)
77 %addr = alloca i8, align 4
78 %1 = load i8, ptr %addr, align 4
82 ; Function Attrs: norecurse nounwind readonly
83 define double @loadf64com() {
84 ; CHECK-LABEL: loadf64com:
86 ; CHECK-NEXT: lea %s0, vf64@lo
87 ; CHECK-NEXT: and %s0, %s0, (32)0
88 ; CHECK-NEXT: lea.sl %s0, vf64@hi(, %s0)
89 ; CHECK-NEXT: ld %s0, (, %s0)
90 ; CHECK-NEXT: b.l.t (, %s10)
91 %1 = load double, ptr @vf64, align 4
95 ; Function Attrs: norecurse nounwind readonly
96 define float @loadf32com() {
97 ; CHECK-LABEL: loadf32com:
99 ; CHECK-NEXT: lea %s0, vf32@lo
100 ; CHECK-NEXT: and %s0, %s0, (32)0
101 ; CHECK-NEXT: lea.sl %s0, vf32@hi(, %s0)
102 ; CHECK-NEXT: ldu %s0, (, %s0)
103 ; CHECK-NEXT: b.l.t (, %s10)
104 %1 = load float, ptr @vf32, align 4
108 ; Function Attrs: norecurse nounwind readonly
109 define i64 @loadi64com() {
110 ; CHECK-LABEL: loadi64com:
112 ; CHECK-NEXT: lea %s0, vi64@lo
113 ; CHECK-NEXT: and %s0, %s0, (32)0
114 ; CHECK-NEXT: lea.sl %s0, vi64@hi(, %s0)
115 ; CHECK-NEXT: ld %s0, (, %s0)
116 ; CHECK-NEXT: b.l.t (, %s10)
117 %1 = load i64, ptr @vi64, align 4
121 ; Function Attrs: norecurse nounwind readonly
122 define i32 @loadi32com() {
123 ; CHECK-LABEL: loadi32com:
125 ; CHECK-NEXT: lea %s0, vi32@lo
126 ; CHECK-NEXT: and %s0, %s0, (32)0
127 ; CHECK-NEXT: lea.sl %s0, vi32@hi(, %s0)
128 ; CHECK-NEXT: ldl.sx %s0, (, %s0)
129 ; CHECK-NEXT: b.l.t (, %s10)
130 %1 = load i32, ptr @vi32, align 4
134 ; Function Attrs: norecurse nounwind readonly
135 define i16 @loadi16com() {
136 ; CHECK-LABEL: loadi16com:
138 ; CHECK-NEXT: lea %s0, vi16@lo
139 ; CHECK-NEXT: and %s0, %s0, (32)0
140 ; CHECK-NEXT: lea.sl %s0, vi16@hi(, %s0)
141 ; CHECK-NEXT: ld2b.zx %s0, (, %s0)
142 ; CHECK-NEXT: b.l.t (, %s10)
143 %1 = load i16, ptr @vi16, align 4
147 ; Function Attrs: norecurse nounwind readonly
148 define i8 @loadi8com() {
149 ; CHECK-LABEL: loadi8com:
151 ; CHECK-NEXT: lea %s0, vi8@lo
152 ; CHECK-NEXT: and %s0, %s0, (32)0
153 ; CHECK-NEXT: lea.sl %s0, vi8@hi(, %s0)
154 ; CHECK-NEXT: ld1b.zx %s0, (, %s0)
155 ; CHECK-NEXT: b.l.t (, %s10)
156 %1 = load i8, ptr @vi8, align 4