diff options
author | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:52:33 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:52:33 +0000 |
commit | 009b1c42aa6266385f2c37e227516b24077e6dd7 (patch) | |
tree | 64ba909838c23261cace781ece27d106134ea451 /test/CodeGen/X86/shift-and.ll |
Diffstat (limited to 'test/CodeGen/X86/shift-and.ll')
-rw-r--r-- | test/CodeGen/X86/shift-and.ll | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CodeGen/X86/shift-and.ll b/test/CodeGen/X86/shift-and.ll new file mode 100644 index 0000000000000..b6d78a485783d --- /dev/null +++ b/test/CodeGen/X86/shift-and.ll @@ -0,0 +1,24 @@ +; RUN: llvm-as < %s | llc -march=x86 | grep and | count 1 +; RUN: llvm-as < %s | llc -march=x86-64 | not grep and + +define i32 @t1(i32 %t, i32 %val) nounwind { + %shamt = and i32 %t, 31 + %res = shl i32 %val, %shamt + ret i32 %res +} + +@X = internal global i16 0 + +define void @t2(i16 %t) nounwind { + %shamt = and i16 %t, 31 + %tmp = load i16* @X + %tmp1 = ashr i16 %tmp, %shamt + store i16 %tmp1, i16* @X + ret void +} + +define i64 @t3(i64 %t, i64 %val) nounwind { + %shamt = and i64 %t, 63 + %res = lshr i64 %val, %shamt + ret i64 %res +} |