summaryrefslogtreecommitdiff
path: root/test
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
commitab7032090871abf6aeed86b2c4b836e97771d234 (patch)
treed6012d82ead4b8e96e4d98d662a8857ba4e0fd2b /test
parente33a8b8c2f003b703b0af32effd8ef25477c2165 (diff)
downloadllvm-ab7032090871abf6aeed86b2c4b836e97771d234.tar.gz
llvm-ab7032090871abf6aeed86b2c4b836e97771d234.tar.bz2
llvm-ab7032090871abf6aeed86b2c4b836e97771d234.tar.xz
Simplified TRUNCATE operation that comes after SETCC. It is possible since SETCC result is 0 or -1.
Added a test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rwxr-xr-xtest/CodeGen/X86/avx-trunc.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGen/X86/avx-trunc.ll b/test/CodeGen/X86/avx-trunc.ll
index d007736644..aa186a05f2 100755
--- a/test/CodeGen/X86/avx-trunc.ll
+++ b/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
+}
+