Skip to content

Commit 1398103

Browse files
committed
Auto merge of #136930 - GuillaumeGomez:rollup-hjsijmf, r=GuillaumeGomez
Rollup of 9 pull requests Successful merges: - #135025 (Cast allocas to default address space) - #136217 (Mark condition/carry bit as clobbered in C-SKY inline assembly) - #136699 (std: replace the `FromInner` implementation for addresses with private conversion functions) - #136758 (tests: `-Copt-level=3` instead of `-O` in assembly tests) - #136761 (tests: `-Copt-level=3` instead of `-O` in codegen tests) - #136807 (compiler: internally merge `PtxKernel` into `GpuKernel`) - #136818 (Implement `read*_exact` for `std:io::repeat`) - #136831 (Update stdarch) - #136916 (use cc archiver as default in `cc2ar`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents ced8e65 + 9fe4c6a commit 1398103

File tree

291 files changed

+581
-739
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+581
-739
lines changed

compiler/rustc_codegen_cranelift/src/abi/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,7 @@ pub(crate) fn conv_to_call_conv(sess: &Session, c: Conv, default_call_conv: Call
6565
sess.dcx().fatal("C-cmse-nonsecure-entry call conv is not yet implemented");
6666
}
6767

68-
Conv::Msp430Intr
69-
| Conv::PtxKernel
70-
| Conv::GpuKernel
71-
| Conv::AvrInterrupt
72-
| Conv::AvrNonBlockingInterrupt => {
68+
Conv::Msp430Intr | Conv::GpuKernel | Conv::AvrInterrupt | Conv::AvrNonBlockingInterrupt => {
7369
unreachable!("tried to use {c:?} call conv which only exists on an unsupported target");
7470
}
7571
}

compiler/rustc_codegen_llvm/src/abi.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,6 @@ impl llvm::CallConv {
687687
Conv::AvrNonBlockingInterrupt => llvm::AvrNonBlockingInterrupt,
688688
Conv::ArmAapcs => llvm::ArmAapcsCallConv,
689689
Conv::Msp430Intr => llvm::Msp430Intr,
690-
Conv::PtxKernel => llvm::PtxKernel,
691690
Conv::X86Fastcall => llvm::X86FastcallCallConv,
692691
Conv::X86Intr => llvm::X86_Intr,
693692
Conv::X86Stdcall => llvm::X86StdcallCallConv,

compiler/rustc_codegen_llvm/src/asm.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,9 @@ impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
286286
InlineAsmArch::M68k => {
287287
constraints.push("~{ccr}".to_string());
288288
}
289-
InlineAsmArch::CSKY => {}
289+
InlineAsmArch::CSKY => {
290+
constraints.push("~{psr}".to_string());
291+
}
290292
}
291293
}
292294
if !options.contains(InlineAsmOptions::NOMEM) {

compiler/rustc_codegen_llvm/src/builder.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,8 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
543543
unsafe {
544544
let alloca = llvm::LLVMBuildAlloca(bx.llbuilder, ty, UNNAMED);
545545
llvm::LLVMSetAlignment(alloca, align.bytes() as c_uint);
546-
alloca
546+
// Cast to default addrspace if necessary
547+
llvm::LLVMBuildPointerCast(bx.llbuilder, alloca, self.cx().type_ptr(), UNNAMED)
547548
}
548549
}
549550

@@ -552,7 +553,8 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
552553
let alloca =
553554
llvm::LLVMBuildArrayAlloca(self.llbuilder, self.cx().type_i8(), size, UNNAMED);
554555
llvm::LLVMSetAlignment(alloca, align.bytes() as c_uint);
555-
alloca
556+
// Cast to default addrspace if necessary
557+
llvm::LLVMBuildPointerCast(self.llbuilder, alloca, self.cx().type_ptr(), UNNAMED)
556558
}
557559
}
558560

