https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101865

--- Comment #8 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to HaoChen Gui from comment #6)
> (In reply to Segher Boessenkool from comment #5)
> > (In reply to HaoChen Gui from comment #4)
> > > I wonder if it's a Power8 architecture when those 6 options are all
> > > disabled. Or it is regressed to Power7? The "_ARCH_PWR8" represents the
> > > hardware architecture or the ISA it can be taken?
> > 
> > It says what version of the ISA is effective.  It should correspond to the
> > -mcpu= used.
> > 
> > Even if it would be possible to use -mcpu=power8 and then other command line
> > flags that set everything back to it being just like Power7 (architecturally
> > that is, ignoring scheduling etc.), we should still define _ARCH_PWR8.
> 
> Thanks for your comments. If it's architecturally Power7, why we still need
> to define _ARCH_PWR8. Does _ARCH_PWR8 impact anything during the compiling?
> Could we just use mcpu instead? Seems _ARCH_PWR8 only affects instruction
> selection right now.

No, it is *not* architecturally a p7.  A p8 is a p8, whether you manage to
disable everything that makes it differ from a p7 or not.

The _ARCH_PWRn predefines are made by the compiler based on the -mcpu= flag
it is provided, so that user code can change what it does if it wants, as
Tulio says.  The define is not used by the compiler itself, it has more direct
ways of getting this info (TARGET_* macros for example).

Reply via email to