On Tue, 2008-02-19 at 01:34 +0000, Joseph S. Myers wrote:
> On Mon, 18 Feb 2008, Janis Johnson wrote:
> 
> > There are lots of inconsistencies in passing generic vectors as arguments
> > and return values, and I'll leave those alone until the PowerPC ELF ABI
> > group decides what to do with them.
> 
> Perhaps you'd care to recommend what the semantics *ought* to be, given 
> that they're currently inconsistent?  The provisional conclusion at the 
> last ABI call was to add ATR-SOFT-VECTOR-64 and ATR-SOFT-VECTOR-128 to the 
> ABI taxonomy, recognising that the existence of vector types does not 
> depend on the existence of vector registers, but we don't have any 
> associated ABI text to describe associated argument-passing and return 
> rules, only that for Altivec and SPE vectors conditional on ATR-ALTIVEC 
> and ATR-SPE respectively.

My recommendation is to have a very simple rule for passing arguments and
returning function results of vector types:

  With vector hardware support and an ABI that supports passing vectors
  in vector registers, vector types that map to hardware types are
  passed and returned in vector registers, except for unnamed arguments.

  In any other situation vector types are passed the same as aggregates
  of the same size.  Those other situations include:

    no vector hardware support
    no ABI support for passing vectors in vector registers
    vector types smaller than hardware vector types
    vector types larger than hardware vector types
    vector types whose elements aren't supported by a hardware type
      (e.g. vector of double for AltiVec)
    unnamed arguments

That ought to be a good starting point for discussion.

Janis

Reply via email to