Skip to content

Rollup of 7 pull requests #131581

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

Merged
merged 18 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
3743618
Support clobber_abi in MSP430 inline assembly
taiki-e Oct 5, 2024
f2d1edf
Change a few `&Option<T>` into `Option<&T>`
nyurik Sep 28, 2024
d2f93c9
Update library/std/src/sys/pal/unix/process/process_unix.rs
nyurik Oct 2, 2024
442d766
fix ref in process_vxworks.rs
nyurik Oct 9, 2024
a278f15
Update library/std/src/sys/pal/unix/process/process_vxworks.rs
nyurik Oct 9, 2024
181e667
stabilize duration_consts_float
RalfJung Oct 5, 2024
77b3065
Remove deprecation note in the `non_local_definitions` warning
Urgau Oct 11, 2024
0d8a978
intrinsics.fmuladdf{16,32,64,128}: expose llvm.fmuladd.* semantics
jedbrown Jan 6, 2024
395b078
Flatten redundant test module `run_make_support::diff::tests::tests`
Zalathar Aug 17, 2024
f4376c4
Avoid cross-file glob import
Zalathar Oct 12, 2024
1e8d6d1
Make unused_parens's suggestion considering expr's attributes
surechen Oct 11, 2024
3f9aa50
Rollup merge of #124874 - jedbrown:float-mul-add-fast, r=saethlin
tgross35 Oct 12, 2024
02cf62c
Rollup merge of #130962 - nyurik:opts-libs, r=cuviper
tgross35 Oct 12, 2024
3e16b77
Rollup merge of #131289 - RalfJung:duration_consts_float, r=tgross35
tgross35 Oct 12, 2024
9e72070
Rollup merge of #131310 - taiki-e:msp430-clobber-abi, r=Amanieu
tgross35 Oct 12, 2024
fcbf4ac
Rollup merge of #131546 - surechen:fix_129833, r=jieyouxu
tgross35 Oct 12, 2024
1f31925
Rollup merge of #131565 - Urgau:non_local_def-rm-deprecate, r=compile…
tgross35 Oct 12, 2024
5e477c9
Rollup merge of #131576 - Zalathar:tests-tests, r=jieyouxu
tgross35 Oct 12, 2024
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
Next Next commit
Support clobber_abi in MSP430 inline assembly
  • Loading branch information
taiki-e committed Oct 5, 2024
commit 3743618c13d9f4afb06c9778b05b75e879b6919c
10 changes: 10 additions & 0 deletions compiler/rustc_target/src/asm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ pub enum InlineAsmClobberAbi {
RiscV,
LoongArch,
S390x,
Msp430,
}

impl InlineAsmClobberAbi {
Expand Down Expand Up @@ -946,6 +947,10 @@ impl InlineAsmClobberAbi {
"C" | "system" => Ok(InlineAsmClobberAbi::S390x),
_ => Err(&["C", "system"]),
},
InlineAsmArch::Msp430 => match name {
"C" | "system" => Ok(InlineAsmClobberAbi::Msp430),
_ => Err(&["C", "system"]),
},
_ => Err(&[]),
}
}
Expand Down Expand Up @@ -1125,6 +1130,11 @@ impl InlineAsmClobberAbi {
a8, a9, a10, a11, a12, a13, a14, a15,
}
},
InlineAsmClobberAbi::Msp430 => clobbered_regs! {
Msp430 Msp430InlineAsmReg {
r11, r12, r13, r14, r15,
}
},
}
}
}
36 changes: 36 additions & 0 deletions tests/codegen/asm-msp430-clobbers.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//@ assembly-output: emit-asm
//@ compile-flags: --target msp430-none-elf
//@ needs-llvm-components: msp430

#![crate_type = "rlib"]
#![feature(no_core, rustc_attrs, lang_items, asm_experimental_arch)]
#![no_core]

#[lang = "sized"]
trait Sized {}

#[rustc_builtin_macro]
macro_rules! asm {
() => {};
}

// CHECK-LABEL: @sr_clobber
// CHECK: call void asm sideeffect "", "~{sr}"()
#[no_mangle]
pub unsafe fn sr_clobber() {
asm!("", options(nostack, nomem));
}

// CHECK-LABEL: @no_clobber
// CHECK: call void asm sideeffect "", ""()
#[no_mangle]
pub unsafe fn no_clobber() {
asm!("", options(nostack, nomem, preserves_flags));
}

// CHECK-LABEL: @clobber_abi
// CHECK: asm sideeffect "", "={r11},={r12},={r13},={r14},={r15}"()
#[no_mangle]
pub unsafe fn clobber_abi() {
asm!("", clobber_abi("C"), options(nostack, nomem, preserves_flags));
}
Loading