Skip to content

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

Open
@beetrees

Description

@beetrees
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

Activity

added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Mar 26, 2025
beetrees

beetrees commented on Mar 26, 2025

@beetrees
ContributorAuthor

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

added
A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.
O-PowerPCTarget: PowerPC processors
on Mar 26, 2025
RalfJung

RalfJung commented on Mar 26, 2025

@RalfJung
Member

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

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

beetrees

beetrees commented on Mar 28, 2025

@beetrees
ContributorAuthor

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.

added
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
and removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.C-bugCategory: This is a bug.O-PowerPCTarget: PowerPC processorsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @RalfJung@jieyouxu@rustbot@beetrees

        Issue actions

          PowerPC SPE targets don't have `spe` target feature enabled · Issue #138960 · rust-lang/rust