Skip to content
Merged
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
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2026-04-29"
channel = "nightly-2026-05-06"
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
24 changes: 0 additions & 24 deletions src/archive.rs

This file was deleted.

6 changes: 4 additions & 2 deletions src/back/lto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ use std::path::{Path, PathBuf};
use gccjit::OutputKind;
use object::read::archive::ArchiveFile;
use rustc_codegen_ssa::back::lto::SerializedModule;
use rustc_codegen_ssa::back::rmeta_link;
use rustc_codegen_ssa::back::write::{CodegenContext, FatLtoInput, SharedEmitter};
use rustc_codegen_ssa::traits::*;
use rustc_codegen_ssa::{CompiledModule, ModuleCodegen, ModuleKind, looks_like_rust_object_file};
use rustc_codegen_ssa::{CompiledModule, ModuleCodegen, ModuleKind};
use rustc_data_structures::memmap::Mmap;
use rustc_data_structures::profiling::SelfProfilerRef;
use rustc_errors::{DiagCtxt, DiagCtxtHandle};
Expand Down Expand Up @@ -63,6 +64,7 @@ fn prepare_lto(each_linked_rlib_for_lto: &[PathBuf], dcx: DiagCtxtHandle<'_>) ->
let archive_data = unsafe {
Mmap::map(File::open(path).expect("couldn't open rlib")).expect("couldn't map rlib")
};
let metadata_link = rmeta_link::read_from_data(&archive_data, path).unwrap();
let archive = ArchiveFile::parse(&*archive_data).expect("wanted an rlib");
let obj_files = archive
.members()
Expand All @@ -71,7 +73,7 @@ fn prepare_lto(each_linked_rlib_for_lto: &[PathBuf], dcx: DiagCtxtHandle<'_>) ->
.ok()
.and_then(|c| std::str::from_utf8(c.name()).ok().map(|name| (name.trim(), c)))
})
.filter(|&(name, _)| looks_like_rust_object_file(name));
.filter(|&(name, _)| metadata_link.rust_object_files.iter().any(|f| f == name));
for (name, child) in obj_files {
info!("adding bitcode from {}", name);
let path = tmp_path.path().join(name);
Expand Down
61 changes: 4 additions & 57 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1659,6 +1659,10 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
unimplemented!();
}

fn get_funclet_cleanuppad(&self, _funclet: &Funclet) -> RValue<'gcc> {
unimplemented!();
}

// Atomic Operations
fn atomic_cmpxchg(
&mut self,
Expand Down Expand Up @@ -2315,67 +2319,10 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
self.vector_extremum(a, b, ExtremumOperation::Min)
}

