[llvm] r330313 - [ARM] Add some missing FP16 VSEL test cases
Sjoerd Meijer via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 19 01:21:51 PDT 2018
Author: sjoerdmeijer
Date: Thu Apr 19 01:21:50 2018
New Revision: 330313
URL: http://llvm.org/viewvc/llvm-project?rev=330313&view=rev
Log:
[ARM] Add some missing FP16 VSEL test cases
Differential Revision: https://reviews.llvm.org/D45724
Modified:
llvm/trunk/test/CodeGen/ARM/fp16-instructions.ll
Modified: llvm/trunk/test/CodeGen/ARM/fp16-instructions.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fp16-instructions.ll?rev=330313&r1=330312&r2=330313&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/fp16-instructions.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/fp16-instructions.ll Thu Apr 19 01:21:50 2018
@@ -485,7 +485,6 @@ entry:
; 18. VMINNM
; Tested in fp16-vminmaxnm.ll and fp16-vminmaxnm-safe.ll
-
; 19. VMLA
define float @VMLA(float %a.coerce, float %b.coerce, float %c.coerce) {
entry:
@@ -735,7 +734,7 @@ define half @select_cc_ge1() {
; CHECK-LABEL: select_cc_ge1:
-; CHECK-HARDFP-FULLFP16: vcmpe.f16 s0, s0
+; CHECK-HARDFP-FULLFP16: vcmpe.f16 s0, s0
; CHECK-HARDFP-FULLFP16-NEXT: vmrs APSR_nzcv, fpscr
; CHECK-HARDFP-FULLFP16-NEXT: vselge.f16 s0, s{{.}}, s{{.}}
@@ -749,9 +748,26 @@ define half @select_cc_ge1() {
; CHECK-SOFTFP-FP16-T32-NEXT: vmovge.f32 s{{.}}, s{{.}}
}
-;
-; FIXME: add fcmp ole, ult here.
-;
+define half @select_cc_ge2() {
+ %1 = fcmp nsz ole half undef, 0xH0001
+ %2 = select i1 %1, half 0xHC000, half 0xH0002
+ ret half %2
+
+; CHECK-LABEL: select_cc_ge2:
+
+; CHECK-HARDFP-FULLFP16: vcmpe.f16 s0, s0
+; CHECK-HARDFP-FULLFP16-NEXT: vmrs APSR_nzcv, fpscr
+; CHECK-HARDFP-FULLFP16-NEXT: vselge.f16 s0, s{{.}}, s{{.}}
+
+; CHECK-SOFTFP-FP16-A32: vcmpe.f32 s0, s0
+; CHECK-SOFTFP-FP16-A32-NEXT: vmrs APSR_nzcv, fpscr
+; CHECK-SOFTFP-FP16-A32-NEXT: vmovls.f32 s{{.}}, s{{.}}
+
+; CHECK-SOFTFP-FP16-T32: vcmpe.f32 s0, s0
+; CHECK-SOFTFP-FP16-T32-NEXT: vmrs APSR_nzcv, fpscr
+; CHECK-SOFTFP-FP16-T32-NEXT: it ls
+; CHECK-SOFTFP-FP16-T32-NEXT: vmovls.f32 s{{.}}, s{{.}}
+}
define half @select_cc_ge3() {
%1 = fcmp nsz ugt half undef, 0xH0001
@@ -774,6 +790,27 @@ define half @select_cc_ge3() {
; CHECK-SOFTFP-FP16-T32-NEXT: vmovhi.f32 s{{.}}, s{{.}}
}
+define half @select_cc_ge4() {
+ %1 = fcmp nsz ult half undef, 0xH0001
+ %2 = select i1 %1, half 0xHC000, half 0xH0002
+ ret half %2
+
+; CHECK-LABEL: select_cc_ge4:
+
+; CHECK-HARDFP-FULLFP16: vcmpe.f16 s0, s0
+; CHECK-HARDFP-FULLFP16-NEXT: vmrs APSR_nzcv, fpscr
+; CHECK-HARDFP-FULLFP16-NEXT: vselge.f16 s0, s{{.}}, s{{.}}
+
+; CHECK-SOFTFP-FP16-A32: vcmpe.f32 s0, s0
+; CHECK-SOFTFP-FP16-A32-NEXT: vmrs APSR_nzcv, fpscr
+; CHECK-SOFTFP-FP16-A32-NEXT: vmovlt.f32 s{{.}}, s{{.}}
+
+; CHECK-SOFTFP-FP16-T32: vcmpe.f32 s0, s0
+; CHECK-SOFTFP-FP16-T32-NEXT: vmrs APSR_nzcv, fpscr
+; CHECK-SOFTFP-FP16-T32-NEXT: it lt
+; CHECK-SOFTFP-FP16-T32-NEXT: vmovlt.f32 s{{.}}, s{{.}}
+}
+
; 37. VSELGT
define half @select_cc_gt1() {
%1 = fcmp nsz ogt half undef, 0xH0001
@@ -817,9 +854,47 @@ define half @select_cc_gt2() {
; CHECK-SOFTFP-FP16-T32-NEXT: vmovpl.f32 s{{.}}, s{{.}}
}
-;
-; FIXME: add fcmp ule, olt here.
-;
+define half @select_cc_gt3() {
+ %1 = fcmp nsz ule half undef, 0xH0001
+ %2 = select i1 %1, half 0xHC000, half 0xH0002
+ ret half %2
+
+; CHECK-LABEL: select_cc_gt3:
+
+; CHECK-HARDFP-FULLFP16: vcmpe.f16 s0, s0
+; CHECK-HARDFP-FULLFP16-NEXT: vmrs APSR_nzcv, fpscr
+; CHECK-HARDFP-FULLFP16-NEXT: vselgt.f16 s0, s{{.}}, s{{.}}
+
+; CHECK-SOFTFP-FP16-A32: vcmpe.f32 s0, s0
+; CHECK-SOFTFP-FP16-A32-NEXT: vmrs APSR_nzcv, fpscr
+; CHECK-SOFTFP-FP16-A32-NEXT: vmovle.f32 s{{.}}, s{{.}}
+
+; CHECK-SOFTFP-FP16-T32: vcmpe.f32 s0, s0
+; CHECK-SOFTFP-FP16-T32-NEXT: vmrs APSR_nzcv, fpscr
+; CHECK-SOFTFP-FP16-T32-NEXT: it le
+; CHECK-SOFTFP-FP16-T32-NEXT: vmovle.f32 s{{.}}, s{{.}}
+}
+
+define half @select_cc_gt4() {
+ %1 = fcmp nsz olt half undef, 0xH0001
+ %2 = select i1 %1, half 0xHC000, half 0xH0002
+ ret half %2
+
+; CHECK-LABEL: select_cc_gt4:
+
+; CHECK-HARDFP-FULLFP16: vcmpe.f16 s0, s0
+; CHECK-HARDFP-FULLFP16-NEXT: vmrs APSR_nzcv, fpscr
+; CHECK-HARDFP-FULLFP16-NEXT: vselgt.f16 s0, s{{.}}, s{{.}}
+
+; CHECK-SOFTFP-FP16-A32: vcmpe.f32 s0, s0
+; CHECK-SOFTFP-FP16-A32-NEXT: vmrs APSR_nzcv, fpscr
+; CHECK-SOFTFP-FP16-A32-NEXT: vmovmi.f32 s{{.}}, s{{.}}
+
+; CHECK-SOFTFP-FP16-T32: vcmpe.f32 s0, s0
+; CHECK-SOFTFP-FP16-T32-NEXT: vmrs APSR_nzcv, fpscr
+; CHECK-SOFTFP-FP16-T32-NEXT: it mi
+; CHECK-SOFTFP-FP16-T32-NEXT: vmovmi.f32 s{{.}}, s{{.}}
+}
; 38. VSELVS
define float @select_cc4(float %a.coerce) {
More information about the llvm-commits
mailing list