cranelift: Update i128 tests to use i128 values in functions
This commit is contained in:
@@ -1,60 +1,51 @@
|
||||
test run
|
||||
set enable_llvm_abi_extensions=true
|
||||
target aarch64
|
||||
; target s390x TODO: Not yet implemented on s390x
|
||||
target x86_64 machinst
|
||||
|
||||
function %rotl(i64, i64, i8) -> i64, i64 {
|
||||
block0(v0: i64, v1: i64, v2: i8):
|
||||
v3 = iconcat v0, v1
|
||||
v4 = rotl.i128 v3, v2
|
||||
v5, v6 = isplit v4
|
||||
return v5, v6
|
||||
function %rotl(i128, i8) -> i128 {
|
||||
block0(v0: i128, v1: i8):
|
||||
v2 = rotl.i128 v0, v1
|
||||
return v2
|
||||
}
|
||||
; run: %rotl(0x01010101_01010101, 0x01010101_01010101, 9) == [0x02020202_02020202, 0x02020202_02020202]
|
||||
; run: %rotl(0x01010101_01010101, 0x01010101_01010101, 73) == [0x02020202_02020202, 0x02020202_02020202]
|
||||
; run: %rotl(0x01010101_01010101, 0x02020202_02020202, 0) == [0x01010101_01010101, 0x02020202_02020202]
|
||||
; run: %rotl(0x01010101_01010101, 0x03030303_03030303, 128) == [0x01010101_01010101, 0x03030303_03030303]
|
||||
; run: %rotl(0x01010101_01010101_01010101_01010101, 9) == 0x02020202_02020202_02020202_02020202
|
||||
; run: %rotl(0x01010101_01010101_01010101_01010101, 73) == 0x02020202_02020202_02020202_02020202
|
||||
; run: %rotl(0x02020202_02020202_01010101_01010101, 0) == 0x02020202_02020202_01010101_01010101
|
||||
; run: %rotl(0x03030303_03030303_01010101_01010101, 128) == 0x03030303_03030303_01010101_01010101
|
||||
|
||||
function %rotr(i64, i64, i8) -> i64, i64 {
|
||||
block0(v0: i64, v1: i64, v2: i8):
|
||||
v3 = iconcat v0, v1
|
||||
v4 = rotr.i128 v3, v2
|
||||
v5, v6 = isplit v4
|
||||
return v5, v6
|
||||
function %rotr(i128, i8) -> i128 {
|
||||
block0(v0: i128, v1: i8):
|
||||
v2 = rotr.i128 v0, v1
|
||||
return v2
|
||||
}
|
||||
; run: %rotr(0x01010101_01010101, 0x01010101_01010101, 9) == [0x80808080_80808080, 0x80808080_80808080]
|
||||
; run: %rotr(0x01010101_01010101, 0x01010101_01010101, 73) == [0x80808080_80808080, 0x80808080_80808080]
|
||||
; run: %rotr(0x01010101_01010101, 0x02020202_02020202, 0) == [0x01010101_01010101, 0x02020202_02020202]
|
||||
; run: %rotr(0x01010101_01010101, 0x03030303_03030303, 128) == [0x01010101_01010101, 0x03030303_03030303]
|
||||
; run: %rotr(0x01010101_01010101_01010101_01010101, 9) == 0x80808080_80808080_80808080_80808080
|
||||
; run: %rotr(0x01010101_01010101_01010101_01010101, 73) == 0x80808080_80808080_80808080_80808080
|
||||
; run: %rotr(0x02020202_02020202_01010101_01010101, 0) == 0x02020202_02020202_01010101_01010101
|
||||
; run: %rotr(0x03030303_03030303_01010101_01010101, 128) == 0x03030303_03030303_01010101_01010101
|
||||
|
||||
function %rotl_amt_i128(i64, i64, i8) -> i64, i64 {
|
||||
block0(v0: i64, v1: i64, v2: i8):
|
||||
v3 = uextend.i64 v2
|
||||
v4 = iconcat v3, v3
|
||||
function %rotl_amt_i128(i128, i8) -> i128 {
|
||||
block0(v0: i128, v1: i8):
|
||||
v2 = uextend.i64 v1
|
||||
v3 = iconcat v2, v2
|
||||
|
||||
v5 = iconcat v0, v1
|
||||
|
||||
v6 = rotl.i128 v5, v4
|
||||
v7, v8 = isplit v6
|
||||
return v7, v8
|
||||
v4 = rotl.i128 v0, v3
|
||||
return v4
|
||||
}
|
||||
; run: %rotl_amt_i128(0x01010101_01010101, 0x01010101_01010101, 9) == [0x02020202_02020202, 0x02020202_02020202]
|
||||
; run: %rotl_amt_i128(0x01010101_01010101, 0x01010101_01010101, 73) == [0x02020202_02020202, 0x02020202_02020202]
|
||||
; run: %rotl_amt_i128(0x01010101_01010101, 0x02020202_02020202, 0) == [0x01010101_01010101, 0x02020202_02020202]
|
||||
; run: %rotl_amt_i128(0x01010101_01010101, 0x03030303_03030303, 128) == [0x01010101_01010101, 0x03030303_03030303]
|
||||
; run: %rotl_amt_i128(0x01010101_01010101_01010101_01010101, 9) == 0x02020202_02020202_02020202_02020202
|
||||
; run: %rotl_amt_i128(0x01010101_01010101_01010101_01010101, 73) == 0x02020202_02020202_02020202_02020202
|
||||
; run: %rotl_amt_i128(0x02020202_02020202_01010101_01010101, 0) == 0x02020202_02020202_01010101_01010101
|
||||
; run: %rotl_amt_i128(0x03030303_03030303_01010101_01010101, 128) == 0x03030303_03030303_01010101_01010101
|
||||
|
||||
function %rotr_amt_i128(i64, i64, i8) -> i64, i64 {
|
||||
block0(v0: i64, v1: i64, v2: i8):
|
||||
v3 = uextend.i64 v2
|
||||
v4 = iconcat v3, v3
|
||||
|
||||
v5 = iconcat v0, v1
|
||||
function %rotr_amt_i128(i128, i8) -> i128 {
|
||||
block0(v0: i128, v1: i8):
|
||||
v2 = uextend.i64 v1
|
||||
v3 = iconcat v2, v2
|
||||
|
||||
v6 = rotr.i128 v5, v4
|
||||
v7, v8 = isplit v6
|
||||
return v7, v8
|
||||
v4 = rotr.i128 v0, v3
|
||||
return v4
|
||||
}
|
||||
; run: %rotr_amt_i128(0x01010101_01010101, 0x01010101_01010101, 9) == [0x80808080_80808080, 0x80808080_80808080]
|
||||
; run: %rotr_amt_i128(0x01010101_01010101, 0x01010101_01010101, 73) == [0x80808080_80808080, 0x80808080_80808080]
|
||||
; run: %rotr_amt_i128(0x01010101_01010101, 0x02020202_02020202, 0) == [0x01010101_01010101, 0x02020202_02020202]
|
||||
; run: %rotr_amt_i128(0x01010101_01010101, 0x03030303_03030303, 128) == [0x01010101_01010101, 0x03030303_03030303]
|
||||
; run: %rotr_amt_i128(0x01010101_01010101_01010101_01010101, 9) == 0x80808080_80808080_80808080_80808080
|
||||
; run: %rotr_amt_i128(0x01010101_01010101_01010101_01010101, 73) == 0x80808080_80808080_80808080_80808080
|
||||
; run: %rotr_amt_i128(0x02020202_02020202_01010101_01010101, 0) == 0x02020202_02020202_01010101_01010101
|
||||
; run: %rotr_amt_i128(0x03030303_03030303_01010101_01010101, 128) == 0x03030303_03030303_01010101_01010101
|
||||
|
||||
Reference in New Issue
Block a user