From ba8ac74fd9b64be0d7eee91a73301cd10aac9be6 Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Wed, 24 Feb 2010 22:15:53 +0000 Subject: 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. llvm-svn: 97065 --- llvm/test/CodeGen/ARM/neon_minmax.ll | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'llvm/test/CodeGen/ARM/neon_minmax.ll') diff --git a/llvm/test/CodeGen/ARM/neon_minmax.ll b/llvm/test/CodeGen/ARM/neon_minmax.ll index 64349d650e9..d301c6a4ca9 100644 --- a/llvm/test/CodeGen/ARM/neon_minmax.ll +++ b/llvm/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 -- cgit v1.2.3