cranelift: Add support for bswap.i128 (#5186)

* fuzzgen: Request only one variable for bswap

This was included by accident. Bswap only has one input, instead of two.

* cranelift: Add `bswap.i128` support

Adds support only for x86, AArch64, S390X.

RISCV does not yet have bswap.
This commit is contained in:
Afonso Bordado
2022-11-03 18:03:37 +00:00
committed by GitHub
parent 22159848c5
commit 2c69b94744
5 changed files with 21 additions and 16 deletions

View File

@@ -1,4 +1,9 @@
test interpret
test run
set enable_llvm_abi_extensions
target x86_64
target aarch64
target s390x
function %bswap_i128(i128) -> i128 {
block0(v0: i128):
@@ -9,4 +14,3 @@ block0(v0: i128):
; run: %bswap_i128(1) == 0x01000000_00000000_00000000_00000000
; run: %bswap_i128(0x12345678_9ABCDEF0_CAFEF00D_F00DCAFE) == 0xFECA0DF0_0DF0FECA_F0DEBC9A_78563412
; run: %bswap_i128(-2) == 0xFEFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF