blob: 49ce181b015a392cc04cec5dea79f70b5cdd9069 [file] [log] [blame]
Daniel Sanders8008de52015-10-15 14:34:23 +00001; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mattr=mips16 -relocation-model=static < %s | FileCheck %s -check-prefix=stel
Reed Kotler515e9372013-05-16 02:17:42 +00002
3@x = external global float
4@xd = external global double
5@y = external global float
6@yd = external global double
7@ret_sf = external global float
8@ret_df = external global double
9@ret_sc = external global { float, float }
10@ret_dc = external global { double, double }
11
12; Function Attrs: nounwind
13define void @v_sf(float %p) #0 {
14entry:
15 %p.addr = alloca float, align 4
16 store float %p, float* %p.addr, align 4
David Blaikiea79ac142015-02-27 21:17:42 +000017 %0 = load float, float* %p.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +000018 store float %0, float* @x, align 4
19 ret void
20}
Daniel Sanders332cef62015-10-12 14:16:52 +000021; stel: .section .mips16.fn.v_sf,"ax",@progbits
22; stel: .ent __fn_stub_v_sf
Daniel Sanderse160f832016-05-14 12:43:08 +000023; stel: lui $25, %hi(v_sf)
24; stel: addiu $25, $25, %lo(v_sf)
Daniel Sandersd6cf3e02015-10-21 12:44:14 +000025; stel: mfc1 $4, $f12
Daniel Sanders332cef62015-10-12 14:16:52 +000026; stel: jr $25
27; stel: __fn_local_v_sf = v_sf
28; stel: .end __fn_stub_v_sf
Reed Kotler515e9372013-05-16 02:17:42 +000029
30declare i32 @printf(i8*, ...) #1
31
32; Function Attrs: nounwind
33define void @v_df(double %p) #0 {
34entry:
35 %p.addr = alloca double, align 8
36 store double %p, double* %p.addr, align 8
David Blaikiea79ac142015-02-27 21:17:42 +000037 %0 = load double, double* %p.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +000038 store double %0, double* @xd, align 8
39 ret void
40}
41
Daniel Sanders332cef62015-10-12 14:16:52 +000042; stel: .section .mips16.fn.v_df,"ax",@progbits
43; stel: .ent __fn_stub_v_df
Daniel Sanderse160f832016-05-14 12:43:08 +000044; stel: lui $25, %hi(v_df)
45; stel: addiu $25, $25, %lo(v_df)
Daniel Sandersd6cf3e02015-10-21 12:44:14 +000046; stel: mfc1 $4, $f12
47; stel: mfc1 $5, $f13
Daniel Sanders332cef62015-10-12 14:16:52 +000048; stel: jr $25
49; stel: __fn_local_v_df = v_df
50; stel: .end __fn_stub_v_df
Reed Kotler515e9372013-05-16 02:17:42 +000051
52; Function Attrs: nounwind
53define void @v_sf_sf(float %p1, float %p2) #0 {
54entry:
55 %p1.addr = alloca float, align 4
56 %p2.addr = alloca float, align 4
57 store float %p1, float* %p1.addr, align 4
58 store float %p2, float* %p2.addr, align 4
David Blaikiea79ac142015-02-27 21:17:42 +000059 %0 = load float, float* %p1.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +000060 store float %0, float* @x, align 4
David Blaikiea79ac142015-02-27 21:17:42 +000061 %1 = load float, float* %p2.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +000062 store float %1, float* @y, align 4
63 ret void
64}
65
Daniel Sanders332cef62015-10-12 14:16:52 +000066; stel: .section .mips16.fn.v_sf_sf,"ax",@progbits
67; stel: .ent __fn_stub_v_sf_sf
Daniel Sanderse160f832016-05-14 12:43:08 +000068; stel: lui $25, %hi(v_sf_sf)
69; stel: addiu $25, $25, %lo(v_sf_sf)
Daniel Sandersd6cf3e02015-10-21 12:44:14 +000070; stel: mfc1 $4, $f12
71; stel: mfc1 $5, $f14
Daniel Sanders332cef62015-10-12 14:16:52 +000072; stel: jr $25
73; stel: __fn_local_v_sf_sf = v_sf_sf
74; stel: .end __fn_stub_v_sf_sf
Reed Kotler515e9372013-05-16 02:17:42 +000075
76; Function Attrs: nounwind
77define void @v_sf_df(float %p1, double %p2) #0 {
78entry:
79 %p1.addr = alloca float, align 4
80 %p2.addr = alloca double, align 8
81 store float %p1, float* %p1.addr, align 4
82 store double %p2, double* %p2.addr, align 8
David Blaikiea79ac142015-02-27 21:17:42 +000083 %0 = load float, float* %p1.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +000084 store float %0, float* @x, align 4
David Blaikiea79ac142015-02-27 21:17:42 +000085 %1 = load double, double* %p2.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +000086 store double %1, double* @yd, align 8
87 ret void
88}
89
Daniel Sanders332cef62015-10-12 14:16:52 +000090; stel: .section .mips16.fn.v_sf_df,"ax",@progbits
91; stel: .ent __fn_stub_v_sf_df
Daniel Sanderse160f832016-05-14 12:43:08 +000092; stel: lui $25, %hi(v_sf_df)
93; stel: addiu $25, $25, %lo(v_sf_df)
Daniel Sandersd6cf3e02015-10-21 12:44:14 +000094; stel: mfc1 $4, $f12
95; stel: mfc1 $6, $f14
96; stel: mfc1 $7, $f15
Daniel Sanders332cef62015-10-12 14:16:52 +000097; stel: jr $25
98; stel: __fn_local_v_sf_df = v_sf_df
99; stel: .end __fn_stub_v_sf_df
Reed Kotler515e9372013-05-16 02:17:42 +0000100
101; Function Attrs: nounwind
102define void @v_df_sf(double %p1, float %p2) #0 {
103entry:
104 %p1.addr = alloca double, align 8
105 %p2.addr = alloca float, align 4
106 store double %p1, double* %p1.addr, align 8
107 store float %p2, float* %p2.addr, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000108 %0 = load double, double* %p1.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +0000109 store double %0, double* @xd, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000110 %1 = load float, float* %p2.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000111 store float %1, float* @y, align 4
112 ret void
113}
114
Daniel Sanders332cef62015-10-12 14:16:52 +0000115; stel: .section .mips16.fn.v_df_sf,"ax",@progbits
116; stel: .ent __fn_stub_v_df_sf
Daniel Sanderse160f832016-05-14 12:43:08 +0000117; stel: lui $25, %hi(v_df_sf)
118; stel: addiu $25, $25, %lo(v_df_sf)
Daniel Sandersd6cf3e02015-10-21 12:44:14 +0000119; stel: mfc1 $4, $f12
120; stel: mfc1 $5, $f13
121; stel: mfc1 $6, $f14
Daniel Sanders332cef62015-10-12 14:16:52 +0000122; stel: jr $25
123; stel: __fn_local_v_df_sf = v_df_sf
124; stel: .end __fn_stub_v_df_sf
Reed Kotler515e9372013-05-16 02:17:42 +0000125
126; Function Attrs: nounwind
127define void @v_df_df(double %p1, double %p2) #0 {
128entry:
129 %p1.addr = alloca double, align 8
130 %p2.addr = alloca double, align 8
131 store double %p1, double* %p1.addr, align 8
132 store double %p2, double* %p2.addr, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000133 %0 = load double, double* %p1.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +0000134 store double %0, double* @xd, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000135 %1 = load double, double* %p2.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +0000136 store double %1, double* @yd, align 8
137 ret void
138}
139
Daniel Sanders332cef62015-10-12 14:16:52 +0000140; stel: .section .mips16.fn.v_df_df,"ax",@progbits
141; stel: .ent __fn_stub_v_df_df
Daniel Sanderse160f832016-05-14 12:43:08 +0000142; stel: lui $25, %hi(v_df_df)
143; stel: addiu $25, $25, %lo(v_df_df)
Daniel Sandersd6cf3e02015-10-21 12:44:14 +0000144; stel: mfc1 $4, $f12
145; stel: mfc1 $5, $f13
146; stel: mfc1 $6, $f14
147; stel: mfc1 $7, $f15
Daniel Sanders332cef62015-10-12 14:16:52 +0000148; stel: jr $25
149; stel: __fn_local_v_df_df = v_df_df
150; stel: .end __fn_stub_v_df_df
Reed Kotler515e9372013-05-16 02:17:42 +0000151
152; Function Attrs: nounwind
153define float @sf_v() #0 {
154entry:
David Blaikiea79ac142015-02-27 21:17:42 +0000155 %0 = load float, float* @ret_sf, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000156 ret float %0
157}
158
159; Function Attrs: nounwind
160define float @sf_sf(float %p) #0 {
161entry:
162 %p.addr = alloca float, align 4
163 store float %p, float* %p.addr, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000164 %0 = load float, float* %p.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000165 store float %0, float* @x, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000166 %1 = load float, float* @ret_sf, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000167 ret float %1
168}
169
170
Daniel Sanders332cef62015-10-12 14:16:52 +0000171; stel: .section .mips16.fn.sf_sf,"ax",@progbits
172; stel: .ent __fn_stub_sf_sf
Daniel Sanderse160f832016-05-14 12:43:08 +0000173; stel: lui $25, %hi(sf_sf)
174; stel: addiu $25, $25, %lo(sf_sf)
Daniel Sandersd6cf3e02015-10-21 12:44:14 +0000175; stel: mfc1 $4, $f12
Daniel Sanders332cef62015-10-12 14:16:52 +0000176; stel: jr $25
177; stel: __fn_local_sf_sf = sf_sf
178; stel: .end __fn_stub_sf_sf
Reed Kotler515e9372013-05-16 02:17:42 +0000179
180
181; Function Attrs: nounwind
182define float @sf_df(double %p) #0 {
183entry:
184 %p.addr = alloca double, align 8
185 store double %p, double* %p.addr, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000186 %0 = load double, double* %p.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +0000187 store double %0, double* @xd, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000188 %1 = load float, float* @ret_sf, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000189 ret float %1
190}
191
Daniel Sanders332cef62015-10-12 14:16:52 +0000192; stel: .section .mips16.fn.sf_df,"ax",@progbits
193; stel: .ent __fn_stub_sf_df
Daniel Sanderse160f832016-05-14 12:43:08 +0000194; stel: lui $25, %hi(sf_df)
195; stel: addiu $25, $25, %lo(sf_df)
Daniel Sandersd6cf3e02015-10-21 12:44:14 +0000196; stel: mfc1 $4, $f12
197; stel: mfc1 $5, $f13
Daniel Sanders332cef62015-10-12 14:16:52 +0000198; stel: jr $25
199; stel: __fn_local_sf_df = sf_df
200; stel: .end __fn_stub_sf_df
Reed Kotler515e9372013-05-16 02:17:42 +0000201
202; Function Attrs: nounwind
203define float @sf_sf_sf(float %p1, float %p2) #0 {
204entry:
205 %p1.addr = alloca float, align 4
206 %p2.addr = alloca float, align 4
207 store float %p1, float* %p1.addr, align 4
208 store float %p2, float* %p2.addr, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000209 %0 = load float, float* %p1.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000210 store float %0, float* @x, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000211 %1 = load float, float* %p2.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000212 store float %1, float* @y, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000213 %2 = load float, float* @ret_sf, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000214 ret float %2
215}
216
Daniel Sanders332cef62015-10-12 14:16:52 +0000217; stel: .section .mips16.fn.sf_sf_sf,"ax",@progbits
218; stel: .ent __fn_stub_sf_sf_sf
Daniel Sanderse160f832016-05-14 12:43:08 +0000219; stel: lui $25, %hi(sf_sf_sf)
220; stel: addiu $25, $25, %lo(sf_sf_sf)
Daniel Sandersd6cf3e02015-10-21 12:44:14 +0000221; stel: mfc1 $4, $f12
222; stel: mfc1 $5, $f14
Daniel Sanders332cef62015-10-12 14:16:52 +0000223; stel: jr $25
224; stel: __fn_local_sf_sf_sf = sf_sf_sf
225; stel: .end __fn_stub_sf_sf_sf
Reed Kotler515e9372013-05-16 02:17:42 +0000226
227; Function Attrs: nounwind
228define float @sf_sf_df(float %p1, double %p2) #0 {
229entry:
230 %p1.addr = alloca float, align 4
231 %p2.addr = alloca double, align 8
232 store float %p1, float* %p1.addr, align 4
233 store double %p2, double* %p2.addr, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000234 %0 = load float, float* %p1.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000235 store float %0, float* @x, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000236 %1 = load double, double* %p2.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +0000237 store double %1, double* @yd, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000238 %2 = load float, float* @ret_sf, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000239 ret float %2
240}
241
Daniel Sanders332cef62015-10-12 14:16:52 +0000242; stel: .section .mips16.fn.sf_sf_df,"ax",@progbits
243; stel: .ent __fn_stub_sf_sf_df
Daniel Sanderse160f832016-05-14 12:43:08 +0000244; stel: lui $25, %hi(sf_sf_df)
245; stel: addiu $25, $25, %lo(sf_sf_df)
Daniel Sandersd6cf3e02015-10-21 12:44:14 +0000246; stel: mfc1 $4, $f12
247; stel: mfc1 $6, $f14
248; stel: mfc1 $7, $f15
Daniel Sanders332cef62015-10-12 14:16:52 +0000249; stel: jr $25
250; stel: __fn_local_sf_sf_df = sf_sf_df
251; stel: .end __fn_stub_sf_sf_df
Reed Kotler515e9372013-05-16 02:17:42 +0000252
253; Function Attrs: nounwind
254define float @sf_df_sf(double %p1, float %p2) #0 {
255entry:
256 %p1.addr = alloca double, align 8
257 %p2.addr = alloca float, align 4
258 store double %p1, double* %p1.addr, align 8
259 store float %p2, float* %p2.addr, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000260 %0 = load double, double* %p1.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +0000261 store double %0, double* @xd, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000262 %1 = load float, float* %p2.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000263 store float %1, float* @y, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000264 %2 = load float, float* @ret_sf, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000265 ret float %2
266}
267
Daniel Sanders332cef62015-10-12 14:16:52 +0000268; stel: .section .mips16.fn.sf_df_sf,"ax",@progbits
269; stel: .ent __fn_stub_sf_df_sf
Daniel Sanderse160f832016-05-14 12:43:08 +0000270; stel: lui $25, %hi(sf_df_sf)
271; stel: addiu $25, $25, %lo(sf_df_sf)
Daniel Sandersd6cf3e02015-10-21 12:44:14 +0000272; stel: mfc1 $4, $f12
273; stel: mfc1 $5, $f13
274; stel: mfc1 $6, $f14
Daniel Sanders332cef62015-10-12 14:16:52 +0000275; stel: jr $25
276; stel: __fn_local_sf_df_sf = sf_df_sf
277; stel: .end __fn_stub_sf_df_sf
Reed Kotler515e9372013-05-16 02:17:42 +0000278
279; Function Attrs: nounwind
280define float @sf_df_df(double %p1, double %p2) #0 {
281entry:
282 %p1.addr = alloca double, align 8
283 %p2.addr = alloca double, align 8
284 store double %p1, double* %p1.addr, align 8
285 store double %p2, double* %p2.addr, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000286 %0 = load double, double* %p1.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +0000287 store double %0, double* @xd, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000288 %1 = load double, double* %p2.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +0000289 store double %1, double* @yd, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000290 %2 = load float, float* @ret_sf, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000291 ret float %2
292}
293
Daniel Sanders332cef62015-10-12 14:16:52 +0000294; stel: .section .mips16.fn.sf_df_df,"ax",@progbits
295; stel: .ent __fn_stub_sf_df_df
Daniel Sanderse160f832016-05-14 12:43:08 +0000296; stel: lui $25, %hi(sf_df_df)
297; stel: addiu $25, $25, %lo(sf_df_df)
Daniel Sandersd6cf3e02015-10-21 12:44:14 +0000298; stel: mfc1 $4, $f12
299; stel: mfc1 $5, $f13
300; stel: mfc1 $6, $f14
301; stel: mfc1 $7, $f15
Daniel Sanders332cef62015-10-12 14:16:52 +0000302; stel: jr $25
303; stel: __fn_local_sf_df_df = sf_df_df
304; stel: .end __fn_stub_sf_df_df
Reed Kotler515e9372013-05-16 02:17:42 +0000305
Bill Wendling187d3dd2013-08-22 21:28:54 +0000306attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }