1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/CodeGen/ARM/vsel.ll
Kristof Beyls 8957a377cc [ARM] Generate vcmp instead of vcmpe
Based on the discussion in
http://lists.llvm.org/pipermail/llvm-dev/2019-October/135574.html, the
conclusion was reached that the ARM backend should produce vcmp instead
of vcmpe instructions by default, i.e. not be producing an Invalid
Operation exception when either arguments in a floating point compare
are quiet NaNs.

In the future, after constrained floating point intrinsics for floating
point compare have been introduced, vcmpe instructions probably should
be produced for those intrinsics - depending on the exact semantics
they'll be defined to have.

This patch logically consists of the following parts:
- Revert http://llvm.org/viewvc/llvm-project?rev=294945&view=rev and
  http://llvm.org/viewvc/llvm-project?rev=294968&view=rev, which
  implemented fine-tuning for when to produce vcmpe (i.e. not do it for
  equality comparisons). The complexity introduced by those patches
  isn't needed anymore if we just always produce vcmp instead. Maybe
  these patches need to be reintroduced again once support is needed to
  map potential LLVM-IR constrained floating point compare intrinsics to
  the ARM instruction set.
- Simply select vcmp, instead of vcmpe, see simple changes in
  lib/Target/ARM/ARMInstrVFP.td
- Adapt lots of tests that tested for vcmpe (instead of vcmp). For all
  of these test, the intent of what is tested for isn't related to
  whether the vcmp should produce an Invalid Operation exception or not.

Fixes PR43374.

Differential Revision: https://reviews.llvm.org/D68463

llvm-svn: 374025
2019-10-08 08:25:42 +00:00

607 lines
20 KiB
LLVM

