Skip to content

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

Open
@beetrees

Description

@beetrees

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

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

    Issue actions