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

PowerPC SPE targets don't have spe target feature enabled #138960

Open
beetrees opened this issue Mar 26, 2025 · 3 comments
Open

PowerPC SPE targets don't have spe target feature enabled #138960

beetrees opened this issue Mar 26, 2025 · 3 comments
Labels
A-target-feature Area: Enabling/disabling target features like AVX, Neon, etc. C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. O-PowerPC Target: PowerPC processors

Comments

@beetrees
Copy link
Contributor

I tried this code when targeting any of the PowerPC SPE targets such as powerpc-unknown-linux-muslspe (compiler explorer):

pub fn add(x: f32, y: f32) -> f32 {
    x + y
}

I expected to see this happen: The assembly to use SPE instructions as this is an SPE target.

Instead, this happened: The assembly uses regular PowerPC FPU floating point instructions, as none of the three powerpc-*spe targets actually have the spe target feature enabled. According to the Debian PowerPCSPEPort wiki page, PowerPC SPE lacks the standard PowerPC FPU, and the Signal Processing Engine (SPE) Programming Environments Manual doesn't list fadds (which the targets currently compile the x + y to) as an SPE instruction, so the status quo is almost certainly incorrect.

cc @BKPepe as target maintainer of powerpc-unknown-linux-muslspe. Also cc @glaubitz who added powerpc-unknown-linux-gnuspe in #48484 and @BaoshanPang who added powerpc-wrs-vxworks-spe in #61946, as neither of those two targets have any target maintainers.

Meta

rustc --version --verbose:

rustc 1.87.0-nightly (aa8f0fd71 2025-03-23)
binary: rustc
commit-hash: aa8f0fd7163a2f23aa958faed30c9c2b77b934a5
commit-date: 2025-03-23
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.1
@beetrees beetrees added the C-bug Category: This is a bug. label Mar 26, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 26, 2025
@beetrees
Copy link
Contributor Author

@rustbot label +O-PowerPC +A-target-feature

@rustbot rustbot added A-target-feature Area: Enabling/disabling target features like AVX, Neon, etc. O-PowerPC Target: PowerPC processors labels Mar 26, 2025
@RalfJung
Copy link
Member

RalfJung commented Mar 26, 2025

Hm yeah, that's odd... we would have expected +spe to be listed here, right?

features: "+secure-plt,+msync".into(),

@beetrees
Copy link
Contributor Author

Yes. The spe feature will also be enabled when using a SPE target CPU such as e500 (none of the SPE targets currently specify a default target CPU so they all default to the generic PowerPC one), but being explicit would definitely be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-target-feature Area: Enabling/disabling target features like AVX, Neon, etc. C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. O-PowerPC Target: PowerPC processors
Projects
None yet
Development

No branches or pull requests

3 participants