Conversation
|
|
|
As for |
| static AVR_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ | ||
| // tidy-alphabetical-start | ||
| ("addsubiw", Unstable(sym::avr_target_feature), &[]), | ||
| ("break", Unstable(sym::avr_target_feature), &[]), |
There was a problem hiding this comment.
nit: what about name collisions? 👀
The RFC doesn't seem to mention this, but I can see AVR's break (or other "generic" word like mul) accidentally colliding with another arch in future - on the other hand, keeping the mapping 1:1 with LLVM (FeatureBREAK in this case) is important as well, IMO.
Other than that LGTM.
There was a problem hiding this comment.
Target feature name collisions with other architectures are fine. (e.g., the aes target feature exists on x86/x86_64 (AES-NI) and arm/aarch64/arm64ec (FEAT_AES) respectively.)
Looking at the LLVM issue, in Rust, I guess it might work if we use |
|
cc @rust-lang/lang informational-only: letting you know about this target's features because it is particularly interesting in terms of it being on the boundary of what Rust can support. I think that we should indeed either ignore it or just error if someone tries to say |
|
☔ The latest upstream changes (presumably #147645) made this pull request unmergeable. Please resolve the merge conflicts. |
|
This is waiting on " @rustbot author |
18d8866 to
7763f18
Compare
|
Some changes occurred in src/doc/rustc/src/platform-support cc @Noratrieb |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
7763f18 to
e3f2d28
Compare
This comment has been minimized.
This comment has been minimized.
0d13763 to
75de66b
Compare
|
☔ The latest upstream changes (presumably #151144) made this pull request unmergeable. Please resolve the merge conflicts. |
75de66b to
e940165
Compare
|
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. |
e940165 to
febe008
Compare
This comment has been minimized.
This comment has been minimized.
|
T-lang has to approve these features being stable, last I checked, but I believe we can accept this for now as this is unstable and the same "eh, let's throw them in" basis was used for the initial add of every other architecture's features. @bors r+ |
| warning: target feature `sram` cannot be disabled with `-Ctarget-feature`: devices that have no SRAM are unsupported | ||
| | | ||
| = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
| = note: for more information, see issue #116344 <https://github.com/rust-lang/rust/issues/116344> | ||
|
|
||
| warning: target feature `sram` must be enabled to ensure that the ABI of the current target can be implemented correctly | ||
| | | ||
| = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
| = note: for more information, see issue #116344 <https://github.com/rust-lang/rust/issues/116344> | ||
|
|
||
| warning: 2 warnings emitted | ||
|
|
There was a problem hiding this comment.
This should probably proactively become a hard error before stabilizing.
…ingjubilee Add avr_target_feature This adds the following unstable target features (tracking issue: rust-lang#146889): - The following two are particularly important for properly supporting inline assembly: - `tinyencoding`: AVR has devices that reduce the number of registers, similar to RISC-V's RV32E. This feature is necessary to support inline assembly in such devices. (see also rust-lang#146901) - `lowbytefirst`: AVR's memory access is per 8-bit, and when writing 16-bit ports, the bytes must be written in a specific order. This order depends on devices, making this feature necessary to write proper inline assembly for such use cases. (see also llvm/llvm-project@2a52876) - The followings help recognizing whether specific instructions are available: - `addsubiw` - `break` - `eijmpcall` - `elpm` - `elpmx` - `ijmpcall` - `jmpcall` - `lpm` - `lpmx` - `movw` - `mul` - `rmw` - `spm` - `spmx` Of these, all except `addsubiw`, `break`, `ijmpcall`, `lpm`, `rmw`, `spm`, and `spmx` have [corresponding conditional codes in avr-libc](https://github.com/search?q=repo%3Aavrdudes%2Favr-libc+%2F__AVR_HAVE_%2F&type=code&p=1). LLVM also has `des` feature, but I excluded it from this PR because [DES](https://en.wikipedia.org/wiki/Data_Encryption_Standard) is insecure. - Report future-incompatible warning (rust-lang#116344) for -C target-feature=-sram and -C target-cpu=<device_without_sram> cases because SRAM is minimum requirement for non-assembly language in both avr-gcc and LLVM. - See rust-lang#146900 (comment) for details. LLVM also has `smallstack`, `wrappingrjmp`, and `memmappedregs` features, but I skipped them because they didn't seem to belong to either of the above categories, but I might have missed something. (The feature names are match with [definitions in LLVM](https://github.com/llvm/llvm-project/blob/llvmorg-21.1.0/llvm/lib/Target/AVR/AVRDevices.td).) cc @Patryk27 @Rahix r? workingjubilee @rustbot label +O-AVR +A-target-feature
Rollup of 15 pull requests Successful merges: - #151431 (Add new unstable attribute: `#[export_visibility = ...]`.) - #146900 (Add avr_target_feature) - #152033 (Rename trait `DepNodeParams` to `DepNodeKey`) - #152142 (Convert to inline diagnostics in `rustc_hir_typeck`) - #152020 (Remove dummy loads on offload codegen) - #152023 (Some `rustc_query_system` cleanups) - #152068 (Convert to inline diagnostics in `rustc_resolve`) - #152081 (Port depgraph testing attributes to parser) - #152090 (Port reexport_test_harness_main to attr parser) - #152105 (Convert to inline diagnostics in `rustc_ast_lowering`) - #152108 (Convert to inline diagnostics in `rustc_expand`) - #152114 (Convert to inline diagnostics in `rustc_mir_transform`) - #152115 (Convert to inline diagnostics in `rustc_metadata`) - #152116 (Remove rustdoc GUI flaky test) - #152128 (Adopt matches-logical-or-141497.rs to LLVM HEAD) Failed merges: - #152070 (Convert to inline diagnostics in `rustc_pattern_analysis`) - #152106 (Convert to inline diagnostics in `rustc_ast_passes`) - #152109 (Convert to inline diagnostics in `rustc_errors`) - #152117 (Convert to inline diagnostics in `rustc_trait_selection`) - #152118 (Convert to inline diagnostics in `rustc_codegen_ssa`) - #152119 (Convert to inline diagnostics in `rustc_middle`) - #152126 (Convert to inline diagnostics in `rustc_mir_build`) - #152131 (Port rustc_no_implicit_bounds attribute to parser.)
…ingjubilee Add avr_target_feature This adds the following unstable target features (tracking issue: rust-lang#146889): - The following two are particularly important for properly supporting inline assembly: - `tinyencoding`: AVR has devices that reduce the number of registers, similar to RISC-V's RV32E. This feature is necessary to support inline assembly in such devices. (see also rust-lang#146901) - `lowbytefirst`: AVR's memory access is per 8-bit, and when writing 16-bit ports, the bytes must be written in a specific order. This order depends on devices, making this feature necessary to write proper inline assembly for such use cases. (see also llvm/llvm-project@2a52876) - The followings help recognizing whether specific instructions are available: - `addsubiw` - `break` - `eijmpcall` - `elpm` - `elpmx` - `ijmpcall` - `jmpcall` - `lpm` - `lpmx` - `movw` - `mul` - `rmw` - `spm` - `spmx` Of these, all except `addsubiw`, `break`, `ijmpcall`, `lpm`, `rmw`, `spm`, and `spmx` have [corresponding conditional codes in avr-libc](https://github.com/search?q=repo%3Aavrdudes%2Favr-libc+%2F__AVR_HAVE_%2F&type=code&p=1). LLVM also has `des` feature, but I excluded it from this PR because [DES](https://en.wikipedia.org/wiki/Data_Encryption_Standard) is insecure. - Report future-incompatible warning (rust-lang#116344) for -C target-feature=-sram and -C target-cpu=<device_without_sram> cases because SRAM is minimum requirement for non-assembly language in both avr-gcc and LLVM. - See rust-lang#146900 (comment) for details. LLVM also has `smallstack`, `wrappingrjmp`, and `memmappedregs` features, but I skipped them because they didn't seem to belong to either of the above categories, but I might have missed something. (The feature names are match with [definitions in LLVM](https://github.com/llvm/llvm-project/blob/llvmorg-21.1.0/llvm/lib/Target/AVR/AVRDevices.td).) cc @Patryk27 @Rahix r? workingjubilee @rustbot label +O-AVR +A-target-feature
…ingjubilee Add avr_target_feature This adds the following unstable target features (tracking issue: rust-lang#146889): - The following two are particularly important for properly supporting inline assembly: - `tinyencoding`: AVR has devices that reduce the number of registers, similar to RISC-V's RV32E. This feature is necessary to support inline assembly in such devices. (see also rust-lang#146901) - `lowbytefirst`: AVR's memory access is per 8-bit, and when writing 16-bit ports, the bytes must be written in a specific order. This order depends on devices, making this feature necessary to write proper inline assembly for such use cases. (see also llvm/llvm-project@2a52876) - The followings help recognizing whether specific instructions are available: - `addsubiw` - `break` - `eijmpcall` - `elpm` - `elpmx` - `ijmpcall` - `jmpcall` - `lpm` - `lpmx` - `movw` - `mul` - `rmw` - `spm` - `spmx` Of these, all except `addsubiw`, `break`, `ijmpcall`, `lpm`, `rmw`, `spm`, and `spmx` have [corresponding conditional codes in avr-libc](https://github.com/search?q=repo%3Aavrdudes%2Favr-libc+%2F__AVR_HAVE_%2F&type=code&p=1). LLVM also has `des` feature, but I excluded it from this PR because [DES](https://en.wikipedia.org/wiki/Data_Encryption_Standard) is insecure. - Report future-incompatible warning (rust-lang#116344) for -C target-feature=-sram and -C target-cpu=<device_without_sram> cases because SRAM is minimum requirement for non-assembly language in both avr-gcc and LLVM. - See rust-lang#146900 (comment) for details. LLVM also has `smallstack`, `wrappingrjmp`, and `memmappedregs` features, but I skipped them because they didn't seem to belong to either of the above categories, but I might have missed something. (The feature names are match with [definitions in LLVM](https://github.com/llvm/llvm-project/blob/llvmorg-21.1.0/llvm/lib/Target/AVR/AVRDevices.td).) cc @Patryk27 @Rahix r? workingjubilee @rustbot label +O-AVR +A-target-feature
This adds the following unstable target features (tracking issue: #146889):
The following two are particularly important for properly supporting inline assembly:
tinyencoding: AVR has devices that reduce the number of registers, similar to RISC-V's RV32E. This feature is necessary to support inline assembly in such devices. (see also Support AVRTiny devices in AVR inline assembly #146901)lowbytefirst: AVR's memory access is per 8-bit, and when writing 16-bit ports, the bytes must be written in a specific order. This order depends on devices, making this feature necessary to write proper inline assembly for such use cases. (see also llvm/llvm-project@2a52876)The followings help recognizing whether specific instructions are available:
addsubiwbreakeijmpcallelpmelpmxijmpcalljmpcalllpmlpmxmovwmulrmwspmspmxOf these, all except
addsubiw,break,ijmpcall,lpm,rmw,spm, andspmxhave corresponding conditional codes in avr-libc. LLVM also hasdesfeature, but I excluded it from this PR because DES is insecure.Report future-incompatible warning (The ABI of float types can be changed by
-Ctarget-feature#116344) for -C target-feature=-sram and -C target-cpu=<device_without_sram> cases because SRAM is minimum requirement for non-assembly language in both avr-gcc and LLVM.LLVM also has
smallstack,wrappingrjmp, andmemmappedregsfeatures, but I skipped them because they didn't seem to belong to either of the above categories, but I might have missed something.(The feature names are match with definitions in LLVM.)
cc @Patryk27 @Rahix
r? workingjubilee
@rustbot label +O-AVR +A-target-feature