blob: a7f3196aba20ad25e0d71726eb49cd5d9b7a4d5b [file] [log] [blame]
Simon Atanasyan1093afe22013-11-19 12:20:17 +00001; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=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
23; stel: la $25,v_sf
24; stel: mfc1 $4,$f12
25; stel: jr $25
26; stel: __fn_local_v_sf = v_sf
27; stel: .end __fn_stub_v_sf
Reed Kotler515e9372013-05-16 02:17:42 +000028
29declare i32 @printf(i8*, ...) #1
30
31; Function Attrs: nounwind
32define void @v_df(double %p) #0 {
33entry:
34 %p.addr = alloca double, align 8
35 store double %p, double* %p.addr, align 8
David Blaikiea79ac142015-02-27 21:17:42 +000036 %0 = load double, double* %p.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +000037 store double %0, double* @xd, align 8
38 ret void
39}
40
Daniel Sanders332cef62015-10-12 14:16:52 +000041; stel: .section .mips16.fn.v_df,"ax",@progbits
42; stel: .ent __fn_stub_v_df
43; stel: la $25,v_df
44; stel: mfc1 $4,$f12
45; stel: mfc1 $5,$f13
46; stel: jr $25
47; stel: __fn_local_v_df = v_df
48; stel: .end __fn_stub_v_df
Reed Kotler515e9372013-05-16 02:17:42 +000049
50; Function Attrs: nounwind
51define void @v_sf_sf(float %p1, float %p2) #0 {
52entry:
53 %p1.addr = alloca float, align 4
54 %p2.addr = alloca float, align 4
55 store float %p1, float* %p1.addr, align 4
56 store float %p2, float* %p2.addr, align 4
David Blaikiea79ac142015-02-27 21:17:42 +000057 %0 = load float, float* %p1.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +000058 store float %0, float* @x, align 4
David Blaikiea79ac142015-02-27 21:17:42 +000059 %1 = load float, float* %p2.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +000060 store float %1, float* @y, align 4
61 ret void
62}
63
Daniel Sanders332cef62015-10-12 14:16:52 +000064; stel: .section .mips16.fn.v_sf_sf,"ax",@progbits
65; stel: .ent __fn_stub_v_sf_sf
66; stel: la $25,v_sf_sf
67; stel: mfc1 $4,$f12
68; stel: mfc1 $5,$f14
69; stel: jr $25
70; stel: __fn_local_v_sf_sf = v_sf_sf
71; stel: .end __fn_stub_v_sf_sf
Reed Kotler515e9372013-05-16 02:17:42 +000072
73; Function Attrs: nounwind
74define void @v_sf_df(float %p1, double %p2) #0 {
75entry:
76 %p1.addr = alloca float, align 4
77 %p2.addr = alloca double, align 8
78 store float %p1, float* %p1.addr, align 4
79 store double %p2, double* %p2.addr, align 8
David Blaikiea79ac142015-02-27 21:17:42 +000080 %0 = load float, float* %p1.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +000081 store float %0, float* @x, align 4
David Blaikiea79ac142015-02-27 21:17:42 +000082 %1 = load double, double* %p2.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +000083 store double %1, double* @yd, align 8
84 ret void
85}
86
Daniel Sanders332cef62015-10-12 14:16:52 +000087; stel: .section .mips16.fn.v_sf_df,"ax",@progbits
88; stel: .ent __fn_stub_v_sf_df
89; stel: la $25,v_sf_df
90; stel: mfc1 $4,$f12
91; stel: mfc1 $6,$f14
92; stel: mfc1 $7,$f15
93; stel: jr $25
94; stel: __fn_local_v_sf_df = v_sf_df
95; stel: .end __fn_stub_v_sf_df
Reed Kotler515e9372013-05-16 02:17:42 +000096
97; Function Attrs: nounwind
98define void @v_df_sf(double %p1, float %p2) #0 {
99entry:
100 %p1.addr = alloca double, align 8
101 %p2.addr = alloca float, align 4
102 store double %p1, double* %p1.addr, align 8
103 store float %p2, float* %p2.addr, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000104 %0 = load double, double* %p1.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +0000105 store double %0, double* @xd, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000106 %1 = load float, float* %p2.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000107 store float %1, float* @y, align 4
108 ret void
109}
110
Daniel Sanders332cef62015-10-12 14:16:52 +0000111; stel: .section .mips16.fn.v_df_sf,"ax",@progbits
112; stel: .ent __fn_stub_v_df_sf
113; stel: la $25,v_df_sf
114; stel: mfc1 $4,$f12
115; stel: mfc1 $5,$f13
116; stel: mfc1 $6,$f14
117; stel: jr $25
118; stel: __fn_local_v_df_sf = v_df_sf
119; stel: .end __fn_stub_v_df_sf
Reed Kotler515e9372013-05-16 02:17:42 +0000120
121; Function Attrs: nounwind
122define void @v_df_df(double %p1, double %p2) #0 {
123entry:
124 %p1.addr = alloca double, align 8
125 %p2.addr = alloca double, align 8
126 store double %p1, double* %p1.addr, align 8
127 store double %p2, double* %p2.addr, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000128 %0 = load double, double* %p1.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +0000129 store double %0, double* @xd, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000130 %1 = load double, double* %p2.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +0000131 store double %1, double* @yd, align 8
132 ret void
133}
134
Daniel Sanders332cef62015-10-12 14:16:52 +0000135; stel: .section .mips16.fn.v_df_df,"ax",@progbits
136; stel: .ent __fn_stub_v_df_df
137; stel: la $25,v_df_df
138; stel: mfc1 $4,$f12
139; stel: mfc1 $5,$f13
140; stel: mfc1 $6,$f14
141; stel: mfc1 $7,$f15
142; stel: jr $25
143; stel: __fn_local_v_df_df = v_df_df
144; stel: .end __fn_stub_v_df_df
Reed Kotler515e9372013-05-16 02:17:42 +0000145
146; Function Attrs: nounwind
147define float @sf_v() #0 {
148entry:
David Blaikiea79ac142015-02-27 21:17:42 +0000149 %0 = load float, float* @ret_sf, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000150 ret float %0
151}
152
153; Function Attrs: nounwind
154define float @sf_sf(float %p) #0 {
155entry:
156 %p.addr = alloca float, align 4
157 store float %p, float* %p.addr, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000158 %0 = load float, float* %p.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000159 store float %0, float* @x, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000160 %1 = load float, float* @ret_sf, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000161 ret float %1
162}
163
164
Daniel Sanders332cef62015-10-12 14:16:52 +0000165; stel: .section .mips16.fn.sf_sf,"ax",@progbits
166; stel: .ent __fn_stub_sf_sf
167; stel: la $25,sf_sf
168; stel: mfc1 $4,$f12
169; stel: jr $25
170; stel: __fn_local_sf_sf = sf_sf
171; stel: .end __fn_stub_sf_sf
Reed Kotler515e9372013-05-16 02:17:42 +0000172
173
174; Function Attrs: nounwind
175define float @sf_df(double %p) #0 {
176entry:
177 %p.addr = alloca double, align 8
178 store double %p, double* %p.addr, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000179 %0 = load double, double* %p.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +0000180 store double %0, double* @xd, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000181 %1 = load float, float* @ret_sf, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000182 ret float %1
183}
184
Daniel Sanders332cef62015-10-12 14:16:52 +0000185; stel: .section .mips16.fn.sf_df,"ax",@progbits
186; stel: .ent __fn_stub_sf_df
187; stel: la $25,sf_df
188; stel: mfc1 $4,$f12
189; stel: mfc1 $5,$f13
190; stel: jr $25
191; stel: __fn_local_sf_df = sf_df
192; stel: .end __fn_stub_sf_df
Reed Kotler515e9372013-05-16 02:17:42 +0000193
194; Function Attrs: nounwind
195define float @sf_sf_sf(float %p1, float %p2) #0 {
196entry:
197 %p1.addr = alloca float, align 4
198 %p2.addr = alloca float, align 4
199 store float %p1, float* %p1.addr, align 4
200 store float %p2, float* %p2.addr, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000201 %0 = load float, float* %p1.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000202 store float %0, float* @x, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000203 %1 = load float, float* %p2.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000204 store float %1, float* @y, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000205 %2 = load float, float* @ret_sf, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000206 ret float %2
207}
208
Daniel Sanders332cef62015-10-12 14:16:52 +0000209; stel: .section .mips16.fn.sf_sf_sf,"ax",@progbits
210; stel: .ent __fn_stub_sf_sf_sf
211; stel: la $25,sf_sf_sf
212; stel: mfc1 $4,$f12
213; stel: mfc1 $5,$f14
214; stel: jr $25
215; stel: __fn_local_sf_sf_sf = sf_sf_sf
216; stel: .end __fn_stub_sf_sf_sf
Reed Kotler515e9372013-05-16 02:17:42 +0000217
218; Function Attrs: nounwind
219define float @sf_sf_df(float %p1, double %p2) #0 {
220entry:
221 %p1.addr = alloca float, align 4
222 %p2.addr = alloca double, align 8
223 store float %p1, float* %p1.addr, align 4
224 store double %p2, double* %p2.addr, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000225 %0 = load float, float* %p1.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000226 store float %0, float* @x, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000227 %1 = load double, double* %p2.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +0000228 store double %1, double* @yd, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000229 %2 = load float, float* @ret_sf, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000230 ret float %2
231}
232
Daniel Sanders332cef62015-10-12 14:16:52 +0000233; stel: .section .mips16.fn.sf_sf_df,"ax",@progbits
234; stel: .ent __fn_stub_sf_sf_df
235; stel: la $25,sf_sf_df
236; stel: mfc1 $4,$f12
237; stel: mfc1 $6,$f14
238; stel: mfc1 $7,$f15
239; stel: jr $25
240; stel: __fn_local_sf_sf_df = sf_sf_df
241; stel: .end __fn_stub_sf_sf_df
Reed Kotler515e9372013-05-16 02:17:42 +0000242
243; Function Attrs: nounwind
244define float @sf_df_sf(double %p1, float %p2) #0 {
245entry:
246 %p1.addr = alloca double, align 8
247 %p2.addr = alloca float, align 4
248 store double %p1, double* %p1.addr, align 8
249 store float %p2, float* %p2.addr, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000250 %0 = load double, double* %p1.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +0000251 store double %0, double* @xd, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000252 %1 = load float, float* %p2.addr, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000253 store float %1, float* @y, align 4
David Blaikiea79ac142015-02-27 21:17:42 +0000254 %2 = load float, float* @ret_sf, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000255 ret float %2
256}
257
Daniel Sanders332cef62015-10-12 14:16:52 +0000258; stel: .section .mips16.fn.sf_df_sf,"ax",@progbits
259; stel: .ent __fn_stub_sf_df_sf
260; stel: la $25,sf_df_sf
261; stel: mfc1 $4,$f12
262; stel: mfc1 $5,$f13
263; stel: mfc1 $6,$f14
264; stel: jr $25
265; stel: __fn_local_sf_df_sf = sf_df_sf
266; stel: .end __fn_stub_sf_df_sf
Reed Kotler515e9372013-05-16 02:17:42 +0000267
268; Function Attrs: nounwind
269define float @sf_df_df(double %p1, double %p2) #0 {
270entry:
271 %p1.addr = alloca double, align 8
272 %p2.addr = alloca double, align 8
273 store double %p1, double* %p1.addr, align 8
274 store double %p2, double* %p2.addr, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000275 %0 = load double, double* %p1.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +0000276 store double %0, double* @xd, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000277 %1 = load double, double* %p2.addr, align 8
Reed Kotler515e9372013-05-16 02:17:42 +0000278 store double %1, double* @yd, align 8
David Blaikiea79ac142015-02-27 21:17:42 +0000279 %2 = load float, float* @ret_sf, align 4
Reed Kotler515e9372013-05-16 02:17:42 +0000280 ret float %2
281}
282
Daniel Sanders332cef62015-10-12 14:16:52 +0000283; stel: .section .mips16.fn.sf_df_df,"ax",@progbits
284; stel: .ent __fn_stub_sf_df_df
285; stel: la $25,sf_df_df
286; stel: mfc1 $4,$f12
287; stel: mfc1 $5,$f13
288; stel: mfc1 $6,$f14
289; stel: mfc1 $7,$f15
290; stel: jr $25
291; stel: __fn_local_sf_df_df = sf_df_df
292; stel: .end __fn_stub_sf_df_df
Reed Kotler515e9372013-05-16 02:17:42 +0000293
Bill Wendling187d3dd2013-08-22 21:28:54 +0000294attributes #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" }