summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/avx-shift.ll
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2011-11-21 01:12:36 +0000
committerCraig Topper <craig.topper@gmail.com>2011-11-21 01:12:36 +0000
commita124f949527e36efc05d2dbc999ddce43791b4ec (patch)
tree13ac28efc3fb1a6389eea22216c45fed7805a2b6 /test/CodeGen/X86/avx-shift.ll
parent7912ef97ffde3ab3334143ddfb4cafdf04e2ebfc (diff)
downloadllvm-a124f949527e36efc05d2dbc999ddce43791b4ec.tar.gz
llvm-a124f949527e36efc05d2dbc999ddce43791b4ec.tar.bz2
llvm-a124f949527e36efc05d2dbc999ddce43791b4ec.tar.xz
Make LowerSIGN_EXTEND_INREG split 256-bit vectors when AVX1 is enabled and use AVX2 shifts when AVX2 is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145022 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/avx-shift.ll')
-rw-r--r--test/CodeGen/X86/avx-shift.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CodeGen/X86/avx-shift.ll b/test/CodeGen/X86/avx-shift.ll
index a33423d7c5..681747b844 100644
--- a/test/CodeGen/X86/avx-shift.ll
+++ b/test/CodeGen/X86/avx-shift.ll
@@ -112,3 +112,27 @@ define <8 x i32> @vshift08(<8 x i32> %a) nounwind {
ret <8 x i32> %bitop
}
+;;; Uses shifts for sign extension
+; CHECK: _sext_v16i16
+; CHECK: vpsllw
+; CHECK: vpsraw
+; CHECK: vpsllw
+; CHECK: vpsraw
+; CHECK: vinsertf128
+define <16 x i16> @sext_v16i16(<16 x i16> %a) nounwind {
+ %b = trunc <16 x i16> %a to <16 x i8>
+ %c = sext <16 x i8> %b to <16 x i16>
+ ret <16 x i16> %c
+}
+
+; CHECK: _sext_v8i32
+; CHECK: vpslld
+; CHECK: vpsrad
+; CHECK: vpslld
+; CHECK: vpsrad
+; CHECK: vinsertf128
+define <8 x i32> @sext_v8i32(<8 x i32> %a) nounwind {
+ %b = trunc <8 x i32> %a to <8 x i16>
+ %c = sext <8 x i16> %b to <8 x i32>
+ ret <8 x i32> %c
+}