Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add XTENSA_ALLOWED_FEATURES to supported_target_features #240

Closed
wants to merge 1 commit into from

Conversation

taiki-e
Copy link

@taiki-e taiki-e commented Oct 27, 2024

This fixes an issue that target_feature is not handled correctly.

Currently, cfg(target_feature) does not work, and inline assembly incorrectly rejects registers that depend on a particular target_feature.

e.g., freg, scompare1, etc. are rejected even on esp32.

error: register class `freg` requires at least one of the following target features: dfpaccel, fp
  --> /Users/taiki/projects/forks/rust-lang/rust/tests/assembly/asm/xtensa-types.rs:62:44
   |
62 |             asm!(concat!($mov, " {}, {}"), out($class) y, in($class) x);
   |                                            ^^^^^^^^^^^^^
...
96 | check_general_reg!(freg_f32 f32 freg "mov.s");
   | --------------------------------------------- in this macro invocation
   |
   = note: this error originates in the macro `check_general_reg` (in Nightly builds, run with -Z macro-backtrace for more info)

@MabezDev
Copy link
Member

MabezDev commented Oct 28, 2024

Thanks! I've also opened rust-lang#132265 so we fix this at source. I plan on fixing a few things and then cutting 1.82.0.2 shortly.

@MabezDev MabezDev closed this Oct 28, 2024
@taiki-e taiki-e deleted the target-features branch October 28, 2024 15:42
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.

2 participants