Skip to content

Extend assembly test to nail down behavior #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: c-cmse-nonsecure-entry
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions compiler/rustc_codegen_cranelift/src/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ pub(crate) fn conv_to_call_conv(sess: &Session, c: Conv, default_call_conv: Call
Conv::CCmseNonSecureCall => {
sess.dcx().fatal("C-cmse-nonsecure-call call conv is not yet implemented");
}
Conv::CCmseNonSecureEntry => {
sess.dcx().fatal("C-cmse-nonsecure-entry call conv is not yet implemented");
}

Conv::Msp430Intr | Conv::PtxKernel | Conv::AvrInterrupt | Conv::AvrNonBlockingInterrupt => {
unreachable!("tried to use {c:?} call conv which only exists on an unsupported target");
Expand Down
11 changes: 8 additions & 3 deletions compiler/rustc_codegen_llvm/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,9 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
if let Conv::RiscvInterrupt { kind } = self.conv {
func_attrs.push(llvm::CreateAttrStringValue(cx.llcx, "interrupt", kind.as_str()));
}
if let Conv::CCmseNonSecureEntry = self.conv {
func_attrs.push(llvm::CreateAttrString(cx.llcx, "cmse_nonsecure_entry"))
}
attributes::apply_to_llfn(llfn, llvm::AttributePlace::Function, &{ func_attrs });

let mut i = 0;
Expand Down Expand Up @@ -606,9 +609,11 @@ impl<'tcx> AbiBuilderMethods<'tcx> for Builder<'_, '_, 'tcx> {
impl From<Conv> for llvm::CallConv {
fn from(conv: Conv) -> Self {
match conv {
Conv::C | Conv::Rust | Conv::CCmseNonSecureCall | Conv::RiscvInterrupt { .. } => {
llvm::CCallConv
}
Conv::C
| Conv::Rust
| Conv::CCmseNonSecureCall
| Conv::CCmseNonSecureEntry
| Conv::RiscvInterrupt { .. } => llvm::CCallConv,
Conv::Cold => llvm::ColdCallConv,
Conv::PreserveMost => llvm::PreserveMost,
Conv::PreserveAll => llvm::PreserveAll,
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_codegen_llvm/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,9 +475,6 @@ pub fn from_fn_attrs<'ll, 'tcx>(
let allocated_pointer = AttributeKind::AllocatedPointer.create_attr(cx.llcx);
attributes::apply_to_llfn(llfn, AttributePlace::Argument(0), &[allocated_pointer]);
}
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::CMSE_NONSECURE_ENTRY) {
to_add.push(llvm::CreateAttrString(cx.llcx, "cmse_nonsecure_entry"));
}
if let Some(align) = codegen_fn_attrs.alignment {
llvm::set_alignment(llfn, align);
}
Expand Down
18 changes: 0 additions & 18 deletions compiler/rustc_codegen_ssa/src/codegen_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,24 +195,6 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
}
}
}
sym::cmse_nonsecure_entry => {
if let Some(fn_sig) = fn_sig()
&& !matches!(fn_sig.skip_binder().abi(), abi::Abi::C { .. })
{
struct_span_code_err!(
tcx.dcx(),
attr.span,
E0776,
"`#[cmse_nonsecure_entry]` requires C ABI"
)
.emit();
}
if !tcx.sess.target.llvm_target.contains("thumbv8m") {
struct_span_code_err!(tcx.dcx(), attr.span, E0775, "`#[cmse_nonsecure_entry]` is only valid for targets with the TrustZone-M extension")
.emit();
}
codegen_fn_attrs.flags |= CodegenFnAttrFlags::CMSE_NONSECURE_ENTRY
}
sym::thread_local => codegen_fn_attrs.flags |= CodegenFnAttrFlags::THREAD_LOCAL,
sym::track_caller => {
let is_closure = tcx.is_closure_like(did.to_def_id());
Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_error_codes/src/error_codes/E0775.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ extension.

Erroneous code example:

```compile_fail,E0775
```ignore (no longer emitted)
#![feature(cmse_nonsecure_entry)]

#[cmse_nonsecure_entry]
pub extern "C" fn entry_function() {}
pub extern "C-cmse-nonsecure-entry" fn entry_function() {}
```

To fix this error, compile your code for a Rust target that supports the
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_error_codes/src/error_codes/E0776.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#### Note: this error code is no longer emitted by the compiler.

`#[cmse_nonsecure_entry]` functions require a C ABI

Erroneous code example:

```compile_fail,E0776
```ignore (no longer emitted)
#![feature(cmse_nonsecure_entry)]

#[no_mangle]
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_error_codes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -678,3 +678,4 @@ E0798: 0798,
// E0723, // unstable feature in `const` context
// E0738, // Removed; errored on `#[track_caller] fn`s in `extern "Rust" { ... }`.
// E0744, // merged into E0728
// E0776, // Removed; cmse_nonsecure_entry is now `C-cmse-nonsecure-entry`
4 changes: 0 additions & 4 deletions compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
EncodeCrossCrate::No, experimental!(register_tool),
),

gated!(
cmse_nonsecure_entry, Normal, template!(Word), WarnFollowing,
EncodeCrossCrate::No, experimental!(cmse_nonsecure_entry)
),
// RFC 2632
gated!(
const_trait, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No, const_trait_impl,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ declare_features! (
(unstable, closure_lifetime_binder, "1.64.0", Some(97362)),
/// Allows `#[track_caller]` on closures and coroutines.
(unstable, closure_track_caller, "1.57.0", Some(87417)),
/// Allows to use the `#[cmse_nonsecure_entry]` attribute.
/// Allows `extern "C-cmse-nonsecure-entry" fn()`.
(unstable, cmse_nonsecure_entry, "1.48.0", Some(75835)),
/// Allows `async {}` expressions in const contexts.
(unstable, const_async_blocks, "1.53.0", Some(85368)),
Expand Down
4 changes: 1 addition & 3 deletions compiler/rustc_middle/src/middle/codegen_fn_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ bitflags::bitflags! {
/// #[ffi_const]: applies clang's `const` attribute to a foreign function
/// declaration.
const FFI_CONST = 1 << 12;
/// #[cmse_nonsecure_entry]: with a TrustZone-M extension, declare a
/// function as an entry function from Non-Secure code.
const CMSE_NONSECURE_ENTRY = 1 << 13;
// (Bit 13 was used for `#[cmse_nonsecure_entry]`, but is now unused.)
// (Bit 14 was used for `#[coverage(off)]`, but is now unused.)
/// `#[used(linker)]`:
/// indicates that neither LLVM nor the linker will eliminate this function.
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_middle/src/ty/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,7 @@ pub fn fn_can_unwind(tcx: TyCtxt<'_>, fn_def_id: Option<DefId>, abi: SpecAbi) ->
| RiscvInterruptM
| RiscvInterruptS
| CCmseNonSecureCall
| CCmseNonSecureEntry
| Unadjusted => false,
Rust | RustCall | RustCold | RustIntrinsic => {
tcx.sess.panic_strategy() == PanicStrategy::Unwind
Expand Down
24 changes: 0 additions & 24 deletions compiler/rustc_passes/src/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
| [sym::rustc_must_implement_one_of, ..]
| [sym::rustc_deny_explicit_impl, ..]
| [sym::const_trait, ..] => self.check_must_be_applied_to_trait(attr, span, target),
[sym::cmse_nonsecure_entry, ..] => {
self.check_cmse_nonsecure_entry(hir_id, attr, span, target)
}
[sym::collapse_debuginfo, ..] => self.check_collapse_debuginfo(attr, span, target),
[sym::must_not_suspend, ..] => self.check_must_not_suspend(attr, span, target),
[sym::must_use, ..] => self.check_must_use(hir_id, attr, target),
Expand Down Expand Up @@ -555,27 +552,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
}
}

/// Checks if `#[cmse_nonsecure_entry]` is applied to a function definition.
fn check_cmse_nonsecure_entry(
&self,
hir_id: HirId,
attr: &Attribute,
span: Span,
target: Target,
) {
match target {
Target::Fn
| Target::Method(MethodKind::Trait { body: true } | MethodKind::Inherent) => {}
_ => {
self.dcx().emit_err(errors::AttrShouldBeAppliedToFn {
attr_span: attr.span,
defn_span: span,
on_crate: hir_id == CRATE_HIR_ID,
});
}
}
}

/// Debugging aid for `object_lifetime_default` query.
fn check_object_lifetime_default(&self, hir_id: HirId) {
let tcx = self.tcx;
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_smir/src/rustc_internal/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ impl RustcInternal for Abi {
Abi::AvrInterrupt => rustc_target::spec::abi::Abi::AvrInterrupt,
Abi::AvrNonBlockingInterrupt => rustc_target::spec::abi::Abi::AvrNonBlockingInterrupt,
Abi::CCmseNonSecureCall => rustc_target::spec::abi::Abi::CCmseNonSecureCall,
Abi::CCmseNonSecureEntry => rustc_target::spec::abi::Abi::CCmseNonSecureEntry,
Abi::System { unwind } => rustc_target::spec::abi::Abi::System { unwind },
Abi::RustIntrinsic => rustc_target::spec::abi::Abi::RustIntrinsic,
Abi::RustCall => rustc_target::spec::abi::Abi::RustCall,
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_smir/src/rustc_smir/convert/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ impl<'tcx> Stable<'tcx> for rustc_target::abi::call::Conv {
Conv::PreserveAll => CallConvention::PreserveAll,
Conv::ArmAapcs => CallConvention::ArmAapcs,
Conv::CCmseNonSecureCall => CallConvention::CCmseNonSecureCall,
Conv::CCmseNonSecureEntry => CallConvention::CCmseNonSecureEntry,
Conv::Msp430Intr => CallConvention::Msp430Intr,
Conv::PtxKernel => CallConvention::PtxKernel,
Conv::X86Fastcall => CallConvention::X86Fastcall,
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_smir/src/rustc_smir/convert/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,7 @@ impl<'tcx> Stable<'tcx> for rustc_target::spec::abi::Abi {
abi::Abi::AvrInterrupt => Abi::AvrInterrupt,
abi::Abi::AvrNonBlockingInterrupt => Abi::AvrNonBlockingInterrupt,
abi::Abi::CCmseNonSecureCall => Abi::CCmseNonSecureCall,
abi::Abi::CCmseNonSecureEntry => Abi::CCmseNonSecureEntry,
abi::Abi::System { unwind } => Abi::System { unwind },
abi::Abi::RustIntrinsic => Abi::RustIntrinsic,
abi::Abi::RustCall => Abi::RustCall,
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_target/src/abi/call/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ pub enum Conv {
// Target-specific calling conventions.
ArmAapcs,
CCmseNonSecureCall,
CCmseNonSecureEntry,

Msp430Intr,

Expand Down Expand Up @@ -945,6 +946,7 @@ impl FromStr for Conv {
"RustCold" => Ok(Conv::Rust),
"ArmAapcs" => Ok(Conv::ArmAapcs),
"CCmseNonSecureCall" => Ok(Conv::CCmseNonSecureCall),
"CCmseNonSecureEntry" => Ok(Conv::CCmseNonSecureEntry),
"Msp430Intr" => Ok(Conv::Msp430Intr),
"PtxKernel" => Ok(Conv::PtxKernel),
"X86Fastcall" => Ok(Conv::X86Fastcall),
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_target/src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ impl ToJson for crate::abi::call::Conv {
Self::PreserveAll => "PreserveAll",
Self::ArmAapcs => "ArmAapcs",
Self::CCmseNonSecureCall => "CCmseNonSecureCall",
Self::CCmseNonSecureEntry => "CCmseNonSecureEntry",
Self::Msp430Intr => "Msp430Intr",
Self::PtxKernel => "PtxKernel",
Self::X86Fastcall => "X86Fastcall",
Expand Down
23 changes: 15 additions & 8 deletions compiler/rustc_target/src/spec/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ pub enum Abi {
AvrInterrupt,
AvrNonBlockingInterrupt,
CCmseNonSecureCall,
CCmseNonSecureEntry,
System {
unwind: bool,
},
Expand Down Expand Up @@ -122,6 +123,7 @@ const AbiDatas: &[AbiData] = &[
AbiData { abi: Abi::AvrInterrupt, name: "avr-interrupt" },
AbiData { abi: Abi::AvrNonBlockingInterrupt, name: "avr-non-blocking-interrupt" },
AbiData { abi: Abi::CCmseNonSecureCall, name: "C-cmse-nonsecure-call" },
AbiData { abi: Abi::CCmseNonSecureEntry, name: "C-cmse-nonsecure-entry" },
AbiData { abi: Abi::System { unwind: false }, name: "system" },
AbiData { abi: Abi::System { unwind: true }, name: "system-unwind" },
AbiData { abi: Abi::RustIntrinsic, name: "rust-intrinsic" },
Expand Down Expand Up @@ -242,6 +244,10 @@ pub fn is_stable(name: &str) -> Result<(), AbiDisabled> {
feature: sym::abi_c_cmse_nonsecure_call,
explain: "C-cmse-nonsecure-call ABI is experimental and subject to change",
}),
"C-cmse-nonsecure-entry" => Err(AbiDisabled::Unstable {
feature: sym::cmse_nonsecure_entry,
explain: "C-cmse-nonsecure-entry ABI is experimental and subject to change",
}),
_ => Err(AbiDisabled::Unrecognized),
}
}
Expand Down Expand Up @@ -284,15 +290,16 @@ impl Abi {
AvrInterrupt => 23,
AvrNonBlockingInterrupt => 24,
CCmseNonSecureCall => 25,
CCmseNonSecureEntry => 26,
// Cross-platform ABIs
System { unwind: false } => 26,
System { unwind: true } => 27,
RustIntrinsic => 28,
RustCall => 29,
Unadjusted => 30,
RustCold => 31,
RiscvInterruptM => 32,
RiscvInterruptS => 33,
System { unwind: false } => 27,
System { unwind: true } => 28,
RustIntrinsic => 29,
RustCall => 30,
Unadjusted => 31,
RustCold => 32,
RiscvInterruptM => 33,
RiscvInterruptS => 34,
};
debug_assert!(
AbiDatas
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_target/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2672,7 +2672,10 @@ impl Target {
}
X86Interrupt => ["x86", "x86_64"].contains(&&self.arch[..]),
Aapcs { .. } => "arm" == self.arch,
CCmseNonSecureCall => ["arm", "aarch64"].contains(&&self.arch[..]),
CCmseNonSecureCall | CCmseNonSecureEntry => {
["thumbv8m.main-none-eabi", "thumbv8m.main-none-eabihf", "thumbv8m.base-none-eabi"]
.contains(&&self.llvm_target[..])
}
Win64 { .. } | SysV64 { .. } => self.arch == "x86_64",
PtxKernel => self.arch == "nvptx64",
Msp430Interrupt => self.arch == "msp430",
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_ty_utils/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ fn conv_from_spec_abi(tcx: TyCtxt<'_>, abi: SpecAbi, c_variadic: bool) -> Conv {
SysV64 { .. } => Conv::X86_64SysV,
Aapcs { .. } => Conv::ArmAapcs,
CCmseNonSecureCall => Conv::CCmseNonSecureCall,
CCmseNonSecureEntry => Conv::CCmseNonSecureEntry,
PtxKernel => Conv::PtxKernel,
Msp430Interrupt => Conv::Msp430Intr,
X86Interrupt => Conv::X86Intr,
Expand Down
1 change: 1 addition & 0 deletions compiler/stable_mir/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ pub enum CallConvention {
// Target-specific calling conventions.
ArmAapcs,
CCmseNonSecureCall,
CCmseNonSecureEntry,

Msp430Intr,

Expand Down
1 change: 1 addition & 0 deletions compiler/stable_mir/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,7 @@ pub enum Abi {
AvrInterrupt,
AvrNonBlockingInterrupt,
CCmseNonSecureCall,
CCmseNonSecureEntry,
System { unwind: bool },
RustIntrinsic,
RustCall,
Expand Down
2 changes: 1 addition & 1 deletion library/stdarch
Submodule stdarch updated 96 files
+16 −8 .github/workflows/main.yml
+1 −1 ci/docker/aarch64-unknown-linux-gnu/Dockerfile
+1 −1 ci/docker/arm-unknown-linux-gnueabihf/Dockerfile
+1 −1 ci/docker/i586-unknown-linux-gnu/Dockerfile
+1 −1 ci/docker/i686-unknown-linux-gnu/Dockerfile
+1 −1 ci/docker/mips-unknown-linux-gnu/Dockerfile
+1 −1 ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile
+1 −1 ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile
+1 −1 ci/docker/mipsel-unknown-linux-musl/Dockerfile
+1 −1 ci/docker/nvptx64-nvidia-cuda/Dockerfile
+1 −1 ci/docker/powerpc-unknown-linux-gnu/Dockerfile
+1 −1 ci/docker/powerpc64-unknown-linux-gnu/Dockerfile
+1 −1 ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile
+1 −1 ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile
+1 −1 ci/docker/s390x-unknown-linux-gnu/Dockerfile
+1 −1 ci/docker/wasm32-wasip1/Dockerfile
+6 −7 ci/docker/x86_64-unknown-linux-gnu-emulated/Dockerfile
+0 −61 ci/docker/x86_64-unknown-linux-gnu-emulated/cpuid.def
+1 −1 ci/docker/x86_64-unknown-linux-gnu/Dockerfile
+0 −3 crates/core_arch/Cargo.toml
+764 −0 crates/core_arch/avx512bw.md
+2,633 −0 crates/core_arch/avx512f.md
+0 −304 crates/core_arch/missing-x86.md
+1 −4 crates/core_arch/src/lib.rs
+0 −12 crates/core_arch/src/mod.rs
+17 −17 crates/core_arch/src/powerpc/altivec.rs
+1 −205 crates/core_arch/src/simd.rs
+1 −1 crates/core_arch/src/wasm32/mod.rs
+30 −70 crates/core_arch/src/wasm32/relaxed_simd.rs
+47 −17 crates/core_arch/src/wasm32/simd128.rs
+3 −9 crates/core_arch/src/x86/adx.rs
+48 −133 crates/core_arch/src/x86/avx.rs
+65 −55 crates/core_arch/src/x86/avx2.rs
+1 −356 crates/core_arch/src/x86/avx512bf16.rs
+36 −19 crates/core_arch/src/x86/avx512bitalg.rs
+5,902 −7,417 crates/core_arch/src/x86/avx512bw.rs
+20 −6 crates/core_arch/src/x86/avx512cd.rs
+0 −10,701 crates/core_arch/src/x86/avx512dq.rs
+2,349 −3,384 crates/core_arch/src/x86/avx512f.rs
+0 −26,998 crates/core_arch/src/x86/avx512fp16.rs
+26 −569 crates/core_arch/src/x86/avx512ifma.rs
+121 −49 crates/core_arch/src/x86/avx512vbmi2.rs
+0 −876 crates/core_arch/src/x86/avx512vnni.rs
+42 −19 crates/core_arch/src/x86/avx512vpopcntdq.rs
+0 −409 crates/core_arch/src/x86/avxneconvert.rs
+0 −20 crates/core_arch/src/x86/bmi1.rs
+0 −8 crates/core_arch/src/x86/bt.rs
+86 −0 crates/core_arch/src/x86/cpuid.rs
+0 −8 crates/core_arch/src/x86/f16c.rs
+89 −78 crates/core_arch/src/x86/fma.rs
+1 −1 crates/core_arch/src/x86/fxsr.rs
+21 −21 crates/core_arch/src/x86/gfni.rs
+0 −30 crates/core_arch/src/x86/macros.rs
+5 −117 crates/core_arch/src/x86/mod.rs
+5 −1 crates/core_arch/src/x86/pclmulqdq.rs
+4 −4 crates/core_arch/src/x86/rtm.rs
+45 −21 crates/core_arch/src/x86/sse.rs
+43 −171 crates/core_arch/src/x86/sse2.rs
+10 −31 crates/core_arch/src/x86/sse41.rs
+3 −61 crates/core_arch/src/x86/sse4a.rs
+255 −20 crates/core_arch/src/x86/tbm.rs
+16 −31 crates/core_arch/src/x86/test.rs
+31 −10 crates/core_arch/src/x86/xsave.rs
+3 −9 crates/core_arch/src/x86_64/adx.rs
+0 −604 crates/core_arch/src/x86_64/amx.rs
+1 −21 crates/core_arch/src/x86_64/avx.rs
+48 −0 crates/core_arch/src/x86_64/avx2.rs
+0 −45 crates/core_arch/src/x86_64/avx512bw.rs
+85 −698 crates/core_arch/src/x86_64/avx512f.rs
+0 −309 crates/core_arch/src/x86_64/avx512fp16.rs
+0 −8 crates/core_arch/src/x86_64/bt.rs
+1 −1 crates/core_arch/src/x86_64/fxsr.rs
+0 −13 crates/core_arch/src/x86_64/macros.rs
+2 −14 crates/core_arch/src/x86_64/mod.rs
+9 −11 crates/core_arch/src/x86_64/sse2.rs
+1 −1 crates/core_arch/src/x86_64/sse41.rs
+0 −225 crates/core_arch/src/x86_64/tbm.rs
+23 −11 crates/core_arch/src/x86_64/xsave.rs
+86 −184 crates/std_detect/src/detect/arch/aarch64.rs
+0 −41 crates/std_detect/src/detect/arch/x86.rs
+11 −19 crates/std_detect/src/detect/cache.rs
+8 −190 crates/std_detect/src/detect/os/linux/aarch64.rs
+12 −39 crates/std_detect/src/detect/os/x86.rs
+4 −0 crates/std_detect/src/lib.rs
+0 −53 crates/std_detect/tests/cpu-detection.rs
+0 −1 crates/std_detect/tests/macro_trailing_commas.rs
+19 −45 crates/std_detect/tests/x86-specific.rs
+26 −14 crates/stdarch-gen-arm/src/main.rs
+29 −23 crates/stdarch-test/src/disassembly.rs
+2 −2 crates/stdarch-test/src/lib.rs
+1 −1 crates/stdarch-verify/Cargo.toml
+1 −29 crates/stdarch-verify/src/lib.rs
+0 −1 crates/stdarch-verify/tests/arm.rs
+1 −2 crates/stdarch-verify/tests/mips.rs
+230 −245 crates/stdarch-verify/tests/x86-intel.rs
+110,103 −120,388 crates/stdarch-verify/x86-intel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ LLVM, the Rust compiler and the linker are providing
TrustZone-M feature.

One of the things provided, with this unstable feature, is the
`cmse_nonsecure_entry` attribute. This attribute marks a Secure function as an
`C-cmse-nonsecure-entry` ABI. This ABI marks a Secure function as an
entry function (see [section
5.4](https://developer.arm.com/documentation/ecm0359818/latest/) for details).
With this attribute, the compiler will do the following:
With this ABI, the compiler will do the following:
* add a special symbol on the function which is the `__acle_se_` prefix and the
standard function name
* constrain the number of parameters to avoid using the Non-Secure stack
Expand All @@ -38,11 +38,11 @@ gateway veneer.
<!-- NOTE(ignore) this example is specific to thumbv8m targets -->

``` rust,ignore
#![no_std]
#![feature(cmse_nonsecure_entry)]

#[no_mangle]
#[cmse_nonsecure_entry]
pub extern "C" fn entry_function(input: u32) -> u32 {
pub extern "C-cmse-nonsecure-entry" fn entry_function(input: u32) -> u32 {
input + 6
}
```
Expand Down
2 changes: 1 addition & 1 deletion src/tools/cargo
Submodule cargo updated 40 files
+1 −1 CHANGELOG.md
+100 −108 Cargo.lock
+6 −6 Cargo.toml
+1 −1 crates/cargo-util-schemas/Cargo.toml
+38 −47 crates/cargo-util-schemas/src/manifest/mod.rs
+1 −6 crates/home/src/windows.rs
+2 −2 crates/xtask-build-man/src/main.rs
+1 −1 src/cargo/core/compiler/fingerprint/mod.rs
+1 −1 src/cargo/core/compiler/mod.rs
+15 −15 src/cargo/core/manifest.rs
+1 −1 src/cargo/core/shell.rs
+6 −6 src/cargo/core/workspace.rs
+5 −10 src/cargo/ops/cargo_package.rs
+2 −2 src/cargo/ops/fix.rs
+38 −24 src/cargo/ops/registry/publish.rs
+1 −1 src/cargo/ops/vendor.rs
+5 −5 src/cargo/sources/path.rs
+4 −4 src/cargo/util/context/mod.rs
+2 −2 src/cargo/util/lints.rs
+172 −189 src/cargo/util/toml/mod.rs
+31 −31 src/cargo/util/toml/targets.rs
+0 −6 src/doc/man/cargo.md
+9 −21 src/doc/man/generated_txt/cargo.txt
+12 −18 src/doc/src/commands/cargo.md
+38 −13 src/doc/src/faq.md
+11 −13 src/doc/src/reference/unstable.md
+8 −26 src/etc/man/cargo.1
+4 −1 tests/testsuite/cargo_add/rust_version_ignore/mod.rs
+4 −1 tests/testsuite/cargo_add/rust_version_incompatible/mod.rs
+4 −1 tests/testsuite/cargo_add/rust_version_latest/mod.rs
+4 −1 tests/testsuite/cargo_add/rust_version_older/mod.rs
+4 −1 tests/testsuite/cargo_add/rustc_ignore/mod.rs
+4 −1 tests/testsuite/cargo_add/rustc_incompatible/mod.rs
+4 −1 tests/testsuite/cargo_add/rustc_latest/mod.rs
+4 −1 tests/testsuite/cargo_add/rustc_older/mod.rs
+1 −1 tests/testsuite/check.rs
+2 −2 tests/testsuite/inheritable_workspace_fields.rs
+0 −2 tests/testsuite/jobserver.rs
+103 −121 tests/testsuite/publish.rs
+71 −20 tests/testsuite/rust_version.rs
3 changes: 3 additions & 0 deletions src/tools/rust-analyzer/crates/hir-ty/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ pub enum FnAbi {
AvrNonBlockingInterrupt,
C,
CCmseNonsecureCall,
CCmseNonsecureEntry,
CDecl,
CDeclUnwind,
CUnwind,
Expand Down Expand Up @@ -431,6 +432,7 @@ impl FnAbi {
s if *s == sym::avr_dash_interrupt => FnAbi::AvrInterrupt,
s if *s == sym::avr_dash_non_dash_blocking_dash_interrupt => FnAbi::AvrNonBlockingInterrupt,
s if *s == sym::C_dash_cmse_dash_nonsecure_dash_call => FnAbi::CCmseNonsecureCall,
s if *s == sym::C_dash_cmse_dash_nonsecure_dash_entry => FnAbi::CCmseNonsecureEntry,
s if *s == sym::C_dash_unwind => FnAbi::CUnwind,
s if *s == sym::C => FnAbi::C,
s if *s == sym::cdecl_dash_unwind => FnAbi::CDeclUnwind,
Expand Down Expand Up @@ -474,6 +476,7 @@ impl FnAbi {
FnAbi::AvrNonBlockingInterrupt => "avr-non-blocking-interrupt",
FnAbi::C => "C",
FnAbi::CCmseNonsecureCall => "C-cmse-nonsecure-call",
FnAbi::CCmseNonsecureEntry => "C-cmse-nonsecure-entry",
FnAbi::CDecl => "C-decl",
FnAbi::CDeclUnwind => "cdecl-unwind",
FnAbi::CUnwind => "C-unwind",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const SUPPORTED_CALLING_CONVENTIONS: &[&str] = &[
"riscv-interrupt-m",
"riscv-interrupt-s",
"C-cmse-nonsecure-call",
"C-cmse-nonsecure-entry",
"wasm",
"system",
"system-unwind",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ define_symbols! {
avr_dash_interrupt = "avr-interrupt",
avr_dash_non_dash_blocking_dash_interrupt = "avr-non-blocking-interrupt",
C_dash_cmse_dash_nonsecure_dash_call = "C-cmse-nonsecure-call",
C_dash_cmse_dash_nonsecure_dash_entry = "C-cmse-nonsecure-entry",
C_dash_unwind = "C-unwind",
cdecl_dash_unwind = "cdecl-unwind",
fastcall_dash_unwind = "fastcall-unwind",
Expand Down
1 change: 0 additions & 1 deletion src/tools/tidy/src/issues.txt
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ ui/closures/issue-87814-2.rs
ui/closures/issue-90871.rs
ui/closures/issue-97607.rs
ui/closures/issue-99565.rs
ui/cmse-nonsecure/cmse-nonsecure-entry/issue-83475.rs
ui/codegen/auxiliary/issue-97708-aux.rs
ui/codegen/issue-101585-128bit-repeat.rs
ui/codegen/issue-16602-1.rs
Expand Down
Loading