This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] re-enable -mabi=no-altivec, use -mabi=altivec as default for powerpc-linux
On Wed, 2008-02-20 at 14:53 -0500, David Edelsohn wrote:
> >>>>> Janis Johnson writes:
>
> Janis> VRSAVE has never been set for -m32. Changing that can wait for the
> Janis> updated PowerPC ELF ABI; it's not in the current ABI.
>
> Janis> VRSAVE has always been set for -m64, as has rs6000_altivec_abi (a
> Janis> mistake, as it ignored -mabi=no-altivec). There's also an option
> Janis> -mvrsave that should be consulted. How's this, to not set it for
> Janis> -m32 but set it based on the AltiVec ABI for -m64 unless there's
> Janis> been an explicit option?
>
> Janis> /* The AltiVec ABI is the default for PowerPC-64 GNU/Linux. For
> Janis> PowerPC-32 GNU/Linux, -maltivec implies the AltiVec ABI. It can
> Janis> be explicitly overridden in either case. */
> Janis> if (TARGET_ELF)
> Janis> {
> Janis> if (!rs6000_explicit_options.altivec_abi
> Janis> && (TARGET_64BIT || TARGET_ALTIVEC))
> Janis> rs6000_altivec_abi = 1;
>
> Janis> if (!rs6000_explicit_options.vrsave && TARGET_64BIT)
> Janis> TARGET_ALTIVEC_VRSAVE = rs6000_altivec_abi;
> Janis> }
>
> The patch should follow the ABI. Please change this back so that
> VRSAVE always is set, but only set when Altivec ABI is set. In other
> words, please remove the TARGET_64BIT test and add a comment about what
> the
>
> TARGET_ALTIVEC_VRSAVE = rs6000_altivec_abi;
>
> logic is accomplishing.
Sorry for being so obtuse, but is this what you want? The comment
at the top explains the decision whether to use the AltiVec ABI:
/* The AltiVec ABI is the default for PowerPC-64 GNU/Linux. For
PowerPC-32 GNU/Linux, -maltivec implies the AltiVec ABI. It can
be explicitly overridden in either case. */
if (TARGET_ELF)
{
if (!rs6000_explicit_options.altivec_abi
&& (TARGET_64BIT || TARGET_ALTIVEC))
rs6000_altivec_abi = 1;
if (!rs6000_explicit_options.vrsave && rs6000_altivec_abi == 1)
TARGET_ALTIVEC_VRSAVE = 1;
}
Janis