Skip to content

Commit 0a74f88

Browse files
committed
[AArch64] Add tests. NFC.
1 parent 7d7d89d commit 0a74f88

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

llvm/test/CodeGen/AArch64/arm64-fmax-safe.ll

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,22 @@ define i64 @test_integer(i64 %in) {
5353
%val = select i1 %cmp, i64 0, i64 %in
5454
ret i64 %val
5555
}
56+
57+
; Make sure we don't translate it into fminnm when the nsz flag is set on the fcmp.
58+
define float @minnum_fcmp_nsz(float %x, float %y) {
59+
; CHECK-LABEL: minnum_fcmp_nsz:
60+
%cmp = fcmp nnan nsz ole float %x, %y
61+
%sel = select i1 %cmp, float %x, float %y
62+
ret float %sel
63+
; CHECK-NOT: fminnm
64+
; CHECK: fcsel s0, s0, s1, le
65+
}
66+
67+
; Make sure we translate it into fminnm when the nsz flag is set on the select.
68+
define float @minnum_select_nsz(float %x, float %y) {
69+
; CHECK-LABEL: minnum_select_nsz:
70+
%cmp = fcmp nnan ole float %x, %y
71+
%sel = select nsz i1 %cmp, float %x, float %y
72+
ret float %sel
73+
; CHECK: fminnm s0, s0, s1
74+
}

0 commit comments

Comments
 (0)