GOARCH values for PowerPC

552 views
Skip to first unread message

lab...@linux.vnet.ibm.com

unread,
Nov 17, 2014, 2:26:55 PM11/17/14
to golan...@googlegroups.com
Hi,

This question started out with this issue https://code.google.com/p/go/issues/detail?id=8654 but Ian asked that I post this question here.

The problem now is that the golang implementation for PowerPC on the development branch dev.power64 is setting GOARCH to power64 for PowerPC64 big endian and power64le for PowerPC little endian.  For gccgo GOARCH is set to ppc64 for PowerPC 64 big and little endian (i.e., no distinction)

There were two requests:

- Make the GOARCH values consistent between the gc and gccgo implementations, and in particular provide different names for BE & LE on gccgo
- Use GOARCH values for PowerPC that are commonly used and recognized rather than defining a new name for PowerPC that has never been used before (as is the case with power64 and power64le)

Suggested:

powerpc for PowerPC 32 bit
powerpc64 for PowerPC 64 bit big endian
powerpc64le for PowerPC 64 bit little endian

Feedback please.

Thanks

- Lynn

Russ Cox

unread,
Nov 17, 2014, 3:49:27 PM11/17/14
to lab...@linux.vnet.ibm.com, golang-dev
I looked into this a while back, and eventually I decided to just keep using what gc was already using, since gccgo must change anyway (it can't use the same name for big and little endian). The ISA manual PDF from IBM that I am looking at (describing the 64-bit system) says "Power ISA" not "PowerPC ISA". The only times that "PowerPC" appears are for describing the 32-bit ISA. So it seems like "powerpc64" is actually incorrect (or at least deprecated), in addition to being a longer name than necessary.

That is, I intend to (continue to) use power64 and power64le. If we ever get a 32-bit port then I'd use plain 'power', as Plan 9 did (we haven't deviated from Plan 9 yet on these names, fwiw).

Russ

Lynn A. Boger

unread,
Nov 18, 2014, 8:30:59 AM11/18/14
to Michael Ellerman, golan...@googlegroups.com
Yes that would be a good choice too.

On 11/18/2014 12:58 AM, Michael Ellerman wrote:
> I'd suggest using the same names as uname -m, ie:
>
> ppc
> ppc64
> ppc64le
>
> cheers
>
>
>

lab...@linux.vnet.ibm.com

unread,
Nov 18, 2014, 8:32:18 AM11/18/14
to golan...@googlegroups.com, lab...@linux.vnet.ibm.com
Is there any user documentation for the Plan9 compiler that is available on PowerPC 64 bit?

Russ Cox

unread,
Nov 18, 2014, 10:08:49 AM11/18/14
to lab...@linux.vnet.ibm.com, golang-dev
On Tue, Nov 18, 2014 at 8:32 AM, <lab...@linux.vnet.ibm.com> wrote:
Is there any user documentation for the Plan9 compiler that is available on PowerPC 64 bit?

No, there is no documentation specific to 64-bit Power. That port was done by Vita Nuova as part of Inferno. There is a brief description of the 32-bit Power PC support in the Plan 9 assembler doc at http://plan9.bell-labs.com/sys/doc/asm.html (but the gc toolchain doesn't target that).

Russ

Michael Ellerman

unread,
Nov 18, 2014, 11:51:49 AM11/18/14
to lab...@linux.vnet.ibm.com, golan...@googlegroups.com
On Mon, 2014-11-17 at 11:26 -0800, lab...@linux.vnet.ibm.com wrote:

Russ Cox

unread,
Nov 18, 2014, 12:17:37 PM11/18/14
to Lynn A. Boger, Michael Ellerman, golang-dev
Okay, we can use ppc64 and ppc64le, to match GCC and Linux and to avoid any possible brand name confusion.

ron minnich

unread,
Nov 18, 2014, 12:28:46 PM11/18/14
to Russ Cox, Lynn A. Boger, Michael Ellerman, golang-dev
I got a little confused by the bug report and the discussion. power and powerpc are distinctly different CPUs. I had assumed the new go target was power? Or are you targeting a common subset of the ISA?