compiler/rustc_smir/src/rustc_smir/convert/abi.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ impl<'tcx> Stable<'tcx> for callconv::Conv {
105105
Conv::CCmseNonSecureCall => CallConvention::CCmseNonSecureCall,
106106
Conv::CCmseNonSecureEntry => CallConvention::CCmseNonSecureEntry,
107107
Conv::Msp430Intr => CallConvention::Msp430Intr,
108-
Conv::PtxKernel => CallConvention::PtxKernel,
109108
Conv::X86Fastcall => CallConvention::X86Fastcall,
110109
Conv::X86Intr => CallConvention::X86Intr,
111110
Conv::X86Stdcall => CallConvention::X86Stdcall,

compiler/rustc_target/src/callconv/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,6 @@ pub enum Conv {
542542

543543
Msp430Intr,
544544

545-
PtxKernel,
546-
547545
GpuKernel,
548546

549547
X86Fastcall,
@@ -689,7 +687,8 @@ impl<'a, Ty> FnAbi<'a, Ty> {
689687
"sparc" => sparc::compute_abi_info(cx, self),
690688
"sparc64" => sparc64::compute_abi_info(cx, self),
691689
"nvptx64" => {
692-
if cx.target_spec().adjust_abi(abi, self.c_variadic) == ExternAbi::PtxKernel {
690+
let abi = cx.target_spec().adjust_abi(abi, self.c_variadic);
691+
if abi == ExternAbi::PtxKernel || abi == ExternAbi::GpuKernel {
693692
nvptx64::compute_ptx_kernel_abi_info(cx, self)
694693
} else {
695694
nvptx64::compute_abi_info(self)
@@ -841,7 +840,6 @@ impl FromStr for Conv {
841840
"CCmseNonSecureCall" => Ok(Conv::CCmseNonSecureCall),
842841
"CCmseNonSecureEntry" => Ok(Conv::CCmseNonSecureEntry),
843842
"Msp430Intr" => Ok(Conv::Msp430Intr),
844-
"PtxKernel" => Ok(Conv::PtxKernel),
845843
"X86Fastcall" => Ok(Conv::X86Fastcall),
846844
"X86Intr" => Ok(Conv::X86Intr),
847845
"X86Stdcall" => Ok(Conv::X86Stdcall),

compiler/rustc_target/src/json.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ impl ToJson for crate::callconv::Conv {
105105
Self::CCmseNonSecureCall => "CCmseNonSecureCall",
106106
Self::CCmseNonSecureEntry => "CCmseNonSecureEntry",
107107
Self::Msp430Intr => "Msp430Intr",
108-
Self::PtxKernel => "PtxKernel",
109108
Self::X86Fastcall => "X86Fastcall",
110109
Self::X86Intr => "X86Intr",
111110
Self::X86Stdcall => "X86Stdcall",

compiler/rustc_ty_utils/src/abi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ fn conv_from_spec_abi(tcx: TyCtxt<'_>, abi: ExternAbi, c_variadic: bool) -> Conv
290290
Aapcs { .. } => Conv::ArmAapcs,
291291
CCmseNonSecureCall => Conv::CCmseNonSecureCall,
292292
CCmseNonSecureEntry => Conv::CCmseNonSecureEntry,
293-
PtxKernel => Conv::PtxKernel,
293+
PtxKernel => Conv::GpuKernel,
294294
Msp430Interrupt => Conv::Msp430Intr,
295295
X86Interrupt => Conv::X86Intr,
296296
GpuKernel => Conv::GpuKernel,

library/core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@
211211
#![feature(powerpc_target_feature)]
212212
#![feature(riscv_target_feature)]
213213
#![feature(rtm_target_feature)]
214+
#![feature(s390x_target_feature)]
214215
#![feature(sha512_sm_x86)]
215216
#![feature(sse4a_target_feature)]
216217
#![feature(tbm_target_feature)]

library/std/src/io/util.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,13 @@ impl Read for Repeat {
188188
Ok(buf.len())
189189
}
190190

191+
fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> {
192+
for slot in &mut *buf {
193+
*slot = self.byte;
194+
}
195+
Ok(())
196+
}
197+
191198
fn read_buf(&mut self, mut buf: BorrowedCursor<'_>) -> io::Result<()> {
192199
// SAFETY: No uninit bytes are being written
193200
for slot in unsafe { buf.as_mut() } {
@@ -204,6 +211,10 @@ impl Read for Repeat {
204211
Ok(())
205212
}
206213

214+
fn read_buf_exact(&mut self, buf: BorrowedCursor<'_>) -> io::Result<()> {
215+
self.read_buf(buf)
216+
}
217+
207218
/// This function is not supported by `io::Repeat`, because there's no end of its data
208219
fn read_to_end(&mut self, _: &mut Vec<u8>) -> io::Result<usize> {
209220
Err(io::Error::from(io::ErrorKind::OutOfMemory))

0 commit comments

Comments
 (0)