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: [PATCH] re-enable -mabi=no-altivec, use -mabi=altivec as default for powerpc-linux


On Mon, 2008-02-18 at 17:32 -0800, Janis Johnson wrote:
> Here's the new version, same as the previous one except that on
> powerpc-linux -maltivec now implies -mabi=altivec, which can be
> overridden.  Testing is in progress, but if there are issues
> with this version I'd like to hear about them early so I can try
> again.
> 
> As far as we know the only incompatibility this introduces is with
> passing generic vectors, and that is documented to be unstable.
> This version doesn't cause gcc.c-torture/execute/va-arg-25.c to fail.
> 
> OK for trunk if testing is OK?  The 4.3 branch?  (I'm testing a
> revision from shortly before the branch.)

Testing on powerpc64-linux with bootstrap of all default languages
showed no regressions, although it reminded me that the test
changes in the patch are no longer needed.  I've removed the test
changes below.

OK for mainline?  David approved an earlier version but I'd like
to hear about this one to make sure I got it the way he wants it.

If OK for mainline, OK for 4.3 branch?

Janis
> 
> 2008-02-18  Janis Johnson  <janis187@us.ibm.com>
> 
> 	PR target/34526
> 	* config/rs6000/rs6000.c (rs6000_altivec_abi): Clarify comment.
> 	(rs6000_explicit_options): Split abi into spe_abi and altivec_abi.
> 	(rs6000_override_options): Set altivec_abi as default, not override,
> 	for 64-bit GNU/Linux; for 32-bit GNU/Linux default to altivec_abi for
> 	TARGET_ALTIVEC; use spe_abi.
> 	(rs6000_handle_option): Use spe_abi and altivec_abi.

> Index: gcc/config/rs6000/rs6000.c
> ===================================================================
> --- gcc/config/rs6000/rs6000.c	(revision 132390)
> +++ gcc/config/rs6000/rs6000.c	(working copy)
> @@ -171,7 +171,7 @@
>  /* IEEE quad extended precision long double. */
>  int rs6000_ieeequad;
> 
> -/* Whether -mabi=altivec has appeared.  */
> +/* Nonzero to use AltiVec ABI.  */
>  int rs6000_altivec_abi;
> 
>  /* Nonzero if we want SPE ABI extensions.  */
> @@ -262,7 +262,8 @@
>  struct {
>    bool aix_struct_ret;		/* True if -maix-struct-ret was used.  */
>    bool alignment;		/* True if -malign- was used.  */
> -  bool abi;			/* True if -mabi=spe/nospe was used.  */
> +  bool spe_abi;			/* True if -mabi=spe/no-spe was used.  */
> +  bool altivec_abi;		/* True if -mabi=altivec/no-altivec used.  */
>    bool spe;			/* True if -mspe= was used.  */
>    bool float_gprs;		/* True if -mfloat-gprs= was used.  */
>    bool isel;			/* True if -misel was used. */
> @@ -1590,10 +1591,15 @@
>    if (TARGET_XCOFF && TARGET_ALTIVEC)
>      rs6000_altivec_abi = 1;
> 
> -  /* Set Altivec ABI as default for PowerPC64 Linux.  */
> -  if (TARGET_ELF && TARGET_64BIT)
> +  /* 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)
>      {
> -      rs6000_altivec_abi = 1;
> +      if (!rs6000_explicit_options.altivec_abi
> +	  && (TARGET_64BIT || TARGET_ALTIVEC))
> +	rs6000_altivec_abi = 1;
> +
>        TARGET_ALTIVEC_VRSAVE = 1;
>      }
> 
> @@ -1638,7 +1644,7 @@
>        /* For the powerpc-eabispe configuration, we set all these by
>  	 default, so let's unset them if we manually set another
>  	 CPU that is not the E500.  */
> -      if (!rs6000_explicit_options.abi)
> +      if (!rs6000_explicit_options.spe_abi)
>  	rs6000_spe_abi = 0;
>        if (!rs6000_explicit_options.spe)
>  	rs6000_spe = 0;
> @@ -2188,19 +2194,20 @@
>      case OPT_mabi_:
>        if (!strcmp (arg, "altivec"))
>  	{
> -	  rs6000_explicit_options.abi = true;
> +	  rs6000_explicit_options.altivec_abi = true;
>  	  rs6000_altivec_abi = 1;
> +
> +	  /* Enabling the AltiVec ABI turns off the SPE ABI.  */
>  	  rs6000_spe_abi = 0;
>  	}
>        else if (! strcmp (arg, "no-altivec"))
>  	{
> -	  /* ??? Don't set rs6000_explicit_options.abi here, to allow
> -	     the default for rs6000_spe_abi to be chosen later.  */
> +	  rs6000_explicit_options.altivec_abi = true;
>  	  rs6000_altivec_abi = 0;
>  	}
>        else if (! strcmp (arg, "spe"))
>  	{
> -	  rs6000_explicit_options.abi = true;
> +	  rs6000_explicit_options.spe_abi = true;
>  	  rs6000_spe_abi = 1;
>  	  rs6000_altivec_abi = 0;
>  	  if (!TARGET_SPE_ABI)
> @@ -2208,7 +2215,7 @@
>  	}
>        else if (! strcmp (arg, "no-spe"))
>  	{
> -	  rs6000_explicit_options.abi = true;
> +	  rs6000_explicit_options.spe_abi = true;
>  	  rs6000_spe_abi = 0;
>  	}
> 



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