diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-12-14 08:30:15 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-12-14 08:30:15 +0000 |
commit | 7cfbfe357a7ff6ed3b954270b3ed8548e33c15dd (patch) | |
tree | 076b34df1935df25432ed1b8b3c80a6e2682ed4f /test | |
parent | 4f0345c285f0194616be756b6138d40f810b0984 (diff) | |
download | external_llvm-7cfbfe357a7ff6ed3b954270b3ed8548e33c15dd.zip external_llvm-7cfbfe357a7ff6ed3b954270b3ed8548e33c15dd.tar.gz external_llvm-7cfbfe357a7ff6ed3b954270b3ed8548e33c15dd.tar.bz2 |
Fix ctlz and cttz. llvm definition requires them to return number of bits in of the src type when value is zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/X86/clz.ll | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/CodeGen/X86/clz.ll b/test/CodeGen/X86/clz.ll index 0505529..c3b3b41 100644 --- a/test/CodeGen/X86/clz.ll +++ b/test/CodeGen/X86/clz.ll @@ -1,5 +1,6 @@ -; RUN: llvm-as < %s | llc -march=x86 | grep bsr +; RUN: llvm-as < %s | llc -march=x86 | grep bsr | count 2 ; RUN: llvm-as < %s | llc -march=x86 | grep bsf +; RUN: llvm-as < %s | llc -march=x86 | grep cmov | count 3 define i32 @t1(i32 %x) nounwind { %tmp = tail call i32 @llvm.ctlz.i32( i32 %x ) @@ -14,3 +15,12 @@ define i32 @t2(i32 %x) nounwind { } declare i32 @llvm.cttz.i32(i32) nounwind readnone + +define i16 @t3(i16 %x, i16 %y) nounwind { +entry: + %tmp1 = add i16 %x, %y + %tmp2 = tail call i16 @llvm.ctlz.i16( i16 %tmp1 ) ; <i16> [#uses=1] + ret i16 %tmp2 +} + +declare i16 @llvm.ctlz.i16(i16) nounwind readnone |