aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2019-03-09 02:11:05 +0000
committerSanjay Patel <spatel@rotateright.com>2019-03-09 02:11:05 +0000
commit40bcc3de7d057a34320fc7e305604beec429209b (patch)
tree211359d21cecd64ab7a2ff50bb99baf516367556
parent69f8c1653d2fc4e65c156d1938c992af3dfb8ce1 (diff)
downloadllvm-40bcc3de7d057a34320fc7e305604beec429209b.zip
llvm-40bcc3de7d057a34320fc7e305604beec429209b.tar.gz
llvm-40bcc3de7d057a34320fc7e305604beec429209b.tar.bz2
[x86] add tests for extract of FP select; NFC
llvm-svn: 355768
-rw-r--r--llvm/test/CodeGen/X86/extractelement-fp.ll26
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/extractelement-fp.ll b/llvm/test/CodeGen/X86/extractelement-fp.ll
index 300506a..2cab220 100644
--- a/llvm/test/CodeGen/X86/extractelement-fp.ll
+++ b/llvm/test/CodeGen/X86/extractelement-fp.ll
@@ -152,6 +152,32 @@ define i1 @fcmp_v4f64(<4 x double> %x, <4 x double> %y) nounwind {
ret i1 %r
}
+define float @select_fcmp_v4f32(<4 x float> %x, <4 x float> %y, <4 x float> %z, <4 x float> %w) nounwind {
+; CHECK-LABEL: select_fcmp_v4f32:
+; CHECK: # %bb.0:
+; CHECK-NEXT: vcmpneq_oqps %xmm1, %xmm0, %xmm0
+; CHECK-NEXT: vblendvps %xmm0, %xmm2, %xmm3, %xmm0
+; CHECK-NEXT: retq
+ %c = fcmp one <4 x float> %x, %y
+ %s = select <4 x i1> %c, <4 x float> %z, <4 x float> %w
+ %r = extractelement <4 x float> %s, i32 0
+ ret float %r
+}
+
+define double @select_fcmp_v4f64(<4 x double> %x, <4 x double> %y, <4 x double> %z, <4 x double> %w) nounwind {
+; CHECK-LABEL: select_fcmp_v4f64:
+; CHECK: # %bb.0:
+; CHECK-NEXT: vcmpnltpd %ymm0, %ymm1, %ymm0
+; CHECK-NEXT: vblendvpd %ymm0, %ymm2, %ymm3, %ymm0
+; CHECK-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
+; CHECK-NEXT: vzeroupper
+; CHECK-NEXT: retq
+ %c = fcmp ule <4 x double> %x, %y
+ %s = select <4 x i1> %c, <4 x double> %z, <4 x double> %w
+ %r = extractelement <4 x double> %s, i32 0
+ ret double %r
+}
+
define float @fsqrt_v4f32(<4 x float> %x) nounwind {
; CHECK-LABEL: fsqrt_v4f32:
; CHECK: # %bb.0: