Question about STD64 ABI

bodrato at bodrato at
Fri Mar 30 08:06:21 CEST 2012


I played a little bit with mpn/x86_64/sqr_basecase.asm, it contains
instructions like:

	add	$-40, %rsp
	mov	%rbx, 32(%rsp)
	mov	%rbp, 24(%rsp)
	mov	%r12, 16(%rsp)
	mov	%r13, 8(%rsp)
	mov	%r14, (%rsp)

>From the document I've found, about the ABI [*], I read:

"The 128-byte area beyond the location pointed to by %rsp is considered to
be reserved and shall not be modified by signal or interrupt handlers.
Therefore, functions may use this area for temporary data that is not
needed across function calls. In particular, leaf functions may use this
area for their entire stack frame, rather than adjusting the stack pointer
in the prologue and epilogue."

If I understand correctly, this means that we can directly use:

	mov	%rbx, -8(%rsp)
	mov	%rbp, -16(%rsp)
	mov	%r12, -24(%rsp)
	mov	%r13, -32(%rsp)
	mov	%r14, -40(%rsp)

DOS64 compatibility apart, is there any other reason not to use the second


Best regards,


More information about the gmp-devel mailing list