A lightweight WebAssembly runtime that is fast, secure, and standards-compliant
cranelift: aarch64: pass args after a stack-passed i128 on the stack (#14956)
Pujitha Paladugu157428df4d98
diff --git a/cranelift/codegen/src/isa/aarch64/abi.rs b/cranelift/codegen/src/isa/aarch64/abi.rsindex e0ce6370fd..32ad4a1786 100644--- a/cranelift/codegen/src/isa/aarch64/abi.rs+++ b/cranelift/codegen/src/isa/aarch64/abi.rs@@ -336,6 +336,18 @@ impl ABIMachineSpec for AArch64MachineDeps {remaining_reg_vals -= 2;continue;}++ // (Stage C.13) When a composite argument is passed on the+ // stack, the NGRN is set to 8, so all later integer+ // arguments are passed on the stack as well.+ if args_or_rets == ArgsOrRets::Args+ && matches!(+ call_conv,+ isa::CallConv::SystemV | isa::CallConv::AppleAarch64+ )+ {+ next_xreg = max_per_class_reg_vals;+ }} else {// Single Register parameterslet rc = rcs[0];diff --git a/cranelift/filetests/filetests/isa/aarch64/call.clif b/cranelift/filetests/filetests/isa/aarch64/call.clifindex 89d66b3500..c22a3206c8 100644--- a/cranelift/filetests/filetests/isa/aarch64/call.clif+++ b/cranelift/filetests/filetests/isa/aarch64/call.clif@@ -993,3 +993,48 @@ block0(v0: f128, v1: f128):; mov v0.16b, v1.16b; ret++function %i128_on_stack_then_i64(i64, i64, i64, i64, i64, i64, i64, i128, i64) -> i64 system_v {+block0(v0: i64, v1: i64, v2: i64, v3: i64, v4: i64, v5: i64, v6: i64, v7: i128, v8: i64):+ return v8+}++; VCode:+; stp fp, lr, [sp, #-16]!+; mov fp, sp+; block0:+; ldr x0, [sp, #32]+; ldp fp, lr, [sp], #16+; ret+;+; Disassembled:+; block0: ; offset 0x0+; stp x29, x30, [sp, #-0x10]!+; mov x29, sp+; block1: ; offset 0x8+; ldur x0, [sp, #0x20]+; ldp x29, x30, [sp], #0x10+; ret++function %i128_on_stack_then_i64_apple(i64, i64, i64, i64, i64, i64, i64, i128, i64) -> i64 apple_aarch64 {+block0(v0: i64, v1: i64, v2: i64, v3: i64, v4: i64, v5: i64, v6: i64, v7: i128, v8: i64):+ return v8+}++; VCode:+; stp fp, lr, [sp, #-16]!+; mov fp, sp+; block0:+; ldr x0, [sp, #32]+; ldp fp, lr, [sp], #16+; ret+;+; Disassembled:+; block0: ; offset 0x0+; stp x29, x30, [sp, #-0x10]!+; mov x29, sp+; block1: ; offset 0x8+; ldur x0, [sp, #0x20]+; ldp x29, x30, [sp], #0x10+; ret+