Skip to content

rustc_target: Use +spe for powerpcspe targets#157137

Open
taiki-e wants to merge 1 commit into
rust-lang:mainfrom
taiki-e:powerpcspe
Open

rustc_target: Use +spe for powerpcspe targets#157137
taiki-e wants to merge 1 commit into
rust-lang:mainfrom
taiki-e:powerpcspe

Conversation

@taiki-e
Copy link
Copy Markdown
Member

@taiki-e taiki-e commented May 30, 2026

LLVM does not infer this from the target name and abi: "spe" is just for cfg. To actually generate the correct instructions for these targets (without -C target-cpu), we need to pass +spe to LLVM.

Fixes #138960
See also #157085
Related #137860

cc @RalfJung
cc @BKPepe (powerpc-unknown-linux-muslspe target maintainer)
cc @glaubitz (who added powerpc-unknown-linux-gnuspe in #48484)
cc @biabbas @hax0kartik (*-wrs-vxworks target maintainers)

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

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 30, 2026
@rustbot rustbot added A-target-feature Area: Enabling/disabling target features like AVX, Neon, etc. O-PowerPC Target: PowerPC processors labels May 30, 2026
@taiki-e taiki-e marked this pull request as ready for review May 30, 2026 03:32
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 30, 2026

These commits modify compiler targets.
(See the Target Tier Policy.)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 30, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 30, 2026

r? @mu001999

rustbot has assigned @mu001999.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 17 candidates

@rustbot

This comment has been minimized.

Copy link
Copy Markdown
Contributor

@hax0kartik hax0kartik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please give me some time to test this out for VxWorks(its Sat here, so 2-3 days)

View changes since this review

@mu001999
Copy link
Copy Markdown
Member

Waiting for the test for VxWorks

@rustbot blocked

@rustbot rustbot added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 30, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 30, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@glaubitz
Copy link
Copy Markdown
Contributor

Interesting, I thought what the spec file is currently doing would be enough to enable SPE support by passing -mspe and telling LLVM to use the powerpc-unknown-linux-gnuspe target.

Thanks for fixing this!

@RalfJung
Copy link
Copy Markdown
Member

RalfJung commented May 30, 2026

@glaubitz it only passes -mspe to the linker, which does nothing for LLVM codegen.
And apparently the LLVM target name on its own does nothing.

@glaubitz
Copy link
Copy Markdown
Contributor

@glaubitz it only passes -mspe to the linker, which does nothing for LLVM codegen. And apparently the LLVM target name on its own does nothing.

Yeah, makes sense. Good catch in any case!

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. O-PowerPC Target: PowerPC processors S-blocked Status: Blocked on something else such as an RFC or other implementation work. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PowerPC SPE targets don't have spe target feature enabled

6 participants