diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-10-30 17:31:21 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-10-30 17:31:21 +0000 |
| commit | 7402ee6ec2eba44e2f0090e955186cd9ff69dcac (patch) | |
| tree | 686af0ae57fbf3760f2f738b85e28adb95add6b8 /llvm/test | |
| parent | f1d76db466b2a50781c0754b86ac994dd07b5041 (diff) | |
| download | bcm5719-llvm-7402ee6ec2eba44e2f0090e955186cd9ff69dcac.tar.gz bcm5719-llvm-7402ee6ec2eba44e2f0090e955186cd9ff69dcac.zip | |
X86: Emit logical shift by constant splat of <16 x i8> as a <8 x i16> shift and zero out the bits where zeros should've been shifted in.
llvm-svn: 143315
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/X86/x86-shifts.ll | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/x86-shifts.ll b/llvm/test/CodeGen/X86/x86-shifts.ll index 5a91b090472..3e44eafa240 100644 --- a/llvm/test/CodeGen/X86/x86-shifts.ll +++ b/llvm/test/CodeGen/X86/x86-shifts.ll @@ -152,3 +152,21 @@ entry: %K = xor <2 x i32> %B, %C ret <2 x i32> %K } + +define <16 x i8> @shl9(<16 x i8> %A) nounwind { + %B = shl <16 x i8> %A, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3> + ret <16 x i8> %B +; CHECK: shl9: +; CHECK: psllw $3 +; CHECK: pand +; CHECK: ret +} + +define <16 x i8> @shr9(<16 x i8> %A) nounwind { + %B = lshr <16 x i8> %A, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3> + ret <16 x i8> %B +; CHECK: shr9: +; CHECK: psrlw $3 +; CHECK: pand +; CHECK: ret +} |

