------- Comment #8 from janis at gcc dot gnu dot org  2008-02-07 02:04 -------
Some experimentation shows how GCC is passing and returning non-hardware
vectors for powerpc*-linux:

-m32 (for trunk and 4.0)
  pass struct by reference (copy in caller's frame)
  return struct in memory using address in hidden first argument

  -mno-altivec -mabi=no-altivec         pass vector argument by reference
  -mno-altivec -mabi=no-altivec         return vector result via hidden arg 1

  -maltivec -mabi=no-altivec            pass vector argument by reference
  -maltivec -mabi=no-altivec            return vector result in r3-r6

  -mno-altivec -mabi=altivec            pass vector argument in caller's frame
  -mno-altivec -mabi=altivec            return vector result in r3-r6


-m64
  pass struct in argument registers
  return struct in memory using address in hidden first argument

  -mno-altivec -mabi=altivec            pass vector argument in caller's frame
  -mno-altivec -mabi=altivec            return vector result in r3-r4

  [processing -mabi=no-altivec has been broken since 4.1]

-m64 with 4.0
  -mno-altivec -mabi=no-altivec         pass vector argument by reference
  -mno-altivec -mabi=no-altivec         return vector result via hidden arg 1

  -maltivec -mabi=no-altivec            pass vector argument by reference
  -maltivec -mabi=no-altivec            return vector result via hidden arg 1

  -mno-altivec -mabi=altivec            pass vector argument in caller's frame
  -mno-altivec -mabi=altivec            return vector result in r3-r4

This is a mess.  I'd like to change the -m32 behavior to pass non-hardware
vectors by reference and to return them via a pointer in the hidden first
argument.  For -m64 I'd return them via a pointer in the hidden first argument,
but I'm not sure whether to pass them by reference, or in argument registers
like aggregates.  Suggestions?


-- 

janis at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jsm28 at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34526

Reply via email to