> On Tue, Jun 10, 2008 at 4:32 AM, Jan Hubicka <[EMAIL PROTECTED]> wrote:
> >>
> >> I don't understand why you want to pass __m256 and 256-bit vector values
> >> to anonymous arguments in registers.  The only thing the vararg functions
> >> would do with it would be save it somewhere on the stack.
> >> Given the x86_64 ABI, you can't expect calling an implicitly
> >> prototyped or non-vararg prototyped function which is actually
> >> defined as vararg function (as %rax wouldn't be properly initialized),
> >
> > Unprototyped functions calls all get rax set. If calle is variadic,
> > things still work.  Sure, for __m256 we can also declare prototypes for
> > variadic functions mandatory and simply pass things on stack.
> >
> 
> Do unprototyped functions calls work with __m128 and vararg on ia32?
> I don't think it works since the first 3 __m128 were passed in registers,
> but everything is passed on stack for vararg. If we require prototypes
> for ia32, we should do the same for x86-64.

unprototyped varargs don't work for __m128 or regparm conventions on
ia32 indeed.

Main motivation for getting varargs to work right on x86-64 with
unprototyped functions was to make legacy codebases using FP operands
happy.  There are no legacy codebases using vector extensions (I hope :)
so this motivation is not that important.  We might however want to do
consistent here.  So I guess we now have following choices:

 1) make __m256 passed on stack on variadic functions and in registers
 otherwse. Then we don't need to worry about varargs changes at all.
 This will break unprototyped calls.
 2) extend rax to pass info about if __m256 registers are present and
 upper half needs to be saved.
 This will break passing __m256 arguments to functions with prologues
 compiled with legacy compiler that will do wild jump.  All other cases
 should work
 3) Save upper halves whenever we want to save SSE registers.  This will
 break calling variadic functions compiled with __m256 support in.

I guess either 1) or 2) is fine for me, as I told earlier, I am not big
fan of 3).  I guess 1) is easier and probably make more sense?

Honza
> 
> -- 
> H.J.

Reply via email to