Skip to content

Commit c6ed786

Browse files
committed
rustc_target: RISC-V: Add atomics/memory-related extensions
This commit adds a part of RISC-V extensions that are mandatory part of the RVA23U64 profile (application-class processor profile) and related to memory/atomic constraints. The Zic64b extension constrains the cache line to naturally-aligned 64 bytes that would make certain memory operations (like zeroing the memory using the Zicboz extension) easier. The Zicbom and Zicbop extensions enable managing cache block-based operations (the Zicbop contains hints that will work as a NOP when this extension is absent and the Zicbom contains control instructions). Of which, the Zicbom extension is going to be discoverable from the Linux kernel (as of the version 6.15-rc4) and this commit prepares for corresponding stdarch changes. The Zicc* extensions add certain constraints to "the main memory" (usually true on the user mode application on the application-class processor but those extensions make sure such constraints exist).
1 parent adb92ae commit c6ed786

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

compiler/rustc_target/src/target_features.rs

+7
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,14 @@ static RISCV_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
531531
("zfinx", Unstable(sym::riscv_target_feature), &["zicsr"]),
532532
("zhinx", Unstable(sym::riscv_target_feature), &["zhinxmin"]),
533533
("zhinxmin", Unstable(sym::riscv_target_feature), &["zfinx"]),
534+
("zic64b", Unstable(sym::riscv_target_feature), &[]),
535+
("zicbom", Unstable(sym::riscv_target_feature), &[]),
536+
("zicbop", Unstable(sym::riscv_target_feature), &[]),
534537
("zicboz", Unstable(sym::riscv_target_feature), &[]),
538+
("ziccamoa", Unstable(sym::riscv_target_feature), &[]),
539+
("ziccif", Unstable(sym::riscv_target_feature), &[]),
540+
("zicclsm", Unstable(sym::riscv_target_feature), &[]),
541+
("ziccrse", Unstable(sym::riscv_target_feature), &[]),
535542
("zicntr", Unstable(sym::riscv_target_feature), &["zicsr"]),
536543
("zicond", Unstable(sym::riscv_target_feature), &[]),
537544
("zicsr", Unstable(sym::riscv_target_feature), &[]),

tests/ui/check-cfg/target_feature.stderr

+7
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,14 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
329329
`zfinx`
330330
`zhinx`
331331
`zhinxmin`
332+
`zic64b`
333+
`zicbom`
334+
`zicbop`
332335
`zicboz`
336+
`ziccamoa`
337+
`ziccif`
338+
`zicclsm`
339+
`ziccrse`
333340
`zicntr`
334341
`zicond`
335342
`zicsr`

0 commit comments

Comments
 (0)