2
2
; RUN: llc --mtriple=mipsisa32r6-linux-gnu < %s | FileCheck %s --check-prefix=MIPS32R6
3
3
; RUN: llc --mtriple=mipsisa64r6-linux-gnu < %s | FileCheck %s --check-prefix=MIPS64R6
4
4
5
- %struct.f2 = type { float , float }
6
-
7
-
8
5
define float @f (float nofpclass(nan) %a , float nofpclass(nan) %b ) {
9
6
; MIPS32R6-LABEL: f:
10
7
; MIPS32R6: # %bb.0: # %entry
@@ -20,31 +17,42 @@ entry:
20
17
ret float %cond
21
18
}
22
19
23
- define { float , float } @struct ({ float , float } nofpclass(nan) %a ) {
24
- ; MIPS32R6-LABEL: struct:
25
- ; MIPS32R6: # %bb.0:
26
- ; MIPS32R6-NEXT: mov.s $f2, $f14
20
+ define {float , float } @m ({float , float } nofpclass(nan) %a0 , {float , float } nofpclass(nan) %a1 ) {
21
+ ; MIPS32R6-LABEL: m:
22
+ ; MIPS32R6: # %bb.0: # %entry
23
+ ; MIPS32R6-NEXT: mtc1 $6, $f0
24
+ ; MIPS32R6-NEXT: max.s $f0, $f12, $f0
25
+ ; MIPS32R6-NEXT: mtc1 $7, $f1
27
26
; MIPS32R6-NEXT: jr $ra
28
- ; MIPS32R6-NEXT: mov .s $f0 , $f12
27
+ ; MIPS32R6-NEXT: max .s $f2 , $f14, $f1
29
28
;
30
- ; MIPS64R6-LABEL: struct :
31
- ; MIPS64R6: # %bb.0:
32
- ; MIPS64R6-NEXT: mov .s $f2 , $f13
29
+ ; MIPS64R6-LABEL: m :
30
+ ; MIPS64R6: # %bb.0: # %entry
31
+ ; MIPS64R6-NEXT: max .s $f0 , $f12, $f14
33
32
; MIPS64R6-NEXT: jr $ra
34
- ; MIPS64R6-NEXT: mov.s $f0, $f12
35
- ret {float , float } %a
33
+ ; MIPS64R6-NEXT: max.s $f2, $f13, $f15
34
+ entry:
35
+ %a0f0 = extractvalue {float , float } %a0 , 0
36
+ %a0f1 = extractvalue {float , float } %a0 , 1
37
+ %a1f0 = extractvalue {float , float } %a1 , 0
38
+ %a1f1 = extractvalue {float , float } %a1 , 1
39
+ %max0 = tail call float @llvm.maximumnum.f32 (float %a0f0 , float %a1f0 )
40
+ %max1 = tail call float @llvm.maximumnum.f32 (float %a0f1 , float %a1f1 )
41
+ %ret0 = insertvalue {float , float } poison, float %max0 , 0
42
+ %ret1 = insertvalue {float , float } %ret0 , float %max1 , 1
43
+ ret {float , float } %ret1
36
44
}
37
45
38
- define %struct.f2 @m ([2 x float ] nofpclass(nan) %a0 , [2 x float ] nofpclass(nan) %a1 ) {
39
- ; MIPS32R6-LABEL: m :
46
+ define [ 2 x float ] @mA ([2 x float ] nofpclass(nan) %a0 , [2 x float ] nofpclass(nan) %a1 ) {
47
+ ; MIPS32R6-LABEL: mA :
40
48
; MIPS32R6: # %bb.0: # %entry
41
49
; MIPS32R6-NEXT: mtc1 $6, $f0
42
50
; MIPS32R6-NEXT: max.s $f0, $f12, $f0
43
51
; MIPS32R6-NEXT: mtc1 $7, $f1
44
52
; MIPS32R6-NEXT: jr $ra
45
53
; MIPS32R6-NEXT: max.s $f2, $f14, $f1
46
54
;
47
- ; MIPS64R6-LABEL: m :
55
+ ; MIPS64R6-LABEL: mA :
48
56
; MIPS64R6: # %bb.0: # %entry
49
57
; MIPS64R6-NEXT: max.s $f0, $f12, $f14
50
58
; MIPS64R6-NEXT: jr $ra
56
64
%a1f1 = extractvalue [2 x float ] %a1 , 1
57
65
%max0 = tail call float @llvm.maximumnum.f32 (float %a0f0 , float %a1f0 )
58
66
%max1 = tail call float @llvm.maximumnum.f32 (float %a0f1 , float %a1f1 )
59
- %ret0 = insertvalue %struct.f2 poison, float %max0 , 0
60
- %ret1 = insertvalue %struct.f2 %ret0 , float %max1 , 1
61
- ret %struct.f2 %ret1
67
+ %ret0 = insertvalue [ 2 x float ] poison, float %max0 , 0
68
+ %ret1 = insertvalue [ 2 x float ] %ret0 , float %max1 , 1
69
+ ret [ 2 x float ] %ret1
62
70
}
63
71
64
72
define float @fS (float nofpclass(snan) %a , float nofpclass(snan) %b ) {
@@ -76,31 +84,42 @@ entry:
76
84
ret float %cond
77
85
}
78
86
79
- define { float , float } @structS ({ float , float } nofpclass(snan) %a ) {
80
- ; MIPS32R6-LABEL: structS:
81
- ; MIPS32R6: # %bb.0:
82
- ; MIPS32R6-NEXT: mov.s $f2, $f14
87
+ define {float , float } @mS ({float , float } nofpclass(snan) %a0 , {float , float } nofpclass(snan) %a1 ) {
88
+ ; MIPS32R6-LABEL: mS:
89
+ ; MIPS32R6: # %bb.0: # %entry
90
+ ; MIPS32R6-NEXT: mtc1 $6, $f0
91
+ ; MIPS32R6-NEXT: max.s $f0, $f12, $f0
92
+ ; MIPS32R6-NEXT: mtc1 $7, $f1
83
93
; MIPS32R6-NEXT: jr $ra
84
- ; MIPS32R6-NEXT: mov .s $f0 , $f12
94
+ ; MIPS32R6-NEXT: max .s $f2 , $f14, $f1
85
95
;
86
- ; MIPS64R6-LABEL: structS :
87
- ; MIPS64R6: # %bb.0:
88
- ; MIPS64R6-NEXT: mov .s $f2 , $f13
96
+ ; MIPS64R6-LABEL: mS :
97
+ ; MIPS64R6: # %bb.0: # %entry
98
+ ; MIPS64R6-NEXT: max .s $f0 , $f12, $f14
89
99
; MIPS64R6-NEXT: jr $ra
90
- ; MIPS64R6-NEXT: mov.s $f0, $f12
91
- ret {float , float } %a
100
+ ; MIPS64R6-NEXT: max.s $f2, $f13, $f15
101
+ entry:
102
+ %a0f0 = extractvalue {float , float } %a0 , 0
103
+ %a0f1 = extractvalue {float , float } %a0 , 1
104
+ %a1f0 = extractvalue {float , float } %a1 , 0
105
+ %a1f1 = extractvalue {float , float } %a1 , 1
106
+ %max0 = tail call float @llvm.maximumnum.f32 (float %a0f0 , float %a1f0 )
107
+ %max1 = tail call float @llvm.maximumnum.f32 (float %a0f1 , float %a1f1 )
108
+ %ret0 = insertvalue {float , float } poison, float %max0 , 0
109
+ %ret1 = insertvalue {float , float } %ret0 , float %max1 , 1
110
+ ret {float , float } %ret1
92
111
}
93
112
94
- define %struct.f2 @mS ([2 x float ] nofpclass(snan) %a0 , [2 x float ] nofpclass(snan) %a1 ) {
95
- ; MIPS32R6-LABEL: mS :
113
+ define [ 2 x float ] @mAS ([2 x float ] nofpclass(snan) %a0 , [2 x float ] nofpclass(snan) %a1 ) {
114
+ ; MIPS32R6-LABEL: mAS :
96
115
; MIPS32R6: # %bb.0: # %entry
97
116
; MIPS32R6-NEXT: mtc1 $6, $f0
98
117
; MIPS32R6-NEXT: max.s $f0, $f12, $f0
99
118
; MIPS32R6-NEXT: mtc1 $7, $f1
100
119
; MIPS32R6-NEXT: jr $ra
101
120
; MIPS32R6-NEXT: max.s $f2, $f14, $f1
102
121
;
103
- ; MIPS64R6-LABEL: mS :
122
+ ; MIPS64R6-LABEL: mAS :
104
123
; MIPS64R6: # %bb.0: # %entry
105
124
; MIPS64R6-NEXT: max.s $f0, $f12, $f14
106
125
; MIPS64R6-NEXT: jr $ra
@@ -112,9 +131,9 @@ entry:
112
131
%a1f1 = extractvalue [2 x float ] %a1 , 1
113
132
%max0 = tail call float @llvm.maximumnum.f32 (float %a0f0 , float %a1f0 )
114
133
%max1 = tail call float @llvm.maximumnum.f32 (float %a0f1 , float %a1f1 )
115
- %ret0 = insertvalue %struct.f2 poison, float %max0 , 0
116
- %ret1 = insertvalue %struct.f2 %ret0 , float %max1 , 1
117
- ret %struct.f2 %ret1
134
+ %ret0 = insertvalue [ 2 x float ] poison, float %max0 , 0
135
+ %ret1 = insertvalue [ 2 x float ] %ret0 , float %max1 , 1
136
+ ret [ 2 x float ] %ret1
118
137
}
119
138
120
139
define float @fQ (float nofpclass(qnan) %a , float nofpclass(qnan) %b ) {
@@ -136,23 +155,42 @@ entry:
136
155
ret float %cond
137
156
}
138
157
139
- define { float , float } @structQ ({ float , float } nofpclass(qnan) %a ) {
140
- ; MIPS32R6-LABEL: structQ:
141
- ; MIPS32R6: # %bb.0:
142
- ; MIPS32R6-NEXT: mov.s $f2, $f14
158
+ define {float , float } @mQ ({float , float } nofpclass(qnan) %a0 , {float , float } nofpclass(qnan) %a1 ) {
159
+ ; MIPS32R6-LABEL: mQ:
160
+ ; MIPS32R6: # %bb.0: # %entry
161
+ ; MIPS32R6-NEXT: min.s $f0, $f12, $f12
162
+ ; MIPS32R6-NEXT: mtc1 $6, $f1
163
+ ; MIPS32R6-NEXT: min.s $f1, $f1, $f1
164
+ ; MIPS32R6-NEXT: max.s $f0, $f0, $f1
165
+ ; MIPS32R6-NEXT: min.s $f1, $f14, $f14
166
+ ; MIPS32R6-NEXT: mtc1 $7, $f2
167
+ ; MIPS32R6-NEXT: min.s $f2, $f2, $f2
143
168
; MIPS32R6-NEXT: jr $ra
144
- ; MIPS32R6-NEXT: mov .s $f0 , $f12
169
+ ; MIPS32R6-NEXT: max .s $f2 , $f1, $f2
145
170
;
146
- ; MIPS64R6-LABEL: structQ:
147
- ; MIPS64R6: # %bb.0:
148
- ; MIPS64R6-NEXT: mov.s $f2, $f13
171
+ ; MIPS64R6-LABEL: mQ:
172
+ ; MIPS64R6: # %bb.0: # %entry
173
+ ; MIPS64R6-NEXT: min.s $f0, $f14, $f14
174
+ ; MIPS64R6-NEXT: min.s $f1, $f12, $f12
175
+ ; MIPS64R6-NEXT: max.s $f0, $f1, $f0
176
+ ; MIPS64R6-NEXT: min.s $f1, $f15, $f15
177
+ ; MIPS64R6-NEXT: min.s $f2, $f13, $f13
149
178
; MIPS64R6-NEXT: jr $ra
150
- ; MIPS64R6-NEXT: mov.s $f0, $f12
151
- ret {float , float } %a
179
+ ; MIPS64R6-NEXT: max.s $f2, $f2, $f1
180
+ entry:
181
+ %a0f0 = extractvalue {float , float } %a0 , 0
182
+ %a0f1 = extractvalue {float , float } %a0 , 1
183
+ %a1f0 = extractvalue {float , float } %a1 , 0
184
+ %a1f1 = extractvalue {float , float } %a1 , 1
185
+ %max0 = tail call float @llvm.maximumnum.f32 (float %a0f0 , float %a1f0 )
186
+ %max1 = tail call float @llvm.maximumnum.f32 (float %a0f1 , float %a1f1 )
187
+ %ret0 = insertvalue {float , float } poison, float %max0 , 0
188
+ %ret1 = insertvalue {float , float } %ret0 , float %max1 , 1
189
+ ret {float , float } %ret1
152
190
}
153
191
154
- define %struct.f2 @mQ ([2 x float ] nofpclass(qnan) %a0 , [2 x float ] nofpclass(qnan) %a1 ) {
155
- ; MIPS32R6-LABEL: mQ :
192
+ define [ 2 x float ] @mAQ ([2 x float ] nofpclass(qnan) %a0 , [2 x float ] nofpclass(qnan) %a1 ) {
193
+ ; MIPS32R6-LABEL: mAQ :
156
194
; MIPS32R6: # %bb.0: # %entry
157
195
; MIPS32R6-NEXT: min.s $f0, $f12, $f12
158
196
; MIPS32R6-NEXT: mtc1 $6, $f1
@@ -164,7 +202,7 @@ define %struct.f2 @mQ([2 x float] nofpclass(qnan) %a0, [2 x float] nofpclass(qna
164
202
; MIPS32R6-NEXT: jr $ra
165
203
; MIPS32R6-NEXT: max.s $f2, $f1, $f2
166
204
;
167
- ; MIPS64R6-LABEL: mQ :
205
+ ; MIPS64R6-LABEL: mAQ :
168
206
; MIPS64R6: # %bb.0: # %entry
169
207
; MIPS64R6-NEXT: min.s $f0, $f14, $f14
170
208
; MIPS64R6-NEXT: min.s $f1, $f12, $f12
@@ -180,7 +218,7 @@ entry:
180
218
%a1f1 = extractvalue [2 x float ] %a1 , 1
181
219
%max0 = tail call float @llvm.maximumnum.f32 (float %a0f0 , float %a1f0 )
182
220
%max1 = tail call float @llvm.maximumnum.f32 (float %a0f1 , float %a1f1 )
183
- %ret0 = insertvalue %struct.f2 poison, float %max0 , 0
184
- %ret1 = insertvalue %struct.f2 %ret0 , float %max1 , 1
185
- ret %struct.f2 %ret1
221
+ %ret0 = insertvalue [ 2 x float ] poison, float %max0 , 0
222
+ %ret1 = insertvalue [ 2 x float ] %ret0 , float %max1 , 1
223
+ ret [ 2 x float ] %ret1
186
224
}
0 commit comments