2014-04-03 16:01:44 +00:00
|
|
|
; RUN: llc -mtriple=arm-eabi -mattr=+neon %s -o - | FileCheck %s
|
2009-06-22 23:27:02 +00:00
|
|
|
|
2009-07-08 00:46:57 +00:00
|
|
|
; This tests fcmp operations that do not map directly to NEON instructions.
|
2009-06-22 23:27:02 +00:00
|
|
|
|
|
|
|
; une is implemented with VCEQ/VMVN
|
|
|
|
define <2 x i32> @vcunef32(<2 x float>* %A, <2 x float>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vcunef32:
|
2009-09-15 20:58:02 +00:00
|
|
|
;CHECK: vceq.f32
|
|
|
|
;CHECK-NEXT: vmvn
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <2 x float>, <2 x float>* %A
|
|
|
|
%tmp2 = load <2 x float>, <2 x float>* %B
|
2009-07-08 00:46:57 +00:00
|
|
|
%tmp3 = fcmp une <2 x float> %tmp1, %tmp2
|
|
|
|
%tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
|
|
|
|
ret <2 x i32> %tmp4
|
2009-06-22 23:27:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
; olt is implemented with VCGT
|
|
|
|
define <2 x i32> @vcoltf32(<2 x float>* %A, <2 x float>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vcoltf32:
|
2009-09-15 20:58:02 +00:00
|
|
|
;CHECK: vcgt.f32
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <2 x float>, <2 x float>* %A
|
|
|
|
%tmp2 = load <2 x float>, <2 x float>* %B
|
2009-07-08 00:46:57 +00:00
|
|
|
%tmp3 = fcmp olt <2 x float> %tmp1, %tmp2
|
|
|
|
%tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
|
|
|
|
ret <2 x i32> %tmp4
|
2009-06-22 23:27:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
; ole is implemented with VCGE
|
|
|
|
define <2 x i32> @vcolef32(<2 x float>* %A, <2 x float>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vcolef32:
|
2009-09-15 20:58:02 +00:00
|
|
|
;CHECK: vcge.f32
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <2 x float>, <2 x float>* %A
|
|
|
|
%tmp2 = load <2 x float>, <2 x float>* %B
|
2009-07-08 00:46:57 +00:00
|
|
|
%tmp3 = fcmp ole <2 x float> %tmp1, %tmp2
|
|
|
|
%tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
|
|
|
|
ret <2 x i32> %tmp4
|
2009-06-22 23:27:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
; uge is implemented with VCGT/VMVN
|
|
|
|
define <2 x i32> @vcugef32(<2 x float>* %A, <2 x float>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vcugef32:
|
2009-09-15 20:58:02 +00:00
|
|
|
;CHECK: vcgt.f32
|
|
|
|
;CHECK-NEXT: vmvn
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <2 x float>, <2 x float>* %A
|
|
|
|
%tmp2 = load <2 x float>, <2 x float>* %B
|
2009-07-08 00:46:57 +00:00
|
|
|
%tmp3 = fcmp uge <2 x float> %tmp1, %tmp2
|
|
|
|
%tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
|
|
|
|
ret <2 x i32> %tmp4
|
2009-06-22 23:27:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
; ule is implemented with VCGT/VMVN
|
|
|
|
define <2 x i32> @vculef32(<2 x float>* %A, <2 x float>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vculef32:
|
2009-09-15 20:58:02 +00:00
|
|
|
;CHECK: vcgt.f32
|
|
|
|
;CHECK-NEXT: vmvn
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <2 x float>, <2 x float>* %A
|
|
|
|
%tmp2 = load <2 x float>, <2 x float>* %B
|
2009-07-08 00:46:57 +00:00
|
|
|
%tmp3 = fcmp ule <2 x float> %tmp1, %tmp2
|
|
|
|
%tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
|
|
|
|
ret <2 x i32> %tmp4
|
2009-06-22 23:27:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
; ugt is implemented with VCGE/VMVN
|
|
|
|
define <2 x i32> @vcugtf32(<2 x float>* %A, <2 x float>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vcugtf32:
|
2009-09-15 20:58:02 +00:00
|
|
|
;CHECK: vcge.f32
|
|
|
|
;CHECK-NEXT: vmvn
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <2 x float>, <2 x float>* %A
|
|
|
|
%tmp2 = load <2 x float>, <2 x float>* %B
|
2009-07-08 00:46:57 +00:00
|
|
|
%tmp3 = fcmp ugt <2 x float> %tmp1, %tmp2
|
|
|
|
%tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
|
|
|
|
ret <2 x i32> %tmp4
|
2009-06-22 23:27:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
; ult is implemented with VCGE/VMVN
|
|
|
|
define <2 x i32> @vcultf32(<2 x float>* %A, <2 x float>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vcultf32:
|
2009-09-15 20:58:02 +00:00
|
|
|
;CHECK: vcge.f32
|
|
|
|
;CHECK-NEXT: vmvn
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <2 x float>, <2 x float>* %A
|
|
|
|
%tmp2 = load <2 x float>, <2 x float>* %B
|
2009-07-08 00:46:57 +00:00
|
|
|
%tmp3 = fcmp ult <2 x float> %tmp1, %tmp2
|
|
|
|
%tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
|
|
|
|
ret <2 x i32> %tmp4
|
2009-06-22 23:27:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
; ueq is implemented with VCGT/VCGT/VORR/VMVN
|
|
|
|
define <2 x i32> @vcueqf32(<2 x float>* %A, <2 x float>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vcueqf32:
|
2009-09-15 20:58:02 +00:00
|
|
|
;CHECK: vcgt.f32
|
|
|
|
;CHECK-NEXT: vcgt.f32
|
|
|
|
;CHECK-NEXT: vorr
|
|
|
|
;CHECK-NEXT: vmvn
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <2 x float>, <2 x float>* %A
|
|
|
|
%tmp2 = load <2 x float>, <2 x float>* %B
|
2009-07-08 00:46:57 +00:00
|
|
|
%tmp3 = fcmp ueq <2 x float> %tmp1, %tmp2
|
|
|
|
%tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
|
|
|
|
ret <2 x i32> %tmp4
|
2009-06-22 23:27:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
; one is implemented with VCGT/VCGT/VORR
|
|
|
|
define <2 x i32> @vconef32(<2 x float>* %A, <2 x float>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vconef32:
|
2009-09-15 20:58:02 +00:00
|
|
|
;CHECK: vcgt.f32
|
|
|
|
;CHECK-NEXT: vcgt.f32
|
|
|
|
;CHECK-NEXT: vorr
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <2 x float>, <2 x float>* %A
|
|
|
|
%tmp2 = load <2 x float>, <2 x float>* %B
|
2009-07-08 00:46:57 +00:00
|
|
|
%tmp3 = fcmp one <2 x float> %tmp1, %tmp2
|
|
|
|
%tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
|
|
|
|
ret <2 x i32> %tmp4
|
2009-06-22 23:27:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
; uno is implemented with VCGT/VCGE/VORR/VMVN
|
|
|
|
define <2 x i32> @vcunof32(<2 x float>* %A, <2 x float>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vcunof32:
|
2009-09-15 20:58:02 +00:00
|
|
|
;CHECK: vcge.f32
|
|
|
|
;CHECK-NEXT: vcgt.f32
|
|
|
|
;CHECK-NEXT: vorr
|
|
|
|
;CHECK-NEXT: vmvn
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <2 x float>, <2 x float>* %A
|
|
|
|
%tmp2 = load <2 x float>, <2 x float>* %B
|
2009-07-08 00:46:57 +00:00
|
|
|
%tmp3 = fcmp uno <2 x float> %tmp1, %tmp2
|
|
|
|
%tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
|
|
|
|
ret <2 x i32> %tmp4
|
2009-06-22 23:27:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
; ord is implemented with VCGT/VCGE/VORR
|
|
|
|
define <2 x i32> @vcordf32(<2 x float>* %A, <2 x float>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vcordf32:
|
2009-09-15 20:58:02 +00:00
|
|
|
;CHECK: vcge.f32
|
|
|
|
;CHECK-NEXT: vcgt.f32
|
|
|
|
;CHECK-NEXT: vorr
|
2015-02-27 21:17:42 +00:00
|
|
|
%tmp1 = load <2 x float>, <2 x float>* %A
|
|
|
|
%tmp2 = load <2 x float>, <2 x float>* %B
|
2009-07-08 00:46:57 +00:00
|
|
|
%tmp3 = fcmp ord <2 x float> %tmp1, %tmp2
|
|
|
|
%tmp4 = sext <2 x i1> %tmp3 to <2 x i32>
|
|
|
|
ret <2 x i32> %tmp4
|
2009-06-22 23:27:02 +00:00
|
|
|
}
|