diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2011-11-01 21:18:39 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2011-11-01 21:18:39 +0000 |
| commit | 3f5eccbe7a76ae395d3ee90a22d2bbb9df814422 (patch) | |
| tree | db7f9121a58a52169403a9ee06a856e9dd5281e0 /llvm/test/CodeGen | |
| parent | decdcacece5b9d8f022d76531e01dc9c0fa870b8 (diff) | |
| download | bcm5719-llvm-3f5eccbe7a76ae395d3ee90a22d2bbb9df814422.tar.gz bcm5719-llvm-3f5eccbe7a76ae395d3ee90a22d2bbb9df814422.zip | |
Teach the x86 backend a couple tricks for dealing with v16i8 sra by a constant splat value. Fixes PR11289.
llvm-svn: 143498
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/X86/x86-shifts.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/x86-shifts.ll b/llvm/test/CodeGen/X86/x86-shifts.ll index 3e44eafa240..20bccab8ff7 100644 --- a/llvm/test/CodeGen/X86/x86-shifts.ll +++ b/llvm/test/CodeGen/X86/x86-shifts.ll @@ -170,3 +170,23 @@ define <16 x i8> @shr9(<16 x i8> %A) nounwind { ; CHECK: pand ; CHECK: ret } + +define <16 x i8> @sra_v16i8_7(<16 x i8> %A) nounwind { + %B = ashr <16 x i8> %A, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7> + ret <16 x i8> %B +; CHECK: sra_v16i8_7: +; CHECK: pxor +; CHECK: pcmpgtb +; CHECK: ret +} + +define <16 x i8> @sra_v16i8(<16 x i8> %A) nounwind { + %B = ashr <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: sra_v16i8: +; CHECK: psrlw $3 +; CHECK: pand +; CHECK: pxor +; CHECK: psubb +; CHECK: ret +} |

