1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
| ; RUN: llc -march=mips64 -mcpu=mips64r2 -mattr=+soft-float -O2 < %s | FileCheck %s
define void @foosf() #0 {
entry:
%in = alloca float, align 4
%out = alloca float, align 4
store volatile float 0xBFD59E1380000000, float* %in, align 4
%in.0.in.0. = load volatile float, float* %in, align 4
%rintf = tail call float @rintf(float %in.0.in.0.) #1
store volatile float %rintf, float* %out, align 4
ret void
; CHECK-LABEL: foosf
; CHECK-NOT: dsll
; CHECK-NOT: dsrl
; CHECK-NOT: lwu
}
declare float @rintf(float)
define float @foosf1(float* nocapture readonly %a) #0 {
entry:
%0 = load float, float* %a, align 4
%call = tail call float @roundf(float %0) #2
ret float %call
; CHECK-LABEL: foosf1
; CHECK-NOT: dsll
; CHECK-NOT: dsrl
; CHECK-NOT: lwu
}
declare float @roundf(float) #1
define float @foosf2(float* nocapture readonly %a) #0 {
entry:
%0 = load float, float* %a, align 4
%call = tail call float @truncf(float %0) #2
ret float %call
; CHECK-LABEL: foosf2
; CHECK-NOT: dsll
; CHECK-NOT: dsrl
; CHECK-NOT: lwu
}
declare float @truncf(float) #1
define float @foosf3(float* nocapture readonly %a) #0 {
entry:
%0 = load float, float* %a, align 4
%call = tail call float @floorf(float %0) #2
ret float %call
; CHECK-LABEL: foosf3
; CHECK-NOT: dsll
; CHECK-NOT: dsrl
; CHECK-NOT: lwu
}
declare float @floorf(float) #1
define float @foosf4(float* nocapture readonly %a) #0 {
entry:
%0 = load float, float* %a, align 4
%call = tail call float @nearbyintf(float %0) #2
ret float %call
; CHECK-LABEL: foosf4
; CHECK-NOT: dsll
; CHECK-NOT: dsrl
; CHECK-NOT: lwu
}
declare float @nearbyintf(float) #1
define float @foosf5(float* nocapture readonly %a) #0 {
entry:
%0 = load float, float* %a, align 4
%mul = fmul float %0, undef
ret float %mul
; CHECK-LABEL: foosf5
; CHECK-NOT: dsll
; CHECK-NOT: dsrl
; CHECK-NOT: lwu
}
define float @foosf6(float* nocapture readonly %a) #0 {
entry:
%0 = load float, float* %a, align 4
%sub = fsub float %0, undef
ret float %sub
; CHECK-LABEL: foosf6
; CHECK-NOT: dsll
; CHECK-NOT: dsrl
; CHECK-NOT: lwu
}
define float @foosf7(float* nocapture readonly %a) #0 {
entry:
%0 = load float, float* %a, align 4
%add = fadd float %0, undef
ret float %add
; CHECK-LABEL: foosf7
; CHECK-NOT: dsll
; CHECK-NOT: dsrl
; CHECK-NOT: lwu
}
define float @foosf8(float* nocapture readonly %a) #0 {
entry:
%b = alloca float, align 4
%b.0.b.0. = load volatile float, float* %b, align 4
%0 = load float, float* %a, align 4
%div = fdiv float %b.0.b.0., %0
ret float %div
; CHECK-LABEL: foosf8
; CHECK-NOT: dsll
; CHECK-NOT: dsrl
; CHECK-NOT: lwu
}
define float @foosf9() #0 {
entry:
%b = alloca float, align 4
%b.0.b.0. = load volatile float, float* %b, align 4
%conv = fpext float %b.0.b.0. to double
%b.0.b.0.3 = load volatile float, float* %b, align 4
%conv1 = fpext float %b.0.b.0.3 to double
%call = tail call double @pow(double %conv, double %conv1) #1
%conv2 = fptrunc double %call to float
ret float %conv2
; CHECK-LABEL: foosf9
; CHECK-NOT: dsll
; CHECK-NOT: dsrl
; CHECK-NOT: lwu
}
declare double @pow(double, double) #0
define float @foosf10() #0 {
entry:
%a = alloca float, align 4
%a.0.a.0. = load volatile float, float* %a, align 4
%conv = fpext float %a.0.a.0. to double
%call = tail call double @sin(double %conv) #1
%conv1 = fptrunc double %call to float
ret float %conv1
; CHECK-LABEL: foosf10
; CHECK-NOT: dsll
; CHECK-NOT: dsrl
; CHECK-NOT: lwu
}
declare double @sin(double) #0
define float @foosf11() #0 {
entry:
%b = alloca float, align 4
%b.0.b.0. = load volatile float, float* %b, align 4
%call = tail call float @ceilf(float %b.0.b.0.) #2
ret float %call
; CHECK-LABEL: foosf11
; CHECK-NOT: dsll
; CHECK-NOT: dsrl
; CHECK-NOT: lwu
}
declare float @ceilf(float) #1
define float @foosf12() #0 {
entry:
%b = alloca float, align 4
%a = alloca float, align 4
%b.0.b.0. = load volatile float, float* %b, align 4
%a.0.a.0. = load volatile float, float* %a, align 4
%call = tail call float @fmaxf(float %b.0.b.0., float %a.0.a.0.) #2
ret float %call
; CHECK-LABEL: foosf12
; CHECK-NOT: dsll
; CHECK-NOT: dsrl
; CHECK-NOT: lwu
}
declare float @fmaxf(float, float) #1
define float @foosf13() #0 {
entry:
%b = alloca float, align 4
%a = alloca float, align 4
%b.0.b.0. = load volatile float, float* %b, align 4
%a.0.a.0. = load volatile float, float* %a, align 4
%call = tail call float @fminf(float %b.0.b.0., float %a.0.a.0.) #2
ret float %call
; CHECK-LABEL: foosf13
; CHECK-NOT: dsll
; CHECK-NOT: dsrl
; CHECK-NOT: lwu
}
declare float @fminf(float, float) #1
attributes #0 = { nounwind "use-soft-float"="true" }
attributes #1 = { nounwind readnone "use-soft-float"="true" }
|