Skip to content

Require windowed (and exception) for Xtensa ABI - #160643

Open
MabezDev wants to merge 1 commit into
rust-lang:mainfrom
esp-rs:xtensa-abi-require-windowed
Open

Require windowed (and exception) for Xtensa ABI#160643
MabezDev wants to merge 1 commit into
rust-lang:mainfrom
esp-rs:xtensa-abi-require-windowed

Conversation

@MabezDev

@MabezDev MabezDev commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Rust only supports the windowed Xtensa calling convention on all upstream targets (esp32 family). Mark windowed and exception as ABI-required features so a mismatched -Ctarget-cpu cannot silently change the ABI.

Discussion: #160530 (comment)

  • I did not use an LLM to create a change in this PR.
  • I used an LLM to create a change in this PR, and I have explained below how it was used.

r? @RalfJung

Rust only supports the windowed Xtensa calling convention on all
upstream targets (esp32 family). Mark windowed and exception as
ABI-required features so a mismatched -Ctarget-cpu cannot silently
change the ABI.

Discussion: rust-lang#160530 (comment)
Copilot AI review requested due to automatic review settings August 6, 2026 14:27
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 6, 2026
@rustbot

rustbot commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

RalfJung is not on the review rotation at the moment.
They may take a while to respond.

This comment was marked as low quality.

@RalfJung

RalfJung commented Aug 6, 2026

Copy link
Copy Markdown
Member

Thanks!

Looking at the LLVM backend, it seems some registers are only available with certain target features:

  if (Subtarget.hasSingleFloat()) {
    addRegisterClass(MVT::f32, &Xtensa::FPRRegClass);
  }

  if (Subtarget.hasBoolean()) {
    addRegisterClass(MVT::v1i1, &Xtensa::BRRegClass);
  }

Does that mean these target features also affect the ABI? I think hasSingleFloat corresponds to "fp" and hasBoolean to "bool".

@RalfJung

RalfJung commented Aug 6, 2026

Copy link
Copy Markdown
Member

Also, if we are adding the ABI checks anyway, could you also add the other part of them which goes into this big match? Seems like we only support a single ABI for Xtensa for now so the checks should be the same as for wasm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

4 participants