This is the mail archive of the gcc-patches@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: [Bug target/14960] -maltivec affects vector return with -mabi=no-altivec





Janis wrote:

> Imagine this scenario:

>  a library built with -mno-altivec, and within this library a
>  function which accepts vectors in a variable-length argument list

>  an application built with -maltivec that passes vectors to that
>  library function


> This is required for the dreaded vfprintf and presumably would someday
> be used for other library functionionality as well.  I've attached a
> small test case that compiles the caller and callee in various ways.
> On powerpc64-linux with -m64 the test passes except when the callee is
> compiled with "-maltivec -mabi=no-altivec".  For -m32 it fails except
> when the callee is compiled with "-maltivec -mabi=altivec", meaning that
> with -m32 there is no successful way to build the library for the
> scenario above.  This testing used mainline plus recent Altivec patches
> from Hartmut and Fariborz.

For m64, any 'normal' library is build with -mno-altivec -mabi=altivec.
This is the default when compiling -m64 on ppc64 linux.
Even if that library has the fprintf for vector registers, which I once
did for glibc, you don't need to set any explicit ...altivec compiler
directives. The programs (caller of libraries) dealing with AltiVec
register and running only on AltiVec HW need -maltivec turned on.

> Which combinations of options are supposed to work for the two pieces
> of this test?  Is the answer the same for -m32 and -m64?  I would think
> that as long as the same ABI is used for both, it should work.

I think, we should forbid to use AltiVec when turning of the AltiVec ABI.
I does not make any sense to allow this combination (at least for ppc64
bit).
And stronger, it does not hurt to have AltiVec ABI always turned on for
programs running on HW without AltiVec, since it does nothing beside having
bigger alignments. That's the reason to have this as default for ppc64
linux.
Maybe we should not have -mabi=altivec at all.

      regards, Hartmut


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