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
6 changes: 4 additions & 2 deletions .github/workflows/stdarch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,16 @@ jobs:
if: ${{ !matrix.cargo_runner }}
run: |
# FIXME: remove --skip test_tile_ and --skip --skip test__tile when it's implemented.
./y.sh test --release --stdarch-tests -- --skip test_tile_ --skip test__tile
# FIXME: remove --skip test_mm_srav_epi64 when it's fixed upstream.
./y.sh test --release --stdarch-tests -- --skip test_tile_ --skip test__tile --skip test_mm_srav_epi64

- name: Run stdarch tests
if: ${{ matrix.cargo_runner }}
run: |
# FIXME: these tests fail when the sysroot is compiled with LTO because of a missing symbol in proc-macro.
# FIXME: remove --skip test_tile_ and --skip --skip test__tile when it's implemented.
STDARCH_TEST_SKIP_FUNCTION="xsave,xsaveopt,xsave64,xsaveopt64" STDARCH_TEST_EVERYTHING=1 CHANNEL=release CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="${{ matrix.cargo_runner }}" TARGET=x86_64-unknown-linux-gnu CG_RUSTFLAGS="-Ainternal_features" ./y.sh cargo test --manifest-path build/build_sysroot/sysroot_src/library/stdarch/Cargo.toml -- --skip rtm --skip tbm --skip sse4a --skip test_tile_ --skip test__tile
# FIXME: remove --skip test_mm_srav_epi64 when it's fixed upstream.
STDARCH_TEST_SKIP_FUNCTION="xsave,xsaveopt,xsave64,xsaveopt64" STDARCH_TEST_EVERYTHING=1 CHANNEL=release CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="${{ matrix.cargo_runner }}" TARGET=x86_64-unknown-linux-gnu CG_RUSTFLAGS="-Ainternal_features" ./y.sh cargo test --manifest-path build/build_sysroot/sysroot_src/library/stdarch/Cargo.toml -- --skip rtm --skip tbm --skip sse4a --skip test_tile_ --skip test__tile --skip test_mm_srav_epi64

# Summary job for the merge queue.
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
Expand Down
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-09-18"
channel = "nightly-2026-09-22"
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
2 changes: 2 additions & 0 deletions src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ pub fn compile_codegen_unit(
// -fsyntax-only), forbid the compilation when get_target_info() is called on a
// context.
let f16_type_supported = target_info.supports_target_dependent_type(CType::Float16);
let f16b_type_supported = target_info.supports_target_dependent_type(CType::BFloat16);
let f32_type_supported = target_info.supports_target_dependent_type(CType::Float32);
let f64_type_supported = target_info.supports_target_dependent_type(CType::Float64);
let f128_type_supported = target_info.supports_target_dependent_type(CType::Float128);
Expand All @@ -173,6 +174,7 @@ pub fn compile_codegen_unit(
tcx,
u128_type_supported,
f16_type_supported,
f16b_type_supported,
f32_type_supported,
f64_type_supported,
f128_type_supported,
Expand Down
3 changes: 3 additions & 0 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ pub struct CodegenCx<'gcc, 'tcx> {

pub supports_128bit_integers: bool,
pub supports_f16_type: bool,
pub supports_f16b_type: bool,
pub supports_f32_type: bool,
pub supports_f64_type: bool,
pub supports_f128_type: bool,
Expand Down Expand Up @@ -162,6 +163,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
tcx: TyCtxt<'tcx>,
supports_128bit_integers: bool,
supports_f16_type: bool,
supports_f16b_type: bool,
supports_f32_type: bool,
supports_f64_type: bool,
supports_f128_type: bool,
Expand Down Expand Up @@ -293,6 +295,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {

supports_128bit_integers,
supports_f16_type,
supports_f16b_type,
supports_f32_type,
supports_f64_type,
supports_f128_type,
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,13 +491,15 @@ fn target_config(sess: &EarlySession, target_info: &SharedTargetInfo) -> TargetC
);

let has_reliable_f16 = target_info.supports_target_dependent_type(CType::Float16);
let has_reliable_f16b = target_info.supports_target_dependent_type(CType::BFloat16);
let has_reliable_f128 = target_info.supports_target_dependent_type(CType::Float128);

TargetConfig {
internal_target_features,
// There are no known bugs with GCC support for f16 or f128
has_reliable_f16,
has_reliable_f16_math: has_reliable_f16,
has_reliable_f16b,
has_reliable_f128,
has_reliable_f128_math: has_reliable_f128,
}
Expand Down
8 changes: 8 additions & 0 deletions src/type_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,14 @@ impl<'gcc, 'tcx> BaseTypeCodegenMethods for CodegenCx<'gcc, 'tcx> {
self.u16_type
}

fn type_f16b(&self) -> Type<'gcc> {
#[cfg(feature = "master")]
if self.supports_f16b_type {
return self.context.new_c_type(CType::BFloat16);
}
bug!("unsupported type bfloat16")
}

fn type_f32(&self) -> Type<'gcc> {
#[cfg(feature = "master")]
if self.supports_f32_type {
Expand Down
Loading