ron

On Tue Nov 18 2014 at 9:17:34 AM Russ Cox <r...@golang.org> wrote:
Okay, we can use ppc64 and ppc64le, to match GCC and Linux and to avoid any possible brand name confusion.

--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ian Taylor

unread,
Nov 18, 2014, 12:32:57 PM11/18/14
to ron minnich, Russ Cox, Lynn A. Boger, Michael Ellerman, golang-dev
On Tue, Nov 18, 2014 at 9:28 AM, ron minnich <rmin...@gmail.com> wrote:
>
> I got a little confused by the bug report and the discussion. power and
> powerpc are distinctly different CPUs. I had assumed the new go target was
> power? Or are you targeting a common subset of the ISA?

We are targeting an architecture and, hopefully, all processors that
implement that architecture. If we need to generate different code
for specific processors, we'll do something like the GOARM environment
variable, but I hope that is not necessary.

Do you have a specific concern about setting GOARCH to ppc64/ppc64le?

Ian

Aram Hăvărneanu

unread,
Nov 18, 2014, 12:37:23 PM11/18/14
to Ian Taylor, ron minnich, Russ Cox, Lynn A. Boger, Michael Ellerman, golang-dev
On Tue, Nov 18, 2014 at 6:32 PM, Ian Taylor <ia...@golang.org> wrote:
> We are targeting an architecture

An architecture that is not called ppc64. Okay, let's just emulate
Linux, apparently it's more important than being correct.

--
Aram Hăvărneanu

ron minnich

unread,
Nov 18, 2014, 12:49:55 PM11/18/14
to Ian Taylor, Russ Cox, Lynn A. Boger, Michael Ellerman, golang-dev
On Tue Nov 18 2014 at 9:32:54 AM Ian Taylor <ia...@golang.org> wrote:


Do you have a specific concern about setting GOARCH to ppc64/ppc64le?




My only concern is with the common assumption that power == powerpc. 
Are you testing on Power or PowerPC? There are differences that are visible at user mode. I've seen this bite applications programmers. There are some largish machines at LLNL, some of which are Power, and some of which are PowerPC (Blue Gene series) and the application binaries are definitely not compatible.

The infamous Appendix E (latest rev I can find is 2005) is enlightening. There are differences in what is privileged and non-privileged, for example. 

You're the expert here, and I have not paid much attention the last 10 years, and maybe the Go user-mode code threads the needle and uses a common subset guaranteed to work. I've just been burned by PPC so many times over the years (admittedly at the fimware and kernel levels) I just wanted to check. 

Thanks

ron

 

Ian Taylor

unread,
Nov 18, 2014, 7:06:11 PM11/18/14
to ron minnich, Russ Cox, Lynn A. Boger, Michael Ellerman, golang-dev
On Tue, Nov 18, 2014 at 9:49 AM, ron minnich <rmin...@gmail.com> wrote:
>
> My only concern is with the common assumption that power == powerpc.

That is going to be an issue no matter what we do.

Fortunately I think the differences are generally unimportant for the
Go compiler. At some point we'll have to worry about altivec, vsx,
fsqrt/frsqrt, etc., but not yet.

Ian

Ian Taylor

unread,
Nov 18, 2014, 7:11:01 PM11/18/14
to Aram Hăvărneanu, ron minnich, Russ Cox, Lynn A. Boger, Michael Ellerman, golang-dev
It's also not called power64. ppc64 does at least have this
advantage: the first search result gives you the right information.

Ian

Russ Cox

unread,
Nov 18, 2014, 10:06:46 PM11/18/14
to Ian Taylor, Aram Hăvărneanu, ron minnich, Lynn A. Boger, Michael Ellerman, golang-dev
I admit I'm going to miss seeing that Commodore 64 emulator in all my search results.

Russ

Reply all
Reply to author
Forward
0 new messages