summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorJoey Gouly <joey.gouly@arm.com>2013-08-23 12:01:13 +0000
committerJoey Gouly <joey.gouly@arm.com>2013-08-23 12:01:13 +0000
commite3dd684aadcaba6993e0d91734cc4cc62ff4de87 (patch)
tree25a5ac9388aa8de9ac73aabe2bc32d18b756fcb8 /llvm/test/CodeGen
parentf438cb761945d49111ed96fc3a25cc8e5da722a0 (diff)
downloadbcm5719-llvm-e3dd684aadcaba6993e0d91734cc4cc62ff4de87.tar.gz
bcm5719-llvm-e3dd684aadcaba6993e0d91734cc4cc62ff4de87.zip
[ARMv8] Add CodeGen for VMAXNM/VMINNM.
llvm-svn: 189103
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/ARM/vminmaxnm.ll46
1 files changed, 46 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/vminmaxnm.ll b/llvm/test/CodeGen/ARM/vminmaxnm.ll
index afa73b9e9c0..fdf0c6a7627 100644
--- a/llvm/test/CodeGen/ARM/vminmaxnm.ll
+++ b/llvm/test/CodeGen/ARM/vminmaxnm.ll
@@ -1,4 +1,5 @@
; RUN: llc < %s -mtriple armv8 -mattr=+neon | FileCheck %s
+; RUN: llc < %s -mtriple armv8 -mattr=+neon,+v8fp -enable-unsafe-fp-math | FileCheck %s --check-prefix=CHECK-FAST
define <4 x float> @vmaxnmq(<4 x float>* %A, <4 x float>* %B) nounwind {
; CHECK: vmaxnmq
@@ -36,6 +37,51 @@ define <2 x float> @vminnmd(<2 x float>* %A, <2 x float>* %B) nounwind {
ret <2 x float> %tmp3
}
+define float @v8fp_vminnm_o(float %a, float %b) {
+; CHECK-FAST: v8fp_vminnm_o
+; CHECK-FAST-NOT: vcmp
+; CHECK-FAST: vminnm.f32
+; CHECK: v8fp_vminnm_o
+; CHECK-NOT: vminnm.f32
+ %cmp = fcmp olt float %a, %b
+ %cond = select i1 %cmp, float %a, float %b
+ ret float %cond
+}
+
+define float @v8fp_vminnm_u(float %a, float %b) {
+; CHECK-FAST: v8fp_vminnm_u
+; CHECK-FAST-NOT: vcmp
+; CHECK-FAST: vminnm.f32
+; CHECK: v8fp_vminnm_u
+; CHECK-NOT: vminnm.f32
+ %cmp = fcmp ult float %a, %b
+ %cond = select i1 %cmp, float %a, float %b
+ ret float %cond
+}
+
+define float @v8fp_vmaxnm_o(float %a, float %b) {
+; CHECK-FAST: v8fp_vmaxnm_o
+; CHECK-FAST-NOT: vcmp
+; CHECK-FAST: vmaxnm.f32
+; CHECK: v8fp_vmaxnm_o
+; CHECK-NOT: vmaxnm.f32
+ %cmp = fcmp ogt float %a, %b
+ %cond = select i1 %cmp, float %a, float %b
+ ret float %cond
+}
+
+define float @v8fp_vmaxnm_u(float %a, float %b) {
+; CHECK-FAST: v8fp_vmaxnm_u
+; CHECK-FAST-NOT: vcmp
+; CHECK-FAST: vmaxnm.f32
+; CHECK: v8fp_vmaxnm_u
+; CHECK-NOT: vmaxnm.f32
+ %cmp = fcmp ugt float %a, %b
+ %cond = select i1 %cmp, float %a, float %b
+ ret float %cond
+}
+
+
declare <4 x float> @llvm.arm.neon.vminnm.v4f32(<4 x float>, <4 x float>) nounwind readnone
declare <2 x float> @llvm.arm.neon.vminnm.v2f32(<2 x float>, <2 x float>) nounwind readnone
declare <4 x float> @llvm.arm.neon.vmaxnm.v4f32(<4 x float>, <4 x float>) nounwind readnone
OpenPOWER on IntegriCloud