Skip to content

Commit e6f85cb

Browse files
committed
Add aggregate tests with fmin
1 parent a37c8c7 commit e6f85cb

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed

llvm/test/CodeGen/AArch64/nofpclass.ll

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,28 @@ entry:
2121
ret <4 x float> %c
2222
}
2323

24-
define { float, float } @struct({ float, float } nofpclass(nan) %a) {
24+
define { float, float } @struct({ float, float} nofpclass(nan) %a) {
2525
; CHECK-LABEL: struct:
2626
; CHECK: // %bb.0:
2727
; CHECK-NEXT: ret
2828
ret {float, float} %a
2929
}
30+
31+
%struct.f2 = type { float, float }
32+
define %struct.f2 @m([2 x float] nofpclass(nan) %a0, [2 x float] nofpclass(nan) %a1) {
33+
; CHECK-LABEL: m:
34+
; CHECK: // %bb.0: // %entry
35+
; CHECK-NEXT: fmaxnm s1, s1, s3
36+
; CHECK-NEXT: fmaxnm s0, s0, s2
37+
; CHECK-NEXT: ret
38+
entry:
39+
%a0f0 = extractvalue [2 x float] %a0, 0
40+
%a0f1 = extractvalue [2 x float] %a0, 1
41+
%a1f0 = extractvalue [2 x float] %a1, 0
42+
%a1f1 = extractvalue [2 x float] %a1, 1
43+
%max0 = tail call float @llvm.maximumnum.f32(float %a0f0, float %a1f0)
44+
%max1 = tail call float @llvm.maximumnum.f32(float %a0f1, float %a1f1)
45+
%ret0 = insertvalue %struct.f2 poison, float %max0, 0
46+
%ret1 = insertvalue %struct.f2 %ret0, float %max1, 1
47+
ret %struct.f2 %ret1
48+
}

llvm/test/CodeGen/Mips/nofpclass.ll

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,45 @@ entry:
1616
%cond = tail call float @llvm.maximumnum.f32(float %a, float %b)
1717
ret float %cond
1818
}
19+
20+
define { float, float } @struct({ float, float} nofpclass(nan) %a) {
21+
; MIPS32R6-LABEL: struct:
22+
; MIPS32R6: # %bb.0:
23+
; MIPS32R6-NEXT: mov.s $f2, $f14
24+
; MIPS32R6-NEXT: jr $ra
25+
; MIPS32R6-NEXT: mov.s $f0, $f12
26+
;
27+
; MIPS64R6-LABEL: struct:
28+
; MIPS64R6: # %bb.0:
29+
; MIPS64R6-NEXT: mov.s $f2, $f13
30+
; MIPS64R6-NEXT: jr $ra
31+
; MIPS64R6-NEXT: mov.s $f0, $f12
32+
ret {float, float} %a
33+
}
34+
35+
%struct.f2 = type { float, float }
36+
define %struct.f2 @m([2 x float] nofpclass(nan) %a0, [2 x float] nofpclass(nan) %a1) {
37+
; MIPS32R6-LABEL: m:
38+
; MIPS32R6: # %bb.0: # %entry
39+
; MIPS32R6-NEXT: mtc1 $6, $f0
40+
; MIPS32R6-NEXT: max.s $f0, $f12, $f0
41+
; MIPS32R6-NEXT: mtc1 $7, $f1
42+
; MIPS32R6-NEXT: jr $ra
43+
; MIPS32R6-NEXT: max.s $f2, $f14, $f1
44+
;
45+
; MIPS64R6-LABEL: m:
46+
; MIPS64R6: # %bb.0: # %entry
47+
; MIPS64R6-NEXT: max.s $f0, $f12, $f14
48+
; MIPS64R6-NEXT: jr $ra
49+
; MIPS64R6-NEXT: max.s $f2, $f13, $f15
50+
entry:
51+
%a0f0 = extractvalue [2 x float] %a0, 0
52+
%a0f1 = extractvalue [2 x float] %a0, 1
53+
%a1f0 = extractvalue [2 x float] %a1, 0
54+
%a1f1 = extractvalue [2 x float] %a1, 1
55+
%max0 = tail call float @llvm.maximumnum.f32(float %a0f0, float %a1f0)
56+
%max1 = tail call float @llvm.maximumnum.f32(float %a0f1, float %a1f1)
57+
%ret0 = insertvalue %struct.f2 poison, float %max0, 0
58+
%ret1 = insertvalue %struct.f2 %ret0, float %max1, 1
59+
ret %struct.f2 %ret1
60+
}

0 commit comments

Comments
 (0)