• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc  -march=mipsel -mcpu=mips32 -relocation-model=static -O3 < %s -mips-mixed-16-32  | FileCheck %s -check-prefix=32
2
3@x = global float 1.000000e+00, align 4
4@y = global float 0x4007333340000000, align 4
5@i = common global i32 0, align 4
6@f = common global float 0.000000e+00, align 4
7@.str = private unnamed_addr constant [8 x i8] c"f = %f\0A\00", align 1
8@.str1 = private unnamed_addr constant [11 x i8] c"hello %i \0A\00", align 1
9@.str2 = private unnamed_addr constant [13 x i8] c"goodbye %i \0A\00", align 1
10
11define void @foo() #0 {
12entry:
13  store i32 10, i32* @i, align 4
14  ret void
15}
16
17; 32: 	.set	mips16
18; 32: 	.ent	foo
19; 32:	jrc $ra
20; 32:	.end	foo
21
22define void @nofoo() #1 {
23entry:
24  store i32 20, i32* @i, align 4
25  %0 = load float, float* @x, align 4
26  %1 = load float, float* @y, align 4
27  %add = fadd float %0, %1
28  store float %add, float* @f, align 4
29  %2 = load float, float* @f, align 4
30  %conv = fpext float %2 to double
31  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), double %conv)
32  ret void
33}
34
35; 32: 	.set	nomips16
36; 32: 	.ent	nofoo
37; 32:	.set	noreorder
38; 32:	.set	nomacro
39; 32:	.set	noat
40; 32:	add.s	{{.+}}
41; 32:	mfc1    {{.+}}
42; 32:	.set	at
43; 32:	.set	macro
44; 32:	.set	reorder
45; 32:	.end	nofoo
46declare i32 @printf(i8*, ...) #2
47
48define i32 @main() #3 {
49entry:
50  call void @foo()
51  %0 = load i32, i32* @i, align 4
52  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str1, i32 0, i32 0), i32 %0)
53  call void @nofoo()
54  %1 = load i32, i32* @i, align 4
55  %call1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str2, i32 0, i32 0), i32 %1)
56  ret i32 0
57}
58
59; 32: 	.set	nomips16
60; 32: 	.ent	main
61; 32:	.set	noreorder
62; 32:	.set	nomacro
63; 32:	.set	noat
64; 32:	jr	$ra
65; 32:	.set	at
66; 32:	.set	macro
67; 32:	.set	reorder
68; 32:	.end	main
69
70attributes #0 = { nounwind "less-precise-fpmad"="false" "mips16" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
71attributes #1 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "nomips16" "unsafe-fp-math"="false" "use-soft-float"="false" }
72attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
73attributes #3 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
74