Skip to content

Commit 501a539

Browse files
committed
rustc_target: RISC-V: Add BF16 extensions
This commit adds three ratified unprivileged RISC-V extensions related to BFloat16 (BF16) handling. Although that they are far from stabilization due to ABI issues, they are optional extensions of the RVA23U64 profile (application-class processor profile) and going to be discoverable from the Linux kernel (as of version 6.15-rc4). This commit mainly prepares runtime detection of those extensions.
1 parent c6ed786 commit 501a539

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

compiler/rustc_target/src/target_features.rs

+3
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ static RISCV_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
526526
("zcmop", Unstable(sym::riscv_target_feature), &["zca"]),
527527
("zdinx", Unstable(sym::riscv_target_feature), &["zfinx"]),
528528
("zfa", Unstable(sym::riscv_target_feature), &["f"]),
529+
("zfbfmin", Unstable(sym::riscv_target_feature), &["f"]), // and a subset of Zfhmin
529530
("zfh", Unstable(sym::riscv_target_feature), &["zfhmin"]),
530531
("zfhmin", Unstable(sym::riscv_target_feature), &["f"]),
531532
("zfinx", Unstable(sym::riscv_target_feature), &["zicsr"]),
@@ -565,6 +566,8 @@ static RISCV_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
565566
("zve64d", Unstable(sym::riscv_target_feature), &["zve64f", "d"]),
566567
("zve64f", Unstable(sym::riscv_target_feature), &["zve32f", "zve64x"]),
567568
("zve64x", Unstable(sym::riscv_target_feature), &["zve32x", "zvl64b"]),
569+
("zvfbfmin", Unstable(sym::riscv_target_feature), &["zve32f"]),
570+
("zvfbfwma", Unstable(sym::riscv_target_feature), &["zfbfmin", "zvfbfmin"]),
568571
("zvfh", Unstable(sym::riscv_target_feature), &["zvfhmin", "zve32f", "zfhmin"]), // Zvfh ⊃ Zvfhmin
569572
("zvfhmin", Unstable(sym::riscv_target_feature), &["zve32f"]),
570573
("zvkb", Unstable(sym::riscv_target_feature), &["zve32x"]),

tests/ui/check-cfg/target_feature.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
324324
`zcmop`
325325
`zdinx`
326326
`zfa`
327+
`zfbfmin`
327328
`zfh`
328329
`zfhmin`
329330
`zfinx`
@@ -363,6 +364,8 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
363364
`zve64d`
364365
`zve64f`
365366
`zve64x`
367+
`zvfbfmin`
368+
`zvfbfwma`
366369
`zvfh`
367370
`zvfhmin`
368371
`zvkb`

0 commit comments

Comments
 (0)