On Thu, Nov 14, 2019 at 06:14:47PM -0500, Michael Meissner wrote:
>       * config/rs6000/linux64.h (TARGET_PREFIXED_ADDR_DEFAULT): Enable
>       prefixed addressing by default.
>       (TARGET_PCREL_DEFAULT): Enable pc-relative addressing by default.
>       * config/rs6000/rs6000-cpus.def (ISA_FUTURE_MASKS_SERVER): Only
>       enable -mprefixed-addr and -mpcrel if the OS tm.h says to enable
>       it.
>       (ADDRESSING_FUTURE_MASKS): New mask macro.
>       (OTHER_FUTURE_MASKS): Use ADDRESSING_FUTURE_MASKS.
>       * config/rs6000/rs6000.c (TARGET_PREFIXED_ADDR_DEFAULT): Do not
>       enable -mprefixed-addr unless the OS tm.h says to.
>       (TARGET_PCREL_DEFAULT): Do not enable -mpcrel unless the OS tm.h
>       says to.
>       (rs6000_option_override_internal): Do not enable -mprefixed-addr
>       or -mpcrel unless the OS tm.h says to enable it.  Add more checks
>       for -mcpu=future.

> +/* Support for a future processor's features.  The prefixed and pc-relative
> +   addressing bits are not added here.  Instead, rs6000.c adds them if the OS
> +   tm.h says that it supports the addressing modes.  */

This comment could be a lot clearer.  It should just say it is about
ADRESSING_FUTURE_MASKS, and not mention rs6000.c at all.

>  #define ISA_FUTURE_MASKS_SERVER      (ISA_3_0_MASKS_SERVER                   
> \
> -                              | OPTION_MASK_FUTURE                   \
> +                              | OPTION_MASK_FUTURE)
> +
> +/* Addressing related flags on a future processor.  These flags are broken 
> out
> +   because not all targets will support either pc-relative addressing, or 
> even
> +   prefixed addressing, and we want to clear all of the addressing bits
> +   on targets that cannot support prefixed/pcrel addressing.  */
> +#define ADDRESSING_FUTURE_MASKS      (OPTION_MASK_PCREL                      
> \
>                                | OPTION_MASK_PREFIXED_ADDR)

> --- gcc/config/rs6000/rs6000.c        (revision 278181)
> +++ gcc/config/rs6000/rs6000.c        (working copy)
> @@ -98,6 +98,16 @@
>  #endif
>  #endif
>  
> +/* Set up the defaults for whether prefixed addressing is used, and if it is
> +   used, whether we want to turn on pc-relative support by default.  */
> +#ifndef TARGET_PREFIXED_ADDR_DEFAULT
> +#define TARGET_PREFIXED_ADDR_DEFAULT 0
> +#endif
> +
> +#ifndef TARGET_PCREL_DEFAULT
> +#define TARGET_PCREL_DEFAULT         0
> +#endif

"DEFAULT" is a bad name for this?  "SUPPORTED"?

We do *not* turn on prefixed or pcrel by default on most linux64 targets
-- most of those are p9 or p8 or p7 or older!  So "SUPPORTED" isn't good
either.  SUPPORTED_BY_OS?

A name like "XXX_DEFAULT" inevitably means we will later get an
"XXX_REALLY_DEFAULT" macro as well.  Not good.

> +  /* Enable prefixed addressing and pc-relative addressing on 64-bit ELF v2
> +     systems if the OS tm.h file says that it is supported and the user did 
> not
> +     explicitly use -mprefixed-addr or -mpcrel.  At the present time, only
> +     64-bit Linux enables this.


> +      /* Enable defaults if desired.  */

This comment does not say anything.  Please say something like "Enable
PCREL and PREFIXED if [...]"

> +      else
> +     {
> +       if (!explicit_prefixed
> +           && (TARGET_PREFIXED_ADDR_DEFAULT
> +               || TARGET_PCREL
> +               || TARGET_PCREL_DEFAULT))
> +         rs6000_isa_flags |= OPTION_MASK_PREFIXED_ADDR;
> +
> +       if (!explicit_pcrel && TARGET_PCREL_DEFAULT
> +           && TARGET_CMODEL == CMODEL_MEDIUM)
> +         rs6000_isa_flags |= OPTION_MASK_PCREL;
> +     }
> +    }

... and I don't understand this code.  If you use -mpcrel but you do not
have the medium model, you _do_ get prefixed but you do _not_ get pcrel?
And this all quietly?


Segher

Reply via email to