Files
wasmtime/cranelift/filetests/filetests/runtests/i128-bitops-count.clif
yuyang-ok cdecc858b4 add riscv64 backend for cranelift. (#4271)
Add a RISC-V 64 (`riscv64`, RV64GC) backend.

Co-authored-by: yuyang <756445638@qq.com>
Co-authored-by: Chris Fallin <chris@cfallin.org>
Co-authored-by: Afonso Bordado <afonsobordado@az8.co>
2022-09-27 17:30:31 -07:00

51 lines
1.9 KiB
Plaintext

test run
set enable_llvm_abi_extensions=true
target aarch64
target s390x
target x86_64
target riscv64
function %ctz_i128(i128) -> i128 {
block0(v0: i128):
v1 = ctz v0
return v1
}
; run: %ctz_i128(0x00000000_00000000_00000000_00000000) == 128
; run: %ctz_i128(0x00000000_00000000_FFFFFFFF_FFFFFFFF) == 0
; run: %ctz_i128(0xFFFFFFFF_FFFFFFFF_00000000_00000000) == 64
; run: %ctz_i128(0xFFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF) == 0
; run: %ctz_i128(0xF0000000_00000000_FFFFFFFF_00000000) == 32
; run: %ctz_i128(0xFF000000_00000000_F0000000_00000000) == 60
; run: %ctz_i128(0x00000000_00000000_00000001_00000000) == 32
; run: %ctz_i128(0x00000001_00000000_00000000_00000000) == 96
; run: %ctz_i128(0x00000001_00000000_00000000_00010000) == 16
; run: %ctz_i128(0x00000000_00000000_00000000_00010000) == 16
function %clz_i128(i128) -> i128 {
block0(v0: i128):
v1 = clz v0
return v1
}
; run: %clz_i128(0x00000000_00000000_00000000_00000000) == 128
; run: %clz_i128(0x00000000_00000000_FFFFFFFF_FFFFFFFF) == 64
; run: %clz_i128(0xFFFFFFFF_FFFFFFFF_00000000_00000000) == 0
; run: %clz_i128(0xFFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF) == 0
; run: %clz_i128(0x40000000_00000000_FFFFFFFF_FFFFFFFF) == 1
; run: %clz_i128(0x20000000_00000000_FFFFFFFF_FFFFFFFF) == 2
; run: %clz_i128(0x00000000_80000000_00000000_00000000) == 32
; run: %clz_i128(0x00000001_00000000_00000000_00000000) == 31
; run: %clz_i128(0x00000001_00000000_00000000_00010000) == 31
; run: %clz_i128(0x00000000_00000000_00000000_00010000) == 111
function %popcnt_i128(i128) -> i128 {
block0(v0: i128):
v1 = popcnt v0
return v1
}
; run: %popcnt_i128(0x00000000_00000000_00000000_00000000) == 0
; run: %popcnt_i128(0x00000000_00000000_FFFFFFFF_FFFFFFFF) == 64
; run: %popcnt_i128(0xFFFFFFFF_FFFFFFFF_00000000_00000000) == 64
; run: %popcnt_i128(0xFFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF) == 128
; run: %popcnt_i128(0x55555555_55555555_55555555_55555555) == 64
; run: %popcnt_i128(0xDECAFFFF_C0FFEEEE_C0FFEEEE_DECAFFFF) == 96