Skip to content

Commit 934ed85

Browse files
committed
tweak comments
1 parent 171223e commit 934ed85

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

compiler/rustc_target/src/target_features.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub enum Stability<Toggleability> {
3939
allow_toggle: Toggleability,
4040
},
4141
/// This feature can not be set via `-Ctarget-feature` or `#[target_feature]`, it can only be
42-
/// set in the basic target definition. It is never set in `cfg(target_feature)`. Used in
42+
/// set in the target spec. It is never set in `cfg(target_feature)`. Used in
4343
/// particular for features that change the floating-point ABI.
4444
Forbidden { reason: &'static str },
4545
}
@@ -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)