; RUN: llc < %s -mtriple=armv8-linux-gnueabihf -mattr=+fp-armv8 -float-abi=hard | FileCheck %s
@varfloat = global float 0.0
@vardouble = global double 0.0
define void @test_vsel32sgt(i32 %lhs32, i32 %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32sgt
%tst1 = icmp sgt i32 %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: cmp r0, r1
; CHECK: vselgt.f32 s0, s0, s1
ret void
}
define void @test_vsel64sgt(i32 %lhs32, i32 %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64sgt
%tst1 = icmp sgt i32 %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: cmp r0, r1
; CHECK: vselgt.f64 d16, d0, d1
ret void
}
define void @test_vsel32sge(i32 %lhs32, i32 %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32sge
%tst1 = icmp sge i32 %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: cmp r0, r1
; CHECK: vselge.f32 s0, s0, s1
ret void
}
define void @test_vsel64sge(i32 %lhs32, i32 %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64sge
%tst1 = icmp sge i32 %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: cmp r0, r1
; CHECK: vselge.f64 d16, d0, d1
ret void
}
define void @test_vsel32eq(i32 %lhs32, i32 %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32eq
%tst1 = icmp eq i32 %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: cmp r0, r1
; CHECK: vseleq.f32 s0, s0, s1
ret void
}
define void @test_vsel64eq(i32 %lhs32, i32 %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64eq
%tst1 = icmp eq i32 %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: cmp r0, r1
; CHECK: vseleq.f64 d16, d0, d1
ret void
}
define void @test_vsel32slt(i32 %lhs32, i32 %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32slt
%tst1 = icmp slt i32 %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: cmp r0, r1
; CHECK: vselge.f32 s0, s1, s0
ret void
}
define void @test_vsel64slt(i32 %lhs32, i32 %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64slt
%tst1 = icmp slt i32 %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: cmp r0, r1
; CHECK: vselge.f64 d16, d1, d0
ret void
}
define void @test_vsel32sle(i32 %lhs32, i32 %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32sle
%tst1 = icmp sle i32 %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: cmp r0, r1
; CHECK: vselgt.f32 s0, s1, s0
ret void
}
define void @test_vsel64sle(i32 %lhs32, i32 %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64sle
%tst1 = icmp sle i32 %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: cmp r0, r1
; CHECK: vselgt.f64 d16, d1, d0
ret void
}
define void @test_vsel32ogt(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32ogt
%tst1 = fcmp ogt float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s0, s1
; CHECK: vselgt.f32 s0, s2, s3
ret void
}
define void @test_vsel64ogt(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64ogt
%tst1 = fcmp ogt float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s0, s1
; CHECK: vselgt.f64 d16, d1, d2
ret void
}
define void @test_vsel32oge(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32oge
%tst1 = fcmp oge float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s0, s1
; CHECK: vselge.f32 s0, s2, s3
ret void
}
define void @test_vsel64oge(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64oge
%tst1 = fcmp oge float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s0, s1
; CHECK: vselge.f64 d16, d1, d2
ret void
}
define void @test_vsel32oeq(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32oeq
%tst1 = fcmp oeq float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s0, s1
; CHECK: vseleq.f32 s0, s2, s3
ret void
}
define void @test_vsel64oeq(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64oeq
%tst1 = fcmp oeq float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s0, s1
; CHECK: vseleq.f64 d16, d1, d2
ret void
}
define void @test_vsel32ugt(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32ugt
%tst1 = fcmp ugt float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s1, s0
; CHECK: vselge.f32 s0, s3, s2
ret void
}
define void @test_vsel64ugt(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64ugt
%tst1 = fcmp ugt float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s1, s0
; CHECK: vselge.f64 d16, d2, d1
ret void
}
define void @test_vsel32uge(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32uge
%tst1 = fcmp uge float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s1, s0
; CHECK: vselgt.f32 s0, s3, s2
ret void
}
define void @test_vsel64uge(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64uge
%tst1 = fcmp uge float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s1, s0
; CHECK: vselgt.f64 d16, d2, d1
ret void
}
define void @test_vsel32olt(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32olt
%tst1 = fcmp olt float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s1, s0
; CHECK: vselgt.f32 s0, s2, s3
ret void
}
define void @test_vsel64olt(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64olt
%tst1 = fcmp olt float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s1, s0
; CHECK: vselgt.f64 d16, d1, d2
ret void
}
define void @test_vsel32ult(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32ult
%tst1 = fcmp ult float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s0, s1
; CHECK: vselge.f32 s0, s3, s2
ret void
}
define void @test_vsel64ult(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64ult
%tst1 = fcmp ult float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s0, s1
; CHECK: vselge.f64 d16, d2, d1
ret void
}
define void @test_vsel32ole(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32ole
%tst1 = fcmp ole float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s1, s0
; CHECK: vselge.f32 s0, s2, s3
ret void
}
define void @test_vsel64ole(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64ole
%tst1 = fcmp ole float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s1, s0
; CHECK: vselge.f64 d16, d1, d2
ret void
}
define void @test_vsel32ule(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32ule
%tst1 = fcmp ule float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s0, s1
; CHECK: vselgt.f32 s0, s3, s2
ret void
}
define void @test_vsel64ule(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64ule
%tst1 = fcmp ule float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s0, s1
; CHECK: vselgt.f64 d16, d2, d1
ret void
}
define void @test_vsel32ord(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32ord
%tst1 = fcmp ord float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s0, s1
; CHECK: vselvs.f32 s0, s3, s2
ret void
}
define void @test_vsel64ord(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64ord
%tst1 = fcmp ord float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s0, s1
; CHECK: vselvs.f64 d16, d2, d1
ret void
}
define void @test_vsel32une(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32une
%tst1 = fcmp une float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s0, s1
; CHECK: vseleq.f32 s0, s3, s2
ret void
}
define void @test_vsel64une(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64une
%tst1 = fcmp une float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s0, s1
; CHECK: vseleq.f64 d16, d2, d1
ret void
}
define void @test_vsel32uno(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32uno
%tst1 = fcmp uno float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s0, s1
; CHECK: vselvs.f32 s0, s2, s3
ret void
}
define void @test_vsel64uno(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64uno
%tst1 = fcmp uno float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s0, s1
; CHECK: vselvs.f64 d16, d1, d2
ret void
}
define void @test_vsel32ogt_nnan(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32ogt_nnan
%tst1 = fcmp nnan ogt float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s0, s1
; CHECK: vselgt.f32 s0, s2, s3
ret void
}
define void @test_vsel64ogt_nnan(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64ogt_nnan
%tst1 = fcmp nnan ogt float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s0, s1
; CHECK: vselgt.f64 d16, d1, d2
ret void
}
define void @test_vsel32oge_nnan(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32oge_nnan
%tst1 = fcmp nnan oge float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s0, s1
; CHECK: vselge.f32 s0, s2, s3
ret void
}
define void @test_vsel64oge_nnan(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64oge_nnan
%tst1 = fcmp nnan oge float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s0, s1
; CHECK: vselge.f64 d16, d1, d2
ret void
}
define void @test_vsel32oeq_nnan(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32oeq_nnan
%tst1 = fcmp nnan oeq float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s0, s1
; CHECK: vseleq.f32 s0, s2, s3
ret void
}
define void @test_vsel64oeq_nnan(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64oeq_nnan
%tst1 = fcmp nnan oeq float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s0, s1
; CHECK: vseleq.f64 d16, d1, d2
ret void
}
define void @test_vsel32ugt_nnan(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32ugt_nnan
%tst1 = fcmp nnan ugt float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s0, s1
; CHECK: vselgt.f32 s0, s2, s3
ret void
}
define void @test_vsel64ugt_nnan(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64ugt_nnan
%tst1 = fcmp nnan ugt float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s0, s1
; CHECK: vselgt.f64 d16, d1, d2
ret void
}
define void @test_vsel32uge_nnan(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32uge_nnan
%tst1 = fcmp nnan uge float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s0, s1
; CHECK: vselge.f32 s0, s2, s3
ret void
}
define void @test_vsel64uge_nnan(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64uge_nnan
%tst1 = fcmp nnan uge float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s0, s1
; CHECK: vselge.f64 d16, d1, d2
ret void
}
define void @test_vsel32olt_nnan(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32olt_nnan
%tst1 = fcmp nnan olt float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s1, s0
; CHECK: vselgt.f32 s0, s2, s3
ret void
}
define void @test_vsel64olt_nnan(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64olt_nnan
%tst1 = fcmp nnan olt float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s1, s0
; CHECK: vselgt.f64 d16, d1, d2
ret void
}
define void @test_vsel32ult_nnan(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32ult_nnan
%tst1 = fcmp nnan ult float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s1, s0
; CHECK: vselgt.f32 s0, s2, s3
ret void
}
define void @test_vsel64ult_nnan(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64ult_nnan
%tst1 = fcmp nnan ult float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s1, s0
; CHECK: vselgt.f64 d16, d1, d2
ret void
}
define void @test_vsel32ole_nnan(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32ole_nnan
%tst1 = fcmp nnan ole float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s1, s0
; CHECK: vselge.f32 s0, s2, s3
ret void
}
define void @test_vsel64ole_nnan(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64ole_nnan
%tst1 = fcmp nnan ole float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s1, s0
; CHECK: vselge.f64 d16, d1, d2
ret void
}
define void @test_vsel32ule_nnan(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32ule_nnan
%tst1 = fcmp nnan ule float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s1, s0
; CHECK: vselge.f32 s0, s2, s3
ret void
}
define void @test_vsel64ule_nnan(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64ule_nnan
%tst1 = fcmp nnan ule float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s1, s0
; CHECK: vselge.f64 d16, d1, d2
ret void
}
define void @test_vsel32ord_nnan(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32ord_nnan
%tst1 = fcmp nnan ord float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s0, s1
; CHECK: vselvs.f32 s0, s3, s2
ret void
}
define void @test_vsel64ord_nnan(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64ord_nnan
%tst1 = fcmp nnan ord float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s0, s1
; CHECK: vselvs.f64 d16, d2, d1
ret void
}
define void @test_vsel32une_nnan(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32une_nnan
%tst1 = fcmp nnan une float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s0, s1
; CHECK: vseleq.f32 s0, s3, s2
ret void
}
define void @test_vsel64une_nnan(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64une_nnan
%tst1 = fcmp nnan une float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s0, s1
; CHECK: vseleq.f64 d16, d2, d1
ret void
}
define void @test_vsel32uno_nnan(float %lhs32, float %rhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel32uno_nnan
%tst1 = fcmp nnan uno float %lhs32, %rhs32
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: vcmp.f32 s0, s1
; CHECK: vselvs.f32 s0, s2, s3
ret void
}
define void @test_vsel64uno_nnan(float %lhs32, float %rhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel64uno_nnan
%tst1 = fcmp nnan uno float %lhs32, %rhs32
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: vcmp.f32 s0, s1
; CHECK: vselvs.f64 d16, d1, d2
ret void
}
define void @test_vsel_ltzero(i32 %lhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel_ltzero
%tst1 = icmp slt i32 %lhs32, 0
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: cmp r0, #0
; CHECK: vselge.f32 s0, s1, s0
ret void
}
define void @test_vsel_lezero(i32 %lhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel_lezero
%tst1 = icmp sle i32 %lhs32, 0
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: cmp r0, #1
; CHECK: vselge.f32 s0, s1, s0
ret void
}
define void @test_vsel_gtzero(i32 %lhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel_gtzero
%tst1 = icmp sgt i32 %lhs32, 0
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: cmp r0, #0
; CHECK: vselgt.f32 s0, s0, s1
ret void
}
define void @test_vsel_gezero(i32 %lhs32, float %a, float %b) {
; CHECK-LABEL: test_vsel_gezero
%tst1 = icmp sge i32 %lhs32, 0
%val1 = select i1 %tst1, float %a, float %b
store float %val1, float* @varfloat
; CHECK: cmn r0, #1
; CHECK: vselgt.f32 s0, s0, s1
ret void
}
define void @test_vsel_ltzero64(i32 %lhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel_ltzero
%tst1 = icmp slt i32 %lhs32, 0
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: cmp r0, #0
; CHECK: vselge.f64 d16, d1, d0
ret void
}
define void @test_vsel_lezero64(i32 %lhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel_lezero
%tst1 = icmp sle i32 %lhs32, 0
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: cmp r0, #1
; CHECK: vselge.f64 d16, d1, d0
ret void
}
define void @test_vsel_gtzero64(i32 %lhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel_gtzero
%tst1 = icmp sgt i32 %lhs32, 0
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: cmp r0, #0
; CHECK: vselgt.f64 d16, d0, d1
ret void
}
define void @test_vsel_gezero64(i32 %lhs32, double %a, double %b) {
; CHECK-LABEL: test_vsel_gezero
%tst1 = icmp sge i32 %lhs32, 0
%val1 = select i1 %tst1, double %a, double %b
store double %val1, double* @vardouble
; CHECK: cmn r0, #1
; CHECK: vselgt.f64 d16, d0, d1
ret void
}