Compiler relies on RSP being aligned to 16-byte boundary before any CALL to a compiled function, in order to easily align stack objects.
When issuing a syscall with __NR_clone, we get to specify the initial stack pointer for the child thread.
This changeset ensures that the stack pointer specified by our caller (local_clone) is adjusted so that it is properly aligned to 16-byte boundary (as for i386).
Another thing that has been changed: In order to put 0 into RBP, "xor rbp, rbp" can be replaced with "xor ebp, ebp", thus saving one byte of machine code (the REX prefix). Reason: If the destination operand of an instruction is a 32-bit general purpose register, the other 32 bits of the 64-bit general purpose register are automatically filled with zero by the CPU (as per AMD64 documentation).
Thank you for your work and for considering this changeset ! (-:
Compiler relies on RSP being aligned to 16-byte boundary before any CALL to a compiled function, in order to easily align stack objects.
When issuing a syscall with __NR_clone, we get to specify the initial stack pointer for the child thread.
This changeset ensures that the stack pointer specified by our caller (local_clone) is adjusted so that it is properly aligned to 16-byte boundary (as for i386).
Another thing that has been changed: In order to put 0 into RBP, "xor rbp, rbp" can be replaced with "xor ebp, ebp", thus saving one byte of machine code (the REX prefix). Reason: If the destination operand of an instruction is a 32-bit general purpose register, the other 32 bits of the 64-bit general purpose register are automatically filled with zero by the CPU (as per AMD64 documentation).
Thank you for your work and for considering this changeset ! (-: