diff options
author | Dan Gohman <dan433584@gmail.com> | 2015-08-24 16:39:37 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2015-08-24 16:39:37 +0000 |
commit | 08fc966d3c25cd943d1b07b50fa54ff390e8ee29 (patch) | |
tree | a60a072cabc120ae1d271a7faab149c20f677a93 /llvm/test/CodeGen/WebAssembly | |
parent | 27785dd5300825e60d5ff7edf5a2bada85004b58 (diff) | |
download | bcm5719-llvm-08fc966d3c25cd943d1b07b50fa54ff390e8ee29.tar.gz bcm5719-llvm-08fc966d3c25cd943d1b07b50fa54ff390e8ee29.zip |
[WebAssembly] Implement the is_zero_undef forms of cttz and ctlz
llvm-svn: 245851
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly')
-rw-r--r-- | llvm/test/CodeGen/WebAssembly/integer32.ll | 18 | ||||
-rw-r--r-- | llvm/test/CodeGen/WebAssembly/integer64.ll | 18 |
2 files changed, 36 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/integer32.ll b/llvm/test/CodeGen/WebAssembly/integer32.ll index e987f6eaa55..ab2d0b9497c 100644 --- a/llvm/test/CodeGen/WebAssembly/integer32.ll +++ b/llvm/test/CodeGen/WebAssembly/integer32.ll @@ -148,6 +148,15 @@ define i32 @clz32(i32 %x) { ret i32 %a } +; CHECK-LABEL: clz32_zero_undef: +; CHECK-NEXT: (setlocal @0 (argument 0)) +; CHECK-NEXT: (setlocal @1 (clz @0)) +; CHECK-NEXT: (return @1) +define i32 @clz32_zero_undef(i32 %x) { + %a = call i32 @llvm.ctlz.i32(i32 %x, i1 true) + ret i32 %a +} + ; CHECK-LABEL: ctz32: ; CHECK-NEXT: (setlocal @0 (argument 0)) ; CHECK-NEXT: (setlocal @1 (ctz @0)) @@ -157,6 +166,15 @@ define i32 @ctz32(i32 %x) { ret i32 %a } +; CHECK-LABEL: ctz32_zero_undef: +; CHECK-NEXT: (setlocal @0 (argument 0)) +; CHECK-NEXT: (setlocal @1 (ctz @0)) +; CHECK-NEXT: (return @1) +define i32 @ctz32_zero_undef(i32 %x) { + %a = call i32 @llvm.cttz.i32(i32 %x, i1 true) + ret i32 %a +} + ; CHECK-LABEL: popcnt32: ; CHECK-NEXT: (setlocal @0 (argument 0)) ; CHECK-NEXT: (setlocal @1 (popcnt @0)) diff --git a/llvm/test/CodeGen/WebAssembly/integer64.ll b/llvm/test/CodeGen/WebAssembly/integer64.ll index ba483552939..f902bced9d9 100644 --- a/llvm/test/CodeGen/WebAssembly/integer64.ll +++ b/llvm/test/CodeGen/WebAssembly/integer64.ll @@ -148,6 +148,15 @@ define i64 @clz64(i64 %x) { ret i64 %a } +; CHECK-LABEL: clz64_zero_undef: +; CHECK-NEXT: (setlocal @0 (argument 0)) +; CHECK-NEXT: (setlocal @1 (clz @0)) +; CHECK-NEXT: (return @1) +define i64 @clz64_zero_undef(i64 %x) { + %a = call i64 @llvm.ctlz.i64(i64 %x, i1 true) + ret i64 %a +} + ; CHECK-LABEL: ctz64: ; CHECK-NEXT: (setlocal @0 (argument 0)) ; CHECK-NEXT: (setlocal @1 (ctz @0)) @@ -157,6 +166,15 @@ define i64 @ctz64(i64 %x) { ret i64 %a } +; CHECK-LABEL: ctz64_zero_undef: +; CHECK-NEXT: (setlocal @0 (argument 0)) +; CHECK-NEXT: (setlocal @1 (ctz @0)) +; CHECK-NEXT: (return @1) +define i64 @ctz64_zero_undef(i64 %x) { + %a = call i64 @llvm.cttz.i64(i64 %x, i1 true) + ret i64 %a +} + ; CHECK-LABEL: popcnt64: ; CHECK-NEXT: (setlocal @0 (argument 0)) ; CHECK-NEXT: (setlocal @1 (popcnt @0)) |