-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Tracking issue for RFC 2045: improving #[target_feature]
#44839
Comments
@alexchrichton Yes, we should also clear some of the unresolved questions:
And some related tasks:
It would be nice if those API breaking changes could be prioritized. |
Rust already will sometimes not inline a |
@retep998 |
@gnzlbg I meant in regards to where the RFC states that |
@retep998 We could definitely relax this by just not inlining an What we cannot currently do is inlining a function across mismatching features (independently of its inlining annotations). The alternative sections of the RFC explores this a bit though. |
Any news on implementation status of |
@newpavlov this is being discussed in |
#48556 has entered FCP which I believe will implicitly stabilize this attribute |
So after the inline-always fix it looks like the only bug open still being tracked here is #42515 . |
That bug looks hard to solve and probably won't make it before stabilization. The following issues look "easy" to fix low-hanging fruit. It might be worth to fix these before stabilization: |
Add support for MIPS VZ ISA extension [Link to relevant LLVM line where virt extension is specified](https://github.com/llvm/llvm-project/blob/83fab8cee9d6b9fa911195c20325b4512a7a22ef/llvm/lib/Target/Mips/Mips.td#L172-L173) This has been tested on mips-unknown-linux-musl with a target-cpu that is >= MIPS32 5 and `target-features=+virt`. The example was checked in a disassembler to ensure the correct assembly sequence was being generated using the virtualization instructions. Needed additional work: * MIPS is missing from [the Rust reference CPU feature lists](https://doc.rust-lang.org/reference/attributes/codegen.html#available-features) Example docs for later: ```md #### `mips` or `mips64` This platform requires that `#[target_feature]` is only applied to [`unsafe` functions][unsafe function]. This target's feature support is currently unstable and must be enabled by `#![feature(mips_target_feature)]` ([Issue rust-lang#44839]) [Issue rust-lang#44839]: rust-lang#44839 Further documentation on these features can be found in the [MIPS Instruction Set Reference Manual], or elsewhere on [mips.com]. [MIPS Instruction Set Reference Manual]: https://s3-eu-west-1.amazonaws.com/downloads-mips/documents/MD00086-2B-MIPS32BIS-AFP-6.06.pdf [developer.arm.com]: https://www.mips.com/products/architectures/ase/ Feature | Implicitly Enables | Description ---------------|--------------------|------------------- `fp64` | | 64-bit Floating Point `msa` | | "MIPS SIMD Architecture" `virt` | | Virtualization instructions (VZ ASE) ``` If the above is good I can also submit a PR for that if there's interest in documenting it while it's still unstable. Otherwise that can be dropped, I just wrote it before realizing it was possibly not a good idea. Relevant to rust-lang#44839
…ature, r=petrochenkov Stabilize f16c_target_feature Resolves rust-lang/stdarch#1234 Library PR for stabilizing corresponding intrinsics: rust-lang/stdarch#1366 See also rust-lang#44839 tracking issue for target_feature
…ature, r=petrochenkov Stabilize f16c_target_feature Resolves rust-lang/stdarch#1234 Library PR for stabilizing corresponding intrinsics: rust-lang/stdarch#1366 See also rust-lang#44839 tracking issue for target_feature
Any update on AVX 512 support? |
Stabilize cmpxchg16b_target_feature Tracking issue for target features + rust-lang#44839 stdarch issue + rust-lang/stdarch#827 stdarch PR + rust-lang/stdarch#1358 reference PR + rust-lang/reference#1331 It's my first time contributing to rust-lang/rust. Please tell me if I missed something.
Hi, is there anything blocking stabilising |
Hey! I am currently implementing RISC-V Zk intrinsics, and I am running into a pattern that is currently not well covered by this PR. Either #[target_feature(enable = "zkne")]
pub unsafe fn aes64ks1i(...) -> ... {
...
} But this produces wrong #[target_feature(enable = "zkne", enable = "zknd")]
// OR
#[target_feature(enable = "zkne")]
#[target_feature(enable = "zknd")]
pub unsafe fn aes64ks1i(...) -> ... {
...
} Produces #[target_feature(enable = "zkne,zknd")]
pub unsafe fn aes64ks1i(...) -> ... {
...
} Produces I feel like this is only a documentation issue, but still an issue. |
I'm not sure if this is the right place for this, but the wasm feature |
…features, r=Amanieu Stabilize Ratified RISC-V Target Features Stabilization PR for the ratified RISC-V target features. This stabilizes some of the target features tracked by rust-lang#44839. This is also a part of rust-lang#114544 and eventually needed for the RISC-V part of rust-lang/rfcs#3268. There is a similar PR for the the stdarch crate which can be found at rust-lang/stdarch#1476. This was briefly discussed on Zulip (https://rust-lang.zulipchat.com/#narrow/stream/250483-t-compiler.2Frisc-v/topic/Stabilization.20of.20RISC-V.20Target.20Features/near/394793704). Specifically, this PR stabilizes the: * Atomic Instructions (A) on v2.0 * Compressed Instructions (C) on v2.0 * ~Double-Precision Floating-Point (D) on v2.2~ * ~Embedded Base (E) (Given as `RV32E` / `RV64E`) on v2.0~ * ~Single-Precision Floating-Point (F) on v2.2~ * Integer Multiplication and Division (M) on v2.0 * ~Vector Operations (V) on v1.0~ * Bit Manipulations (B) on v1.0 listed as `zba`, `zbc`, `zbs` * Scalar Cryptography (Zk) v1.0.1 listed as `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, `zkt`, `zbkb`, `zbkc` `zkbx` * ~Double-Precision Floating-Point in Integer Register (Zdinx) on v1.0~ * ~Half-Precision Floating-Point (Zfh) on v1.0~ * ~Minimal Half-Precision Floating-Point (Zfhmin) on v1.0~ * ~Single-Precision Floating-Point in Integer Register (Zfinx) on v1.0~ * ~Half-Precision Floating-Point in Integer Register (Zhinx) on v1.0~ * ~Minimal Half-Precision Floating-Point in Integer Register (Zhinxmin) on v1.0~ r? `@Amanieu`
I tried reading through the open issues regarding target features, but could not find a more fitting one for this question. I have the following code, which currently returns different values on stable vs nightly when compiled with pub fn preferred_vec_size() -> usize {
if cfg!(all(target_arch = "x86_64", target_feature = "avx512f")) {
64
} else if cfg!(all(target_arch = "x86_64", target_feature="avx")) {
32
} else {
16
}
} |
That's... huh. I guess the first branch is being ignored as an invalid feature gate on stable. |
Are there any particular stabilization blockers for Edit: response here |
…=wesleywiser Stabilize Wasm target features that are in phase 4 and 5 This stabilizes the Wasm target features that are known to be working and in [phase 4 and 5](https://github.com/WebAssembly/proposals/tree/04fa8c810e1dc99ab399e41052a6e427ee988180). Feature stabilized: - [Non-trapping float-to-int conversions](https://github.com/WebAssembly/nontrapping-float-to-int-conversions) - [Import/Export of Mutable Globals](https://github.com/WebAssembly/mutable-global) - [Sign-extension operators](https://github.com/WebAssembly/sign-extension-ops) - [Bulk memory operations](https://github.com/WebAssembly/bulk-memory-operations) - [Extended Constant Expressions](https://github.com/WebAssembly/extended-const) Features not stabilized: - [Multi-value](https://github.com/WebAssembly/multi-value): requires rebuilding `std` rust-lang#73755. - [Reference Types](https://github.com/WebAssembly/reference-types): no point stabilizing without rust-lang#103516. - [Threads](https://github.com/webassembly/threads): requires rebuilding `std` rust-lang#77839. - [Relaxed SIMD](https://github.com/WebAssembly/relaxed-simd): separate PR rust-lang#117468. - [Multi Memory](https://github.com/WebAssembly/multi-memory): not implemented. See rust-lang#117457 (comment) for more context. Documentation: rust-lang/reference#1420 Tracking issue: rust-lang#44839
…=wesleywiser Stabilize Wasm target features that are in phase 4 and 5 This stabilizes the Wasm target features that are known to be working and in [phase 4 and 5](https://github.com/WebAssembly/proposals/tree/04fa8c810e1dc99ab399e41052a6e427ee988180). Feature stabilized: - [Non-trapping float-to-int conversions](https://github.com/WebAssembly/nontrapping-float-to-int-conversions) - [Import/Export of Mutable Globals](https://github.com/WebAssembly/mutable-global) - [Sign-extension operators](https://github.com/WebAssembly/sign-extension-ops) - [Bulk memory operations](https://github.com/WebAssembly/bulk-memory-operations) - [Extended Constant Expressions](https://github.com/WebAssembly/extended-const) Features not stabilized: - [Multi-value](https://github.com/WebAssembly/multi-value): requires rebuilding `std` rust-lang#73755. - [Reference Types](https://github.com/WebAssembly/reference-types): no point stabilizing without rust-lang#103516. - [Threads](https://github.com/webassembly/threads): requires rebuilding `std` rust-lang#77839. - [Relaxed SIMD](https://github.com/WebAssembly/relaxed-simd): separate PR rust-lang#117468. - [Multi Memory](https://github.com/WebAssembly/multi-memory): not implemented. See rust-lang#117457 (comment) for more context. Documentation: rust-lang/reference#1420 Tracking issue: rust-lang#44839
Stabilize Wasm target features that are in phase 4 and 5 This stabilizes the Wasm target features that are known to be working and in [phase 4 and 5](https://github.com/WebAssembly/proposals/tree/04fa8c810e1dc99ab399e41052a6e427ee988180). Feature stabilized: - [Non-trapping float-to-int conversions](https://github.com/WebAssembly/nontrapping-float-to-int-conversions) - [Import/Export of Mutable Globals](https://github.com/WebAssembly/mutable-global) - [Sign-extension operators](https://github.com/WebAssembly/sign-extension-ops) - [Bulk memory operations](https://github.com/WebAssembly/bulk-memory-operations) - [Extended Constant Expressions](https://github.com/WebAssembly/extended-const) Features not stabilized: - [Multi-value](https://github.com/WebAssembly/multi-value): requires rebuilding `std` #73755. - [Reference Types](https://github.com/WebAssembly/reference-types): no point stabilizing without #103516. - [Threads](https://github.com/webassembly/threads): requires rebuilding `std` #77839. - [Relaxed SIMD](https://github.com/WebAssembly/relaxed-simd): separate PR #117468. - [Multi Memory](https://github.com/WebAssembly/multi-memory): not implemented. See rust-lang/rust#117457 (comment) for more context. Documentation: rust-lang/reference#1420 Tracking issue: rust-lang/rust#44839
Stabilize Wasm target features that are in phase 4 and 5 This stabilizes the Wasm target features that are known to be working and in [phase 4 and 5](https://github.com/WebAssembly/proposals/tree/04fa8c810e1dc99ab399e41052a6e427ee988180). Feature stabilized: - [Non-trapping float-to-int conversions](https://github.com/WebAssembly/nontrapping-float-to-int-conversions) - [Import/Export of Mutable Globals](https://github.com/WebAssembly/mutable-global) - [Sign-extension operators](https://github.com/WebAssembly/sign-extension-ops) - [Bulk memory operations](https://github.com/WebAssembly/bulk-memory-operations) - [Extended Constant Expressions](https://github.com/WebAssembly/extended-const) Features not stabilized: - [Multi-value](https://github.com/WebAssembly/multi-value): requires rebuilding `std` #73755. - [Reference Types](https://github.com/WebAssembly/reference-types): no point stabilizing without #103516. - [Threads](https://github.com/webassembly/threads): requires rebuilding `std` #77839. - [Relaxed SIMD](https://github.com/WebAssembly/relaxed-simd): separate PR #117468. - [Multi Memory](https://github.com/WebAssembly/multi-memory): not implemented. See rust-lang/rust#117457 (comment) for more context. Documentation: rust-lang/reference#1420 Tracking issue: rust-lang/rust#44839
This is a tracking issue for the
#[target_feature]
segment of RFC 2045 (rust-lang/rfcs#2045).#[cfg(target_feature)]
was tracked in #29717 and has since been stabilized.Steps
#[target_feature]
semanticstarget_feature
andcfg_target_feature
. reference#545mmx(never going to be stabilized)@gnzlbg have anything else you want filled out here?
(below added from comments on PR)
cfg!(feature)
work across #[inline(always)] functions, generics, etc?And some related tasks:
#[target_feature]
on unsafe functions only#[target_feature = "+feature"]
=>#[target_feature(enable = "feature")]
cfg_target_feature
andtarget_feature
don't interact properly #42515The text was updated successfully, but these errors were encountered: