golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.63k stars 17.61k forks source link

all: require POWER8 support for ppc64, to match ppc64le #19074

Closed rsc closed 7 years ago

rsc commented 7 years ago

ppc64le already requires POWER8. In contrast, ppc64 (big-endian) requires only POWER5, because when @minux started the port (as a Google intern) he bought a PowerMac G5, to run Debian and serve as a builder. It served well for that, but now we have access to much faster, more modern POWER8 machines for builders.

@laboger has suggested making big-endian match little-endian, requiring POWER8 for both. This matches current PowerPC 64-bit hardware being built by IBM and be used in general: there are very few people running POWER5 at all, much less running Go on them. I think the PowerMac G5 might be the only readily available such system, and it's really interesting only as a novelty at this point.

I second Lynn's proposal to make the two match, so that the only difference between ppc64 and ppc64le is byte order, not architecture support.

I believe this will mean @minux's PowerMac G5 will no longer be able to run Go, but I think he is the only one with such a system, and it's certainly not his primary system for Go development. I do regret that, but we can't reasonably keep an old architecture going for a single user. (Contrast this with ARMv5 where we pre-announced deprecation and a few companies stepped forward saying they'd like it to stay.)

See original mailing list thread on golang-dev for detail.

zte-majiang commented 5 years ago

We are using e6500/e5500 cores now(and in the next ten years, probably). I believe there are many company other than ZTE are using these cores as well, and they also need golang (and docker? I suppose). So, I think it is definitely worthwhile to support these 'old ppc64'.

We have added basic support for e6500 on golang1.10.3 . We have build docker and it looks fine. Our final goal is to make ppc64 (on e6500/5500) support most features of ppc64le. We are willing to contribute our work to the community. The first patch (about cgo support) have been merged(https://github.com/golang/go/commit/1135071b47b1c9c0069d384c136e94d2883282bc).

To add e6500 support , we do three major changes. The first is adding a new environment variable GOPPC( which should be "" or "e6500"). The second is adding some objabi controlls in cmd/compile/internal/ssa/gen/PPC64.rules (just like what ARM do). The third is adding controls for codes in runtime/math packages. These changes do not break POWER8 support, and are very small (several hundred lines in total). If the community decides to support e6500/e5500, we are happy to contribute these changes. @rsc @minux @friedkiwi @awilfox @glaubitz @DariuszOstolski

awilfox commented 5 years ago

That would be absolutely perfect! Having the ability to select different PPC ISA levels would solve all the issues, still provide the enhancements that upstream seems to desire for POWER8, and allow it to be used on other cores. It should be easy to support e5500 and 970 and P7 with GOPPC in addition to e6500. Thank you for this initial work.

glaubitz commented 5 years ago

@zte-majiang Oh, that's awesome. Thanks a lot for doing this. I agree to what @awilfox says, e5500, 970 and P7 should be added as well!

NattyNarwhal commented 5 years ago

Only nitpick I can see in that patch is that ABI is independent from endianness and POWER6 is a thing too.

zte-majiang commented 5 years ago

happy to see that someone like our work :) To make things more clear: 1 As we are going to support e6500 internally for sure, (if the community thinks that's ok)we are willing to become the maintain team of PPC64 port. 2 In my opinion, golang really need the multiple ISA support as go have being more widely used. The most important work is to create a hierarchy framework for runtime libraries(runtime/math packages) just as what glibc do in the sysdep subdirectory, see examples as below: ./powerpc/powerpc64/multiarch/wcsrchr-power6.c ./powerpc/powerpc64/multiarch/wcsrchr-power7.c ./powerpc/powerpc64/power4/memcmp.S ./powerpc/powerpc64/power5+/fpu/s_ceil.S 3 I agree with @laboger that to support a older ISA in current golang codes need extra work (after we build the hierarchy framework mentioned above, adding ISA support should be very easy and low cost), because codes for different ISA are often mixed together in one file now. So, at the very beginning, only the most wanted ISA should be added. For ppc64, we could just go back to POWER5 at the first step. Anyway, POWER6/POWER7 machines could run POWER5 binaries. @rsc @laboger @glaubitz @NattyNarwhal @awilfox

trex58 commented 5 years ago

@NattyNarwhal : "but using AIX or i instead, and ports don't exist for those (yet?)" :

awilfox commented 5 years ago

Also, the AIX port has been noted as requiring "whatever the Linux/Power port does", so when POWER5 support lands back in golang.org where it belongs, the AIX port should be able to support the many production servers with POWER7 hardware.