#[cfg(feature = "master")]
pub fn vector_reduce_fmin(&mut self, src: RValue<'gcc>) -> RValue<'gcc> {
let vector_type = src.get_type().unqualified().dyncast_vector().expect("vector type");
let element_count = vector_type.get_num_units();
let mut acc = self
.context
.new_vector_access(self.location, src, self.context.new_rvalue_zero(self.int_type))
.to_rvalue();
for i in 1..element_count {
let elem = self
.context
.new_vector_access(
self.location,
src,
self.context.new_rvalue_from_int(self.int_type, i as _),
)
.to_rvalue();
let cmp = self.context.new_comparison(self.location, ComparisonOp::LessThan, acc, elem);
acc = self.select(cmp, acc, elem);
}
acc
}

#[cfg(not(feature = "master"))]
pub fn vector_reduce_fmin(&mut self, _src: RValue<'gcc>) -> RValue<'gcc> {
unimplemented!();
}

pub fn vector_maximum_number_nsz(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
self.vector_extremum(a, b, ExtremumOperation::Max)
}

#[cfg(feature = "master")]
pub fn vector_reduce_fmax(&mut self, src: RValue<'gcc>) -> RValue<'gcc> {
let vector_type = src.get_type().unqualified().dyncast_vector().expect("vector type");
let element_count = vector_type.get_num_units();
let mut acc = self
.context
.new_vector_access(self.location, src, self.context.new_rvalue_zero(self.int_type))
.to_rvalue();
for i in 1..element_count {
let elem = self
.context
.new_vector_access(
self.location,
src,
self.context.new_rvalue_from_int(self.int_type, i as _),
)
.to_rvalue();
let cmp =
self.context.new_comparison(self.location, ComparisonOp::GreaterThan, acc, elem);
acc = self.select(cmp, acc, elem);
}
acc
}

#[cfg(not(feature = "master"))]
pub fn vector_reduce_fmax(&mut self, _src: RValue<'gcc>) -> RValue<'gcc> {
unimplemented!();
}

pub fn vector_select(
&mut self,
cond: RValue<'gcc>,
Expand Down
2 changes: 1 addition & 1 deletion src/intrinsic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tc
&args.iter().map(|arg| arg.immediate()).collect::<Vec<_>>(),
)
}
// TODO(antoyo): We can probably remove these and use the fallback intrinsic implementation.
// FIXME(antoyo): We can probably remove these and use the fallback intrinsic implementation.
sym::minimumf32 | sym::minimumf64 | sym::maximumf32 | sym::maximumf64 => {
let (ty, func_name) = match name {
sym::minimumf32 => (self.cx.float_type, "fminimumf"),
Expand Down
9 changes: 4 additions & 5 deletions src/intrinsic/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
return_error!(InvalidMonomorphization::FloatingPointVector {
span,
name,
f_ty: *f,
f_ty: f.name_str().to_string(),
in_ty
});
}
Expand Down Expand Up @@ -1422,15 +1422,14 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
);

macro_rules! minmax_red {
($name:ident: $int_red:ident, $float_red:ident) => {
($name:ident: $int_red:ident) => {
if name == sym::$name {
require!(
ret_ty == in_elem,
InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty }
);
return match *in_elem.kind() {
ty::Int(_) | ty::Uint(_) => Ok(bx.$int_red(args[0].immediate())),
ty::Float(_) => Ok(bx.$float_red(args[0].immediate())),
_ => return_error!(InvalidMonomorphization::UnsupportedSymbol {
span,
name,
Expand All @@ -1444,8 +1443,8 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
};
}

minmax_red!(simd_reduce_min: vector_reduce_min, vector_reduce_fmin);
minmax_red!(simd_reduce_max: vector_reduce_max, vector_reduce_fmax);
minmax_red!(simd_reduce_min: vector_reduce_min);
minmax_red!(simd_reduce_max: vector_reduce_max);

macro_rules! bitwise_red {
($name:ident : $op:expr, $boolean:expr) => {
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,16 +409,16 @@ impl WriteBackendMethods for GccCodegenBackend {
}

fn optimize_and_codegen_fat_lto(
sess: &Session,
cgcx: &CodegenContext,
prof: &SelfProfilerRef,
shared_emitter: &SharedEmitter,
_tm_factory: TargetMachineFactoryFn<Self>,
// FIXME(bjorn3): Limit LTO exports to these symbols
_exported_symbols_for_lto: &[String],
each_linked_rlib_for_lto: &[PathBuf],
modules: Vec<FatLtoInput<Self>>,
) -> CompiledModule {
back::lto::run_fat(cgcx, prof, shared_emitter, each_linked_rlib_for_lto, modules)
back::lto::run_fat(cgcx, &sess.prof, shared_emitter, each_linked_rlib_for_lto, modules)
}

fn run_thin_lto(
Expand Down
1 change: 1 addition & 0 deletions tests/failing-run-make-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ tests/run-make/glibc-staticlib-args/
tests/run-make/lto-smoke-c/
tests/run-make/return-non-c-like-enum/
tests/run-make/short-ice
tests/run-make/embed-source-dwarf
4 changes: 2 additions & 2 deletions tests/lang_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn compile_and_run_cmds(
// Test command 2: run `tempdir/x`.
if test_target.is_some() {
let mut env_path = std::env::var("PATH").unwrap_or_default();
// TODO(antoyo): find a better way to add the PATH necessary locally.
// FIXME(antoyo): find a better way to add the PATH necessary locally.
env_path = format!("/opt/m68k-unknown-linux-gnu/bin:{}", env_path);
compiler.env("PATH", env_path);

Expand Down Expand Up @@ -112,7 +112,7 @@ fn build_test_runner(

println!("=== {test_kind} tests ===");

// TODO(antoyo): find a way to send this via a cli argument.
// FIXME(antoyo): find a way to send this via a cli argument.
let test_target = std::env::var("CG_GCC_TEST_TARGET").ok();
let test_target_filter = test_target.clone();

Expand Down
2 changes: 1 addition & 1 deletion tests/run/core-float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Run-time:
// status: 0

// TODO: remove these tests (extracted from libcore) when we run the libcore tests in the CI of the
// FIXME: remove these tests (extracted from libcore) when we run the libcore tests in the CI of the
// Rust repo.

#![feature(core_intrinsics)]
Expand Down
1 change: 1 addition & 0 deletions tools/cspell_dicts/rust.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
lateout
repr
rmeta
Loading