Insert conversion code that reconstructs the original function argument types from the legalized ABI signature. Add abi::legalize_abi_value(). This function is used when adapting code to a legalized function signature.
35 lines
937 B
Plaintext
35 lines
937 B
Plaintext
; Test the legalization of function signatures.
|
|
test legalizer
|
|
isa riscv
|
|
|
|
; regex: V=v\d+
|
|
; regex: VX=vx\d+
|
|
|
|
function f(i32) {
|
|
sig0 = signature(i32) -> i32
|
|
|
|
; check: sig0 = signature(i32 [%x10]) -> i32 [%x10]
|
|
|
|
sig1 = signature(i64) -> b1
|
|
; check: sig1 = signature(i32 [%x10], i32 [%x11]) -> b1 [%x10]
|
|
|
|
; The i64 argument must go in an even-odd register pair.
|
|
sig2 = signature(f32, i64) -> f64
|
|
; check: sig2 = signature(f32 [%f10], i32 [%x12], i32 [%x13]) -> f64 [%f10]
|
|
|
|
; Spilling into the stack args.
|
|
sig3 = signature(f64, f64, f64, f64, f64, f64, f64, i64) -> f64
|
|
; check: sig3 = signature(f64 [%f10], f64 [%f11], f64 [%f12], f64 [%f13], f64 [%f14], f64 [%f15], f64 [%f16], i32 [0], i32 [4]) -> f64 [%f10]
|
|
|
|
ebb0(v0: i32):
|
|
return_reg v0
|
|
}
|
|
|
|
function int_split_args(i64) -> i64 {
|
|
ebb0(v0: i64):
|
|
; check: $ebb0($(v0l=$VX): i32, $(v0h=$VX): i32):
|
|
; check: iconcat_lohi $v0l, $v0h
|
|
v1 = iadd_imm v0, 1
|
|
return v0
|
|
}
|