summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/avx-trunc.ll
diff options
context:
space:
mode:
authorElena Demikhovsky <elena.demikhovsky@intel.com>2013-01-03 08:48:33 +0000
committerElena Demikhovsky <elena.demikhovsky@intel.com>2013-01-03 08:48:33 +0000
commit5f2f06d2d9294ff01e9c6e08aaf0b6e97863e63a (patch)
tree194931473c192220b4036fbe197cd36884fe826f /llvm/test/CodeGen/X86/avx-trunc.ll
parent820aac1c783e39c863bb99e33d5c98fd7f06c8e4 (diff)
downloadbcm5719-llvm-5f2f06d2d9294ff01e9c6e08aaf0b6e97863e63a.tar.gz
bcm5719-llvm-5f2f06d2d9294ff01e9c6e08aaf0b6e97863e63a.zip
Simplified TRUNCATE operation that comes after SETCC. It is possible since SETCC result is 0 or -1.
Added a test. llvm-svn: 171467
Diffstat (limited to 'llvm/test/CodeGen/X86/avx-trunc.ll')
-rwxr-xr-xllvm/test/CodeGen/X86/avx-trunc.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/avx-trunc.ll b/llvm/test/CodeGen/X86/avx-trunc.ll
index d0077366444..aa186a05f21 100755
--- a/llvm/test/CodeGen/X86/avx-trunc.ll
+++ b/llvm/test/CodeGen/X86/avx-trunc.ll
@@ -13,3 +13,18 @@ define <8 x i16> @trunc_32_16(<8 x i32> %A) nounwind uwtable readnone ssp{
ret <8 x i16>%B
}
+define <8 x i16> @trunc_after_setcc(<8 x float> %a, <8 x float> %b, <8 x float> %c, <8 x float> %d) {
+; CHECK: trunc_after_setcc
+; CHECK: vcmpltps
+; CHECK-NOT: vextract
+; CHECK: vcmpltps
+; CHECK-NEXT: vandps
+; CHECK-NEXT: vandps
+; CHECK: ret
+ %res1 = fcmp olt <8 x float> %a, %b
+ %res2 = fcmp olt <8 x float> %c, %d
+ %andr = and <8 x i1>%res1, %res2
+ %ex = zext <8 x i1> %andr to <8 x i16>
+ ret <8 x i16>%ex
+}
+
OpenPOWER on IntegriCloud