summaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM/neon_minmax.ll
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-02-24 22:15:53 +0000
committerBob Wilson <bob.wilson@apple.com>2010-02-24 22:15:53 +0000
commite742bb53a3e68b88eac172782fd99cd98f89f4b3 (patch)
tree342764506253708aa7d8f7df8daaab52cc0d1fb7 /test/CodeGen/ARM/neon_minmax.ll
parentc382bc3c0f476bf94303d9892af4e2cee173bfe5 (diff)
Check for comparisons of +/- zero when optimizing less-than-or-equal and
greater-than-or-equal SELECT_CCs to NEON vmin/vmax instructions. This is only allowed when UnsafeFPMath is set or when at least one of the operands is known to be nonzero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97065 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/neon_minmax.ll')
-rw-r--r--test/CodeGen/ARM/neon_minmax.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/neon_minmax.ll b/test/CodeGen/ARM/neon_minmax.ll
index 64349d650e9..d301c6a4ca9 100644
--- a/test/CodeGen/ARM/neon_minmax.ll
+++ b/test/CodeGen/ARM/neon_minmax.ll
@@ -8,6 +8,14 @@ define float @fmin_ole(float %x) nounwind {
ret float %min1
}
+define float @fmin_ole_zero(float %x) nounwind {
+;CHECK: fmin_ole_zero:
+;CHECK-NOT: vmin.f32
+ %cond = fcmp ole float 0.0, %x
+ %min1 = select i1 %cond, float 0.0, float %x
+ ret float %min1
+}
+
define float @fmin_ult(float %x) nounwind {
;CHECK: fmin_ult:
;CHECK: vmin.f32
@@ -32,6 +40,14 @@ define float @fmax_uge(float %x) nounwind {
ret float %max1
}
+define float @fmax_uge_zero(float %x) nounwind {
+;CHECK: fmax_uge_zero:
+;CHECK-NOT: vmax.f32
+ %cond = fcmp uge float %x, 0.0
+ %max1 = select i1 %cond, float %x, float 0.0
+ ret float %max1
+}
+
define float @fmax_olt_reverse(float %x) nounwind {
;CHECK: fmax_olt_reverse:
;CHECK: vmax.f32