Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d8cc575
std_detect Darwin AArch64: add new-style detection for FEAT_CRC32
pthariensflame Sep 10, 2025
edc87e3
std_detect Darwin AArch64: re-alphabetize
pthariensflame Sep 14, 2025
d49f6a7
std_detect Darwin AArch64: synchronize features
pthariensflame Sep 14, 2025
f4b8768
Support ctr and lr as clobber-only registers in PowerPC inline assembly
taiki-e Sep 21, 2025
b17fb70
Add self-profile events for target-machine creation
Zalathar Sep 21, 2025
2dfcd09
btree InternalNode::new safety comments
hkBst Sep 21, 2025
5f0a68e
regression test for https://github.com/rust-lang/rust/issues/117763
the8472 Aug 14, 2025
b3c2435
Make mips64el-unknown-linux-muslabi64 link dynamically
Gelbpunkt Sep 21, 2025
3565b06
emit attribute for readonly non-pure inline assembly
folkertdev Sep 19, 2025
c54a953
Early return in `visibility_print_with_space`
yotamofek Sep 21, 2025
cdf9661
Re-use some existing util fns
yotamofek Sep 21, 2025
2067160
Introduce "wrapper" helpers to rustdoc
yotamofek Sep 21, 2025
7d00129
assert_unsafe_precondition: fix some incorrect check_language_ub
RalfJung Sep 22, 2025
8c0c537
Rollup merge of #145411 - the8472:cows-have-no-branches, r=Mark-Simul…
Zalathar Sep 22, 2025
d144638
Rollup merge of #146397 - pthariensflame:patch-1, r=Amanieu
Zalathar Sep 22, 2025
40db498
Rollup merge of #146791 - folkertdev:readonly-not-pure, r=nikic,josht…
Zalathar Sep 22, 2025
46be365
Rollup merge of #146831 - taiki-e:powerpc-clobber, r=Amanieu
Zalathar Sep 22, 2025
681da13
Rollup merge of #146838 - yotamofek:pr/rustdoc/wrappers, r=lolbinarycat
Zalathar Sep 22, 2025
7b6553c
Rollup merge of #146845 - Zalathar:prof-target-machine, r=Kobzol
Zalathar Sep 22, 2025
8cf94b6
Rollup merge of #146846 - hkBst:btree-2, r=tgross35
Zalathar Sep 22, 2025
a5e1ab5
Rollup merge of #146858 - Gelbpunkt:mips64el-musl-dynamic, r=jieyouxu
Zalathar Sep 22, 2025
8f80707
Rollup merge of #146878 - RalfJung:check_language_ub, r=tgross35
Zalathar Sep 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions compiler/rustc_codegen_gcc/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,12 @@ fn reg_class_to_gcc(reg_class: InlineAsmRegClass) -> &'static str {
InlineAsmRegClass::PowerPC(PowerPCInlineAsmRegClass::reg_nonzero) => "b",
InlineAsmRegClass::PowerPC(PowerPCInlineAsmRegClass::freg) => "f",
InlineAsmRegClass::PowerPC(PowerPCInlineAsmRegClass::vreg) => "v",
InlineAsmRegClass::PowerPC(PowerPCInlineAsmRegClass::cr)
| InlineAsmRegClass::PowerPC(PowerPCInlineAsmRegClass::xer) => {
InlineAsmRegClass::PowerPC(
PowerPCInlineAsmRegClass::cr
| PowerPCInlineAsmRegClass::ctr
| PowerPCInlineAsmRegClass::lr
| PowerPCInlineAsmRegClass::xer,
) => {
unreachable!("clobber-only")
}
InlineAsmRegClass::RiscV(RiscVInlineAsmRegClass::reg) => "r",
Expand Down Expand Up @@ -777,8 +781,12 @@ fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegCl
InlineAsmRegClass::PowerPC(PowerPCInlineAsmRegClass::vreg) => {
cx.type_vector(cx.type_i32(), 4)
}
InlineAsmRegClass::PowerPC(PowerPCInlineAsmRegClass::cr)
| InlineAsmRegClass::PowerPC(PowerPCInlineAsmRegClass::xer) => {
InlineAsmRegClass::PowerPC(
PowerPCInlineAsmRegClass::cr
| PowerPCInlineAsmRegClass::ctr
| PowerPCInlineAsmRegClass::lr
| PowerPCInlineAsmRegClass::xer,
) => {
unreachable!("clobber-only")
}
InlineAsmRegClass::RiscV(RiscVInlineAsmRegClass::reg) => cx.type_i32(),
Expand Down
18 changes: 14 additions & 4 deletions compiler/rustc_codegen_llvm/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
attrs.push(llvm::AttributeKind::WillReturn.create_attr(self.cx.llcx));
} else if options.contains(InlineAsmOptions::NOMEM) {
attrs.push(llvm::MemoryEffects::InaccessibleMemOnly.create_attr(self.cx.llcx));
} else {
// LLVM doesn't have an attribute to represent ReadOnly + SideEffect
} else if options.contains(InlineAsmOptions::READONLY) {
attrs.push(llvm::MemoryEffects::ReadOnlyNotPure.create_attr(self.cx.llcx));
}
attributes::apply_to_callsite(result, llvm::AttributePlace::Function, &{ attrs });

Expand Down Expand Up @@ -662,7 +662,12 @@ fn reg_to_llvm(reg: InlineAsmRegOrRegClass, layout: Option<&TyAndLayout<'_>>) ->
PowerPC(PowerPCInlineAsmRegClass::reg_nonzero) => "b",
PowerPC(PowerPCInlineAsmRegClass::freg) => "f",
PowerPC(PowerPCInlineAsmRegClass::vreg) => "v",
PowerPC(PowerPCInlineAsmRegClass::cr) | PowerPC(PowerPCInlineAsmRegClass::xer) => {
PowerPC(
PowerPCInlineAsmRegClass::cr
| PowerPCInlineAsmRegClass::ctr
| PowerPCInlineAsmRegClass::lr
| PowerPCInlineAsmRegClass::xer,
) => {
unreachable!("clobber-only")
}
RiscV(RiscVInlineAsmRegClass::reg) => "r",
Expand Down Expand Up @@ -830,7 +835,12 @@ fn dummy_output_type<'ll>(cx: &CodegenCx<'ll, '_>, reg: InlineAsmRegClass) -> &'
PowerPC(PowerPCInlineAsmRegClass::reg_nonzero) => cx.type_i32(),
PowerPC(PowerPCInlineAsmRegClass::freg) => cx.type_f64(),
PowerPC(PowerPCInlineAsmRegClass::vreg) => cx.type_vector(cx.type_i32(), 4),
PowerPC(PowerPCInlineAsmRegClass::cr) | PowerPC(PowerPCInlineAsmRegClass::xer) => {
PowerPC(
PowerPCInlineAsmRegClass::cr
| PowerPCInlineAsmRegClass::ctr
| PowerPCInlineAsmRegClass::lr
| PowerPCInlineAsmRegClass::xer,
) => {
unreachable!("clobber-only")
}
RiscV(RiscVInlineAsmRegClass::reg) => cx.type_i32(),
Expand Down
10 changes: 10 additions & 0 deletions compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ pub(crate) fn target_machine_factory(
optlvl: config::OptLevel,
target_features: &[String],
) -> TargetMachineFactoryFn<LlvmCodegenBackend> {
// Self-profile timer for creating a _factory_.
let _prof_timer = sess.prof.generic_activity("target_machine_factory");

let reloc_model = to_llvm_relocation_model(sess.relocation_model());

let (opt_level, _) = to_llvm_opt_settings(optlvl);
Expand Down Expand Up @@ -259,6 +262,9 @@ pub(crate) fn target_machine_factory(
.into_string()
.unwrap_or_default();
let command_line_args = quote_command_line_args(&sess.expanded_args);
// Self-profile counter for the number of bytes produced by command-line quoting.
// Values are summed, so the summary result is cumulative across all TM factories.
sess.prof.artifact_size("quoted_command_line_args", "-", command_line_args.len() as u64);

let debuginfo_compression = sess.opts.debuginfo_compression.to_string();
match sess.opts.debuginfo_compression {
Expand All @@ -281,7 +287,11 @@ pub(crate) fn target_machine_factory(

let use_wasm_eh = wants_wasm_eh(sess);

let prof = SelfProfilerRef::clone(&sess.prof);
Arc::new(move |config: TargetMachineFactoryConfig| {
// Self-profile timer for invoking a factory to create a target machine.
let _prof_timer = prof.generic_activity("target_machine_factory_inner");

let path_to_cstring_helper = |path: Option<PathBuf>| -> CString {
let path = path.unwrap_or_default();
let path = path_mapping
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_llvm/src/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ pub(crate) enum MemoryEffects {
None,
ReadOnly,
InaccessibleMemOnly,
ReadOnlyNotPure,
}

/// LLVMOpcode
Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ enum class LLVMRustMemoryEffects {
None,
ReadOnly,
InaccessibleMemOnly,
ReadOnlyNotPure,
};

extern "C" LLVMAttributeRef
Expand All @@ -568,6 +569,10 @@ LLVMRustCreateMemoryEffectsAttr(LLVMContextRef C,
case LLVMRustMemoryEffects::InaccessibleMemOnly:
return wrap(Attribute::getWithMemoryEffects(
*unwrap(C), MemoryEffects::inaccessibleMemOnly()));
case LLVMRustMemoryEffects::ReadOnlyNotPure:
return wrap(Attribute::getWithMemoryEffects(
*unwrap(C),
MemoryEffects::readOnly() | MemoryEffects::inaccessibleMemOnly()));
default:
report_fatal_error("bad MemoryEffects.");
}
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@ symbols! {
ctlz,
ctlz_nonzero,
ctpop,
ctr,
cttz,
cttz_nonzero,
custom_attribute,
Expand Down Expand Up @@ -1333,6 +1334,7 @@ symbols! {
loongarch_target_feature,
loop_break_value,
loop_match,
lr,
lt,
m68k_target_feature,
macro_at_most_once_rep,
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_target/src/asm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1260,11 +1260,12 @@ impl InlineAsmClobberAbi {
v8, v9, v10, v11, v12, v13, v14,
v15, v16, v17, v18, v19,

// cr0-cr1, cr5-cr7, xer
// cr0-cr1, cr5-cr7, ctr, lr, xer
cr0, cr1,
cr5, cr6, cr7,
ctr,
lr,
xer,
// lr and ctr are reserved
}
},
InlineAsmClobberAbi::S390x => clobbered_regs! {
Expand Down
12 changes: 7 additions & 5 deletions compiler/rustc_target/src/asm/powerpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def_reg_class! {
freg,
vreg,
cr,
ctr,
lr,
xer,
}
}
Expand Down Expand Up @@ -56,7 +58,7 @@ impl PowerPCInlineAsmRegClass {
altivec: VecI8(16), VecI16(8), VecI32(4), VecF32(4);
vsx: F32, F64, VecI64(2), VecF64(2);
},
Self::cr | Self::xer => &[],
Self::cr | Self::ctr | Self::lr | Self::xer => &[],
}
}
}
Expand Down Expand Up @@ -195,6 +197,8 @@ def_regs! {
cr5: cr = ["cr5"],
cr6: cr = ["cr6"],
cr7: cr = ["cr7"],
ctr: ctr = ["ctr"],
lr: lr = ["lr"],
xer: xer = ["xer"],
#error = ["r1", "1", "sp"] =>
"the stack pointer cannot be used as an operand for inline asm",
Expand All @@ -206,10 +210,6 @@ def_regs! {
"r30 is used internally by LLVM and cannot be used as an operand for inline asm",
#error = ["r31", "31", "fp"] =>
"the frame pointer cannot be used as an operand for inline asm",
#error = ["lr"] =>
"the link register cannot be used as an operand for inline asm",
#error = ["ctr"] =>
"the counter register cannot be used as an operand for inline asm",
#error = ["vrsave"] =>
"the vrsave register cannot be used as an operand for inline asm",
}
Expand Down Expand Up @@ -247,6 +247,8 @@ impl PowerPCInlineAsmReg {
(v24, "24"), (v25, "25"), (v26, "26"), (v27, "27"), (v28, "28"), (v29, "29"), (v30, "30"), (v31, "31");
(cr, "cr");
(cr0, "0"), (cr1, "1"), (cr2, "2"), (cr3, "3"), (cr4, "4"), (cr5, "5"), (cr6, "6"), (cr7, "7");
(ctr, "ctr");
(lr, "lr");
(xer, "xer");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ pub(crate) fn target() -> Target {
base.cpu = "mips64r2".into();
base.features = "+mips64r2,+xgot".into();
base.max_atomic_width = Some(64);
// FIXME(compiler-team#422): musl targets should be dynamically linked by default.
base.crt_static_default = true;
Target {
// LLVM doesn't recognize "muslabi64" yet.
llvm_target: "mips64el-unknown-linux-musl".into(),
Expand Down
5 changes: 3 additions & 2 deletions library/alloc/src/collections/btree/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ impl<K, V> InternalNode<K, V> {
/// initialized and valid edge. This function does not set up
/// such an edge.
unsafe fn new<A: Allocator + Clone>(alloc: A) -> Box<Self, A> {
let mut node = Box::<Self, _>::new_uninit_in(alloc);
unsafe {
let mut node = Box::<Self, _>::new_uninit_in(alloc);
// We only need to initialize the data; the edges are MaybeUninit.
// SAFETY: argument points to the `node.data` `LeafNode`
LeafNode::init(&raw mut (*node.as_mut_ptr()).data);
// SAFETY: `node.data` was just initialized and `node.edges` is MaybeUninit.
node.assume_init()
}
}
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/ascii/ascii_char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ impl AsciiChar {
#[track_caller]
pub const unsafe fn digit_unchecked(d: u8) -> Self {
assert_unsafe_precondition!(
check_language_ub,
check_library_ub,
"`ascii::Char::digit_unchecked` input cannot exceed 9.",
(d: u8 = d) => d < 10
);
Expand Down
6 changes: 3 additions & 3 deletions library/core/src/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1460,8 +1460,8 @@ macro_rules! int_impl {
#[inline]
pub const unsafe fn unchecked_exact_shl(self, rhs: u32) -> $SelfT {
assert_unsafe_precondition!(
check_language_ub,
concat!(stringify!($SelfT), "::unchecked_exact_shl cannot shift out non-zero bits"),
check_library_ub,
concat!(stringify!($SelfT), "::unchecked_exact_shl cannot shift out bits that would change the value of the first bit"),
(
zeros: u32 = self.leading_zeros(),
ones: u32 = self.leading_ones(),
Expand Down Expand Up @@ -1638,7 +1638,7 @@ macro_rules! int_impl {
#[inline]
pub const unsafe fn unchecked_exact_shr(self, rhs: u32) -> $SelfT {
assert_unsafe_precondition!(
check_language_ub,
check_library_ub,
concat!(stringify!($SelfT), "::unchecked_exact_shr cannot shift out non-zero bits"),
(
zeros: u32 = self.trailing_zeros(),
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1865,7 +1865,7 @@ macro_rules! uint_impl {
#[inline]
pub const unsafe fn unchecked_exact_shl(self, rhs: u32) -> $SelfT {
assert_unsafe_precondition!(
check_language_ub,
check_library_ub,
concat!(stringify!($SelfT), "::exact_shl_unchecked cannot shift out non-zero bits"),
(
zeros: u32 = self.leading_zeros(),
Expand Down Expand Up @@ -2037,7 +2037,7 @@ macro_rules! uint_impl {
#[inline]
pub const unsafe fn unchecked_exact_shr(self, rhs: u32) -> $SelfT {
assert_unsafe_precondition!(
check_language_ub,
check_library_ub,
concat!(stringify!($SelfT), "::exact_shr_unchecked cannot shift out non-zero bits"),
(
zeros: u32 = self.trailing_zeros(),
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/slice/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ unsafe impl<T> const SliceIndex<[T]> for usize {
#[track_caller]
unsafe fn get_unchecked(self, slice: *const [T]) -> *const T {
assert_unsafe_precondition!(
check_language_ub,
check_language_ub, // okay because of the `assume` below
"slice::get_unchecked requires that the index is within the slice",
(this: usize = self, len: usize = slice.len()) => this < len
);
Expand Down
5 changes: 3 additions & 2 deletions library/core/src/ub_checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ use crate::intrinsics::{self, const_eval_select};
/// slow down const-eval/Miri and we'll get the panic message instead of the interpreter's nice
/// diagnostic, but our ability to detect UB is unchanged.
/// But if `check_language_ub` is used when the check is actually for library UB, the check is
/// omitted in const-eval/Miri and thus if we eventually execute language UB which relies on the
/// library UB, the backtrace Miri reports may be far removed from original cause.
/// omitted in const-eval/Miri and thus UB might occur undetected. Even if we eventually execute
/// language UB which relies on the library UB, the backtrace Miri reports may be far removed from
/// original cause.
///
/// These checks are behind a condition which is evaluated at codegen time, not expansion time like
/// [`debug_assert`]. This means that a standard library built with optimizations and debug
Expand Down
22 changes: 17 additions & 5 deletions library/std_detect/src/detect/os/darwin/aarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,34 @@ pub(crate) fn detect_features() -> cache::Initializer {
// Armv8.0 features not using the standard identifiers
let fp = _sysctlbyname(c"hw.optional.floatingpoint");
let asimd = _sysctlbyname(c"hw.optional.AdvSIMD");
let crc = _sysctlbyname(c"hw.optional.armv8_crc32");
let crc_old = _sysctlbyname(c"hw.optional.armv8_crc32");

// Armv8 and Armv9 features using the standard identifiers
let aes = _sysctlbyname(c"hw.optional.arm.FEAT_AES");
let bf16 = _sysctlbyname(c"hw.optional.arm.FEAT_BF16");
let bti = _sysctlbyname(c"hw.optional.arm.FEAT_BTI");
let crc = _sysctlbyname(c"hw.optional.arm.FEAT_CRC32");
let cssc = _sysctlbyname(c"hw.optional.arm.FEAT_CSSC");
let dit = _sysctlbyname(c"hw.optional.arm.FEAT_DIT");
let dotprod = _sysctlbyname(c"hw.optional.arm.FEAT_DotProd");
let dpb = _sysctlbyname(c"hw.optional.arm.FEAT_DPB");
let dpb2 = _sysctlbyname(c"hw.optional.arm.FEAT_DPB2");
let dotprod = _sysctlbyname(c"hw.optional.arm.FEAT_DotProd");
let ecv = _sysctlbyname(c"hw.optional.arm.FEAT_ECV");
let fcma = _sysctlbyname(c"hw.optional.arm.FEAT_FCMA");
let fhm = _sysctlbyname(c"hw.optional.arm.FEAT_FHM");
let fp16 = _sysctlbyname(c"hw.optional.arm.FEAT_FP16");
let frintts = _sysctlbyname(c"hw.optional.arm.FEAT_FRINTTS");
let flagm = _sysctlbyname(c"hw.optional.arm.FEAT_FlagM");
let flagm2 = _sysctlbyname(c"hw.optional.arm.FEAT_FlagM2");
let fp16 = _sysctlbyname(c"hw.optional.arm.FEAT_FP16");
let frintts = _sysctlbyname(c"hw.optional.arm.FEAT_FRINTTS");
let hbc = _sysctlbyname(c"hw.optional.arm.FEAT_HBC");
let i8mm = _sysctlbyname(c"hw.optional.arm.FEAT_I8MM");
let jsconv = _sysctlbyname(c"hw.optional.arm.FEAT_JSCVT");
let rcpc = _sysctlbyname(c"hw.optional.arm.FEAT_LRCPC");
let rcpc2 = _sysctlbyname(c"hw.optional.arm.FEAT_LRCPC2");
let lse = _sysctlbyname(c"hw.optional.arm.FEAT_LSE");
let lse2 = _sysctlbyname(c"hw.optional.arm.FEAT_LSE2");
let mte = _sysctlbyname(c"hw.optional.arm.FEAT_MTE");
let mte2 = _sysctlbyname(c"hw.optional.arm.FEAT_MTE2");
let pauth = _sysctlbyname(c"hw.optional.arm.FEAT_PAuth");
let pmull = _sysctlbyname(c"hw.optional.arm.FEAT_PMULL");
let rdm = _sysctlbyname(c"hw.optional.arm.FEAT_RDM");
Expand All @@ -72,6 +75,7 @@ pub(crate) fn detect_features() -> cache::Initializer {
let sha512 = _sysctlbyname(c"hw.optional.arm.FEAT_SHA512");
let sme = _sysctlbyname(c"hw.optional.arm.FEAT_SME");
let sme2 = _sysctlbyname(c"hw.optional.arm.FEAT_SME2");
let sme2p1 = _sysctlbyname(c"hw.optional.arm.FEAT_SME2p1");
let sme_f64f64 = _sysctlbyname(c"hw.optional.arm.FEAT_SME_F64F64");
let sme_i16i64 = _sysctlbyname(c"hw.optional.arm.FEAT_SME_I16I64");
let ssbs = _sysctlbyname(c"hw.optional.arm.FEAT_SSBS");
Expand All @@ -87,6 +91,12 @@ pub(crate) fn detect_features() -> cache::Initializer {
let ebf16 = _sysctlbyname(c"hw.optional.arm.FEAT_EBF16");
let fpac = _sysctlbyname(c"hw.optional.arm.FEAT_FPAC");
let fpaccombine = _sysctlbyname(c"hw.optional.arm.FEAT_FPACCOMBINE");
let mte_async = _sysctlbyname(c"hw.optional.arm.FEAT_MTE_ASYNC");
let mte_canonical_tags = _sysctlbyname(c"hw.optional.arm.FEAT_MTE_CANONICAL_TAGS");
let mte_no_address_tags = _sysctlbyname(c"hw.optional.arm.FEAT_MTE_NO_ADDRESS_TAGS");
let mte_store_only = _sysctlbyname(c"hw.optional.arm.FEAT_MTE_STORE_ONLY");
let mte3 = _sysctlbyname(c"hw.optional.arm.FEAT_MTE3");
let mte4 = _sysctlbyname(c"hw.optional.arm.FEAT_MTE4");
let pacimp = _sysctlbyname(c"hw.optional.arm.FEAT_PACIMP");
let pauth2 = _sysctlbyname(c"hw.optional.arm.FEAT_PAuth2");
let rpres = _sysctlbyname(c"hw.optional.arm.FEAT_RPRES");
Expand All @@ -111,7 +121,7 @@ pub(crate) fn detect_features() -> cache::Initializer {
enable_feature(Feature::asimd, asimd);
enable_feature(Feature::bf16, bf16);
enable_feature(Feature::bti, bti);
enable_feature(Feature::crc, crc);
enable_feature(Feature::crc, crc_old || crc);
enable_feature(Feature::cssc, cssc);
enable_feature(Feature::dit, dit);
enable_feature(Feature::dotprod, dotprod);
Expand All @@ -130,6 +140,7 @@ pub(crate) fn detect_features() -> cache::Initializer {
enable_feature(Feature::jsconv, jsconv);
enable_feature(Feature::lse, lse);
enable_feature(Feature::lse2, lse2);
enable_feature(Feature::mte, mte && mte2);
enable_feature(Feature::paca, pauth);
enable_feature(Feature::pacg, pauth);
enable_feature(Feature::pmull, aes && pmull);
Expand All @@ -141,6 +152,7 @@ pub(crate) fn detect_features() -> cache::Initializer {
enable_feature(Feature::sha3, sha512 && sha3 && asimd);
enable_feature(Feature::sme, sme);
enable_feature(Feature::sme2, sme2);
enable_feature(Feature::sme2p1, sme2p1);
enable_feature(Feature::sme_f64f64, sme_f64f64);
enable_feature(Feature::sme_i16i64, sme_i16i64);
enable_feature(Feature::ssbs, ssbs);
Expand Down
Loading
Loading