Skip to content

Commit 1551bf5

Browse files
committed
tweak comments
1 parent 171223e commit 1551bf5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compiler/rustc_target/src/target_features.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,8 @@ const RISCV_FEATURES: &[(&str, StabilityUncomputed, ImpliedFeatures)] = &[
600600
Err("feature is required by ABI")
601601
}
602602
"ilp32e" if enable => {
603-
// The `d` feature apparently is incompatible with this ABI.
603+
// ilp32e is incompatible with features that need aligned load/stores > 32 bits,
604+
// like `d`.
604605
Err("feature is incompatible with ABI")
605606
}
606607
_ => Ok(()),
@@ -618,7 +619,10 @@ const RISCV_FEATURES: &[(&str, StabilityUncomputed, ImpliedFeatures)] = &[
618619
allow_toggle: |target, enable| {
619620
match &*target.llvm_abiname {
620621
_ if !enable => {
621-
// This is a negative feature, *disabling* it is always okay.
622+
// Disabling this feature means we can use more registers (x16-x31).
623+
// The "e" ABIs treat them as caller-save, so it is safe to use them only
624+
// in some parts of a program while the rest doesn't know they even exist.
625+
// On other ABIs, the feature is already disabled anyway.
622626
Ok(())
623627
}
624628
"ilp32e" | "lp64e" => {

0 commit comments

Comments
 (0)