On Mon, Jan 18, 2016 at 2:35 PM, Ronald S. Bultje <[email protected]> wrote: > On Sun, Jan 17, 2016 at 6:21 PM, Henrik Gramner <[email protected]> wrote: >> @@ -386,8 +386,10 @@ DECLARE_REG_TMP_SIZE >> 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 >> %if %1 != 0 && required_stack_alignment > STACK_ALIGNMENT >> %if %1 > 0 >> %assign regs_used (regs_used + 1) >> - %elif ARCH_X86_64 && regs_used == num_args && num_args <= 4 + >> UNIX64 * 2 >> - %warning "Stack pointer will overwrite register argument" >> + %endif >> + %if ARCH_X86_64 && regs_used < 5 + UNIX64 * 3 >> + ; Ensure that we don't clobber any registers containing >> arguments >> + %assign regs_used 5 + UNIX64 * 3 > > Why 5 + unix * 3 and not 5 +unix * 2? Isn't unix64 6 regs and win64 4 regs?
Because in the System V ABI, r6 (rax) is used to specify the number of arguments passed in vector registers in vararg functions so we use r7 instead of potentially clobbering it. It's certainly unlikely for it to actually be relevant in handwritten assembly functions, but there's not really any drawback of supporting that use case here (both r6 and r7 are volatile). _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
