Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change powerpc64 base CPU #59932

Open
sanxiyn opened this issue Apr 13, 2019 · 15 comments
Open

Change powerpc64 base CPU #59932

sanxiyn opened this issue Apr 13, 2019 · 15 comments
Labels
A-target-specs Area: Compile-target specifications C-enhancement Category: An issue proposing an enhancement or a PR with one. O-PowerPC Target: PowerPC processors T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@sanxiyn
Copy link
Member

sanxiyn commented Apr 13, 2019

Currently, following targets use “ppc64” as base CPU: powerpc64-unknown-linux-gnu, powerpc64-unknown-linux-musl, powerpc64-unknown-freebsd.

In LLVM, “ppc64” implies “+altivec”. This is unfortunate, because it means Rust targets are unusable on devices based on PowerPC e5500, which is fairly popular. In particular, #43610 is about QorIQ P5040 SoC using PowerPC e5500 core, and #59040 is about QorIQ T1042 SoC using PowerPC e5500 core.

Thoughts?

@sanxiyn sanxiyn added I-nominated O-PowerPC Target: PowerPC processors T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 13, 2019
@cuviper
Copy link
Member

cuviper commented Apr 13, 2019

I think it would make sense to have a new std-only target for this, similar to how we have i586 for those who can't use i686 for lack of SSE2.

@gnzlbg
Copy link
Contributor

gnzlbg commented Apr 16, 2019

The proposed change is only for the big-endian targets right? That is, the pp64le targets would still be compiled with altivec enabled right ?

@sanxiyn
Copy link
Member Author

sanxiyn commented Apr 16, 2019

Yes, I am not proposing to change powerpc64le targets.

@gnzlbg
Copy link
Contributor

gnzlbg commented Apr 16, 2019

Then this sounds good to me 👍

@nagisa
Copy link
Member

nagisa commented Apr 25, 2019

I would be fine with disabling altivec by default on both ppc64, because it is easier to enable it back for new binaries than to disable it for already-built ones.

Removing I-nominated, because T-compiler don’t have stakeholders in PPC support to the best of my knowledge, so it is impossible for us to arrive at a meaningful decision.

@gnzlbg
Copy link
Contributor

gnzlbg commented Apr 25, 2019

@nagisa is there a group for packagers / distros contributors ? I think this would interest them, since the ppc targets are being shipped for some linux distros.

@cuviper
Copy link
Member

cuviper commented Apr 25, 2019

I would be fine with disabling altivec by default on both ppc64

By "both", do you mean ppc64le too? AFAIK little-endian only became a viable Linux target starting with POWER8, which definitely has Altivec. LLVM also defines the ppc64le CPU as POWER8.

because it is easier to enable it back for new binaries than to disable it for already-built ones.

It's easy to add features for your own code, but std is stuck at the baseline unless you xargo it.

@nagisa
Copy link
Member

nagisa commented Apr 25, 2019

By "both", do you mean ppc64le too?

Yes. Then again, if ppc64le without altivec cannot possibly exist, then the lowest common denominator is good as well. Knowing PPC, though, you can run most of the chips in either endianess.

It's easy to add features for your own code, but std is stuck at the baseline unless you xargo it.

On one hand you’re right, on the other most of std is so generic, that in practice most of the code will end up using whatever features that are enabled for the final artifact. I guess #38913 cannot come soon enough.

@cuviper
Copy link
Member

cuviper commented Apr 25, 2019

Knowing PPC, though, you can run most of the chips in either endianess.

I don't know the full details, but this IBM FAQ says:

Which POWER processors support little endian mode?

The POWER8 processor is the first processor to support little endian and big endian modes equivalently. Although previous generations of the POWER processors had basic little endian functionality, they did not fully implement the necessary instructions in such a way to enable enterprise operating system offerings.

@awilfox
Copy link
Contributor

awilfox commented May 1, 2019

Personally over here at Adélie we only ship BE PPC64, and we enable AltiVec in all of our packages. We may, in the future, offer a separate target for non-AltiVec PPC64 machines. I would definitely support Rust targeting more types of POWER, and I know the FreeBSD people specifically support the e5500s.

As an aside: IBM's really unreliable for endian questions. You can run BE on any generation of POWER, and you can run LE on most generations of POWER. You can even run accelerated LE in KVM on the Power Mac G5, though the firmware itself prevents bare metal LE mode. Not that I really recommend that; BE mode is faster, better, and easier to debug (biased opinion, of course).

@gnzlbg
Copy link
Contributor

gnzlbg commented May 8, 2019

@lu-zero correctly pointed out that we currently do also enable VSX for ppc64le.

@smvoss
Copy link

smvoss commented Oct 1, 2019

Any movement on this?

@jonas-schievink jonas-schievink added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Nov 22, 2019
@sanxiyn sanxiyn added the A-target-specs Area: Compile-target specifications label Feb 26, 2021
@ecnelises
Copy link
Contributor

Power8 fully supports little-endian mode, while Power7 partially supports it. In LLVM little-endian powerpc defaults to Power8, big-endian powerpc defaults to Power7. In theory, a Power8 target can still have no Altivec/VSX support because it can be disabled. I'm curious: isn't directly disabling vector feature or changing target-cpu in rustc command line enough?

@sanxiyn
Copy link
Member Author

sanxiyn commented Apr 16, 2024

No, because prebuilt std is built with Altivec, disabling Altivec from command line does not work.

@ecnelises
Copy link
Contributor

If altivec is disabled in building std, will anything become unavailable? For example, vector types in std::simd or core::arch::powerpc64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-target-specs Area: Compile-target specifications C-enhancement Category: An issue proposing an enhancement or a PR with one. O-PowerPC Target: PowerPC processors T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

8 participants