diff options
| author | Craig Topper <craig.topper@gmail.com> | 2013-09-02 07:53:17 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2013-09-02 07:53:17 +0000 |
| commit | b25f0f5538fbca6a24987150b1b059801e111001 (patch) | |
| tree | 2d49ad6ebd16d14489820c60adcb1bd280750865 /llvm/test/CodeGen/X86/bmi.ll | |
| parent | bc36e6e0996267a58dbbfdee6e975a77bb780599 (diff) | |
| download | bcm5719-llvm-b25f0f5538fbca6a24987150b1b059801e111001.tar.gz bcm5719-llvm-b25f0f5538fbca6a24987150b1b059801e111001.zip | |
Create BEXTR instructions for (and ((sra or srl) x, imm), (2**size - 1)). Fixes PR17028.
llvm-svn: 189742
Diffstat (limited to 'llvm/test/CodeGen/X86/bmi.ll')
| -rw-r--r-- | llvm/test/CodeGen/X86/bmi.ll | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/bmi.ll b/llvm/test/CodeGen/X86/bmi.ll index 757e98d28d2..242075a878b 100644 --- a/llvm/test/CodeGen/X86/bmi.ll +++ b/llvm/test/CodeGen/X86/bmi.ll @@ -111,6 +111,23 @@ define i32 @bextr32_load(i32* %x, i32 %y) nounwind readnone { declare i32 @llvm.x86.bmi.bextr.32(i32, i32) nounwind readnone +define i32 @bextr32b(i32 %x) nounwind uwtable readnone ssp { + %1 = lshr i32 %x, 4 + %2 = and i32 %1, 4095 + ret i32 %2 +; CHECK-LABEL: bextr32b: +; CHECK: bextrl +} + +define i32 @bextr32b_load(i32* %x) nounwind uwtable readnone ssp { + %1 = load i32* %x + %2 = lshr i32 %1, 4 + %3 = and i32 %2, 4095 + ret i32 %3 +; CHECK-LABEL: bextr32b_load: +; CHECK: bextrl {{.*}}, ({{.*}}), {{.*}} +} + define i64 @bextr64(i64 %x, i64 %y) nounwind readnone { %tmp = tail call i64 @llvm.x86.bmi.bextr.64(i64 %x, i64 %y) ret i64 %tmp @@ -120,6 +137,14 @@ define i64 @bextr64(i64 %x, i64 %y) nounwind readnone { declare i64 @llvm.x86.bmi.bextr.64(i64, i64) nounwind readnone +define i64 @bextr64b(i64 %x) nounwind uwtable readnone ssp { + %1 = lshr i64 %x, 4 + %2 = and i64 %1, 4095 + ret i64 %2 +; CHECK-LABEL: bextr64b: +; CHECK: bextrq +} + define i32 @bzhi32(i32 %x, i32 %y) nounwind readnone { %tmp = tail call i32 @llvm.x86.bmi.bzhi.32(i32 %x, i32 %y) ret i32 %tmp |

