This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC assmbler for powerpc-eabi


marian <marian@jozep.com.au> writes:

> 	crxor 6,6,6	<<<< WHY <<<<<<
> 	bl sprintf

The various PPC ABIs are unreasonably complicated.  The crxor
instruction is required by some of them.  It is used when calling a
function which takes a variable number of arguments.  crxor is used to
indicate that no floating point arguments were passed.  creqv is used to
indicate that at least one floating point argument was passed.  The
varargs function checks the condition register to see whether it has to
push the floating point parameter registers on the stack in order to let
va_arg work correctly.

Since most varargs functions do not have any floating point arguments,
it is usually a good tradeoff to have one exact instruction in the
caller to save several memory operations in the callee.

If you prefer a different tradeoff, you can fool with the -mcall-XXX
options.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]