Skip to content

Xtensa: add ESP32-S3 QR inline asm support - #288

Open
Dominaezzz wants to merge 1 commit into
esp-rs:esp-1.100.0.0from
Dominaezzz:qreg
Open

Dominaezzz wants to merge 1 commit into
esp-rs:esp-1.100.0.0from
Dominaezzz:qreg

Conversation

@Dominaezzz

Copy link
Copy Markdown

Summary

Part of #265.
This PR was generated with the help of Codex.

This change adds the qreg inline assembly register class for ESP32-S3, including q0–q7 and 128-bit vector operands. It maps the class to LLVM’s q constraint and adds regression coverage for inline assembly using both custom #[repr(simd)] types and lane extraction.

The lane extraction tests cover byte lanes from a 16-byte vector and 32-bit lanes from a four-word vector. The change also marks QR registers as clobbered by clobber_abi("C") for ESP32-S3.

This Rust change depends on the corresponding QR register support in [Espressif LLVM](https://github.com/espressif/llvm-project).

Testing

  • ./x.py test tests/assembly-llvm/asm/xtensa-qreg.rs --stage 1
  • Built the esp-hal ESP32-S3 example using the patched compiler.

ABI question

The implementation treats QR registers as caller-clobbered on ESP32-S3. The documentation I found identifies QR as general-purpose registers but does not explicitly state their C ABI preservation rule; please confirm this assumption.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant