x86-64 Windows fastcall ABI support.
This adds support for the "fastcall" ABI, which is the native C/C++ ABI on Windows platforms on x86-64. It is similar to but not exactly like System V; primarily, its argument register assignments are different, and it requires stack shadow space. Note that this also adjusts the handling of multi-register values in the shared ABI implementation, and with this change, adjusts handling of `i128`s on *both* Fastcall/x64 *and* SysV/x64 platforms. This was done to align with actual behavior by the "rustc ABI" on both platforms, as mapped out experimentally (Compiler Explorer link in comments). This behavior is gated under the `enable_llvm_abi_extensions` flag. Note also that this does *not* add x64 unwind info on Windows. That will come in a future PR (but is planned!).
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
test compile
|
||||
set enable_llvm_abi_extensions=true
|
||||
target x86_64
|
||||
feature "experimental_x64"
|
||||
|
||||
@@ -941,17 +942,17 @@ block0(v0: i128, v1: i128, v2: i64, v3: i128, v4: i128, v5: i128):
|
||||
v11 = iadd.i128 v9, v10
|
||||
return v11
|
||||
|
||||
; check: movq %rsp, %rbp
|
||||
; check: pushq %rbp
|
||||
; nextln: movq %rsp, %rbp
|
||||
; nextln: subq $$16, %rsp
|
||||
; nextln: movq %r12, 0(%rsp)
|
||||
; nextln: movq %r13, 8(%rsp)
|
||||
; nextln: virtual_sp_offset_adjust 16
|
||||
; nextln: movq 16(%rbp), %r9
|
||||
; nextln: movq 24(%rbp), %r10
|
||||
; nextln: movq 32(%rbp), %r12
|
||||
; nextln: movq 40(%rbp), %r11
|
||||
; nextln: movq 48(%rbp), %rax
|
||||
; nextln: movq 56(%rbp), %r13
|
||||
; nextln: movq 16(%rbp), %r10
|
||||
; nextln: movq 24(%rbp), %r12
|
||||
; nextln: movq 32(%rbp), %r11
|
||||
; nextln: movq 40(%rbp), %rax
|
||||
; nextln: movq 48(%rbp), %r13
|
||||
; nextln: addq %rdx, %rdi
|
||||
; nextln: adcq %rcx, %rsi
|
||||
; nextln: xorq %rcx, %rcx
|
||||
@@ -989,10 +990,10 @@ block0(v0: i128):
|
||||
; nextln: movq %r10, 16(%rsi)
|
||||
; nextln: movq %r11, 24(%rsi)
|
||||
; nextln: movq %r12, 32(%rsi)
|
||||
; nextln: movq %r13, 48(%rsi)
|
||||
; nextln: movq %r14, 56(%rsi)
|
||||
; nextln: movq %rdi, 64(%rsi)
|
||||
; nextln: movq %rbx, 72(%rsi)
|
||||
; nextln: movq %r13, 40(%rsi)
|
||||
; nextln: movq %r14, 48(%rsi)
|
||||
; nextln: movq %rdi, 56(%rsi)
|
||||
; nextln: movq %rbx, 64(%rsi)
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user