public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Default arch on Linux/PowerPC?
@ 2020-04-08  2:36 Jeffrey Walton
  2020-04-08  8:05 ` Jonathan Wakely
  2020-04-08 20:35 ` Segher Boessenkool
  0 siblings, 2 replies; 3+ messages in thread
From: Jeffrey Walton @ 2020-04-08  2:36 UTC (permalink / raw)
  To: gcc-help

Hi Everyone,

I was wondering about this output when using GCC on PowerPC. Why is
GCC advertising Power7 and Power8 when the arch switches to enable
them are not present on Linux?

==========

This is GCC112 on the compile farm. Both GCC 4.8 and 8.3 have the
behavior. Notice there are no options like -maltivec or -mcpu=power8

# GCC 4.8
$ g++ -dM -E - </dev/null | grep -E 'ARCH|ALTIVEC|VSX|CRYPTO'
#define _ARCH_PPCGR 1
#define __ALTIVEC__ 1
#define _ARCH_PPCSQ 1
#define _ARCH_PPC 1
#define _ARCH_PWR4 1
#define _ARCH_PWR5 1
#define _ARCH_PWR6 1
#define _ARCH_PWR7 1
#define _ARCH_PWR8 1
#define _ARCH_PWR5X 1
#define __CRYPTO__ 1
#define __VSX__ 1
#define __APPLE_ALTIVEC__ 1
#define _ARCH_PPC64 1

# GCC 8.3
$ /opt/at12.0/bin/g++ -dM -E - </dev/null | grep -E 'ARCH|ALTIVEC|VSX|CRYPTO'
#define _ARCH_PPCGR 1
#define __ALTIVEC__ 1
#define _ARCH_PPCSQ 1
#define _ARCH_PPC 1
#define _ARCH_PWR4 1
#define _ARCH_PWR5 1
#define _ARCH_PWR6 1
#define _ARCH_PWR7 1
#define _ARCH_PWR8 1
#define _ARCH_PWR5X 1
#define __CRYPTO__ 1
#define __VSX__ 1
#define __APPLE_ALTIVEC__ 1
#define _ARCH_PPC64 1

==========

This is GCC119 on the compile farm. It is an AIX machine with Power8.

# GCC 7.2
$ g++ -dM -E - </dev/null | grep -E 'ARCH|ALTIVEC|VSX|CRYPTO'
#define _ARCH_PPCGR 1
#define _ARCH_PPCSQ 1
#define _ARCH_PPC 1
#define _ARCH_PWR4 1

# GCC 7.2 + Altivec
$ g++ -maltivec -dM -E - </dev/null | grep -E 'ARCH|ALTIVEC|VSX|CRYPTO'
#define _ARCH_PPCGR 1
#define __ALTIVEC__ 1
#define _ARCH_PPCSQ 1
#define _ARCH_PPC 1
#define _ARCH_PWR4 1
#define __APPLE_ALTIVEC__ 1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Default arch on Linux/PowerPC?
  2020-04-08  2:36 Default arch on Linux/PowerPC? Jeffrey Walton
@ 2020-04-08  8:05 ` Jonathan Wakely
  2020-04-08 20:35 ` Segher Boessenkool
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Wakely @ 2020-04-08  8:05 UTC (permalink / raw)
  To: Jeffrey Walton; +Cc: gcc-help

On Wed, 8 Apr 2020 at 03:38, Jeffrey Walton via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> Hi Everyone,
>
> I was wondering about this output when using GCC on PowerPC. Why is
> GCC advertising Power7 and Power8 when the arch switches to enable
> them are not present on Linux?
>
> ==========
>
> This is GCC112 on the compile farm. Both GCC 4.8 and 8.3 have the
> behavior. Notice there are no options like -maltivec or -mcpu=power8

gcc -Q --help=target | fgrep cpu

The compilers on gcc112 are configured for powerpc64le-*-linux which
implies POWER8 because that target isn't supported on POWER7.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Default arch on Linux/PowerPC?
  2020-04-08  2:36 Default arch on Linux/PowerPC? Jeffrey Walton
  2020-04-08  8:05 ` Jonathan Wakely
@ 2020-04-08 20:35 ` Segher Boessenkool
  1 sibling, 0 replies; 3+ messages in thread
From: Segher Boessenkool @ 2020-04-08 20:35 UTC (permalink / raw)
  To: noloader; +Cc: gcc-help

On Tue, Apr 07, 2020 at 10:36:36PM -0400, Jeffrey Walton via Gcc-help wrote:
> This is GCC112 on the compile farm. Both GCC 4.8 and 8.3 have the
> behavior. Notice there are no options like -maltivec or -mcpu=power8

powerpc64le-linux defaults to -mcpu=power8.

> This is GCC119 on the compile farm. It is an AIX machine with Power8.

powerpc-aix defaults to -mcpu=power4.

Things are different still for other configs, and you can override the
defaults at configuration time as well anyway.


Segher

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-08 20:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-08  2:36 Default arch on Linux/PowerPC? Jeffrey Walton
2020-04-08  8:05 ` Jonathan Wakely
2020-04-08 20:35 ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).