Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4c29d61
Remove -Zoom=panic
bjorn3 Oct 15, 2025
6693a56
Merge commit 'e24f0fa3c54951d1a5843b54ebe052faaa3a3cd2' into sync_cg_…
bjorn3 Dec 8, 2025
069016e
Merge branch 'sync_from_rust'
bjorn3 Dec 8, 2025
66381e3
Revert build_llvm_sysroot_for_triple back from reading the manifest t…
bjorn3 Dec 8, 2025
d38a5a6
Make `--print=backend-has-zstd` work by default on any backend
Zalathar Dec 8, 2025
77f1582
Rollup merge of #147725 - bjorn3:remove_oom_panic, r=Amanieu
matthiaskrgr Dec 10, 2025
51e8b6e
Rollup merge of #149764 - Zalathar:has-zstd, r=bjorn3
matthiaskrgr Dec 10, 2025
932c939
Remove uses of `cfg(any()/all())`
jamie-osec Dec 10, 2025
d55b61a
Adapt `cg_cranelift` to the overhauled filename handling
Urgau Dec 6, 2025
2298c01
Rollup merge of #149791 - clubby789:cfg-bool-lints, r=jdonszelmann
matthiaskrgr Dec 12, 2025
4d011ef
Remove `[no-mentions]` handler in the triagebot config
Urgau Dec 12, 2025
e3f9bce
Use `let...else` instead of `match foo { ... _ => return };` and `if …
estebank Dec 9, 2025
812320a
Merge pull request #1612 from Urgau/Urgau-patch-1
bjorn3 Dec 12, 2025
9561346
Auto merge of #149709 - Urgau:overhaul-filenames, r=davidtwco
bors Dec 13, 2025
6a821c5
simplify how inline asm handles `MaybeUninit`
WaffleLapkin Dec 13, 2025
4748c53
Add `llvm.x86.vcvtps2ph.128` (#1613)
opstic Dec 14, 2025
d57ccad
Rollup merge of #149950 - WaffleLapkin:inlines-ur-mu-into-asm, r=jdon…
Zalathar Dec 16, 2025
216d1a7
Sync from rust 21ff67df15329dd7548ccba54b6c6ae9a562124f
bjorn3 Dec 16, 2025
b9839eb
Rustup to rustc 1.94.0-nightly (21ff67df1 2025-12-15)
bjorn3 Dec 16, 2025
b73270f
Fix rustc test suite
bjorn3 Dec 16, 2025
49f1fa5
Unconditionally install rustfmt
bjorn3 Dec 16, 2025
bb9dac5
Disable linker plugin lto rustc test
bjorn3 Dec 16, 2025
3822cf1
Disable a bunch of rustc tests that fail with --panic-unwind-support
bjorn3 Dec 16, 2025
4dc8f3e
Sync from rust f794a08738958bbef01c3dcab34ec21d3da1e51a
bjorn3 Dec 18, 2025
6396521
Rustup to rustc 1.94.0-nightly (f794a0873 2025-12-17)
bjorn3 Dec 18, 2025
8de4afd
Fix rustc testsuite
bjorn3 Dec 18, 2025
c594c39
Merge commit '8de4afd39ba48f25be98684cdb7a96ec6da89d10' into sync_cg_…
bjorn3 Dec 18, 2025
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
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_cranelift/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Avoid installing rustc-dev
run: |
sed -i 's/components.*/components = ["rustfmt"]/' rust-toolchain
sed -i 's/components.*/components = ["rustfmt"]/' rust-toolchain.toml
rustfmt -v

- name: Rustfmt
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
uses: actions/cache@v4
with:
path: build/cg_clif
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-build-target-${{ hashFiles('rust-toolchain.toml', '**/Cargo.lock') }}

- name: Set MinGW as the default toolchain
if: matrix.os == 'windows-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
Expand Down Expand Up @@ -158,7 +158,7 @@ jobs:
uses: actions/cache@v4
with:
path: build/cg_clif
key: ${{ runner.os }}-x86_64-unknown-linux-gnu-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
key: ${{ runner.os }}-x86_64-unknown-linux-gnu-cargo-build-target-${{ hashFiles('rust-toolchain.toml', '**/Cargo.lock') }}

- name: Install hyperfine
run: |
Expand Down Expand Up @@ -207,7 +207,7 @@ jobs:
uses: actions/cache@v4
with:
path: build/cg_clif
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-dist-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-dist-cargo-build-target-${{ hashFiles('rust-toolchain.toml', '**/Cargo.lock') }}

- name: Set MinGW as the default toolchain
if: matrix.os == 'windows-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_cranelift/.github/workflows/rustc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: actions/cache@v4
with:
path: build/cg_clif
key: ${{ runner.os }}-rustc-test-cargo-build-target-${{ hashFiles('rust-toolchain', 'Cargo.lock') }}
key: ${{ runner.os }}-rustc-test-cargo-build-target-${{ hashFiles('rust-toolchain.toml', 'Cargo.lock') }}

- name: Test
run: ./scripts/test_bootstrap.sh
Expand All @@ -40,7 +40,7 @@ jobs:
uses: actions/cache@v4
with:
path: build/cg_clif
key: ${{ runner.os }}-rustc-test-cargo-build-target-${{ hashFiles('rust-toolchain', 'Cargo.lock') }}
key: ${{ runner.os }}-rustc-test-cargo-build-target-${{ hashFiles('rust-toolchain.toml', 'Cargo.lock') }}

- name: Install ripgrep
run: |
Expand Down
18 changes: 18 additions & 0 deletions compiler/rustc_codegen_cranelift/example/std_example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ unsafe fn test_simd() {
test_mm_cvttps_epi32();
test_mm_cvtsi128_si64();

#[cfg(not(jit))]
test_mm_cvtps_ph();

test_mm_extract_epi8();
test_mm_insert_epi16();
test_mm_shuffle_epi8();
Expand Down Expand Up @@ -558,6 +561,21 @@ unsafe fn test_mm_cvttps_epi32() {
}
}

#[cfg(target_arch = "x86_64")]
#[target_feature(enable = "f16c")]
#[cfg(not(jit))]
unsafe fn test_mm_cvtps_ph() {
const F16_ONE: i16 = 0x3c00;
const F16_TWO: i16 = 0x4000;
const F16_THREE: i16 = 0x4200;
const F16_FOUR: i16 = 0x4400;

let a = _mm_set_ps(1.0, 2.0, 3.0, 4.0);
let r = _mm_cvtps_ph::<_MM_FROUND_CUR_DIRECTION>(a);
let e = _mm_set_epi16(0, 0, 0, 0, F16_ONE, F16_TWO, F16_THREE, F16_FOUR);
assert_eq_m128i(r, e);
}

fn test_checked_mul() {
let u: Option<u8> = u8::from_str_radix("1000", 10).ok();
assert_eq!(u, None);
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_codegen_cranelift/rust-toolchain

This file was deleted.

4 changes: 4 additions & 0 deletions compiler/rustc_codegen_cranelift/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[toolchain]
channel = "nightly-2025-12-18"
components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt"]
profile = "minimal"
5 changes: 2 additions & 3 deletions compiler/rustc_codegen_cranelift/scripts/rustup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ case $1 in
"prepare")
echo "=> Installing new nightly"
rustup toolchain install --profile minimal "nightly-${TOOLCHAIN}" # Sanity check to see if the nightly exists
sed -i "s/\"nightly-.*\"/\"nightly-${TOOLCHAIN}\"/" rust-toolchain
rustup component add rustfmt || true
sed -i "s/\"nightly-.*\"/\"nightly-${TOOLCHAIN}\"/" rust-toolchain.toml

echo "=> Uninstalling all old nightlies"
for nightly in $(rustup toolchain list | grep nightly | grep -v "$TOOLCHAIN" | grep -v nightly-x86_64); do
Expand All @@ -35,7 +34,7 @@ case $1 in
./y.sh prepare
;;
"commit")
git add rust-toolchain
git add rust-toolchain.toml
git commit -m "Rustup to $(rustc -V)"
;;
"push")
Expand Down
29 changes: 24 additions & 5 deletions compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ git checkout -- tests/ui/entry-point/auxiliary/bad_main_functions.rs
rm tests/ui/asm/x86_64/evex512-implicit-feature.rs # unimplemented AVX512 x86 vendor intrinsic
rm tests/ui/simd/dont-invalid-bitcast-x86_64.rs # unimplemented llvm.x86.sse41.round.ps
rm tests/ui/simd/intrinsic/generic-arithmetic-pass.rs # unimplemented simd_funnel_{shl,shr}
rm -r tests/ui/scalable-vectors # scalable vectors are unsupported

# exotic linkages
rm tests/incremental/hashes/function_interfaces.rs
Expand All @@ -53,23 +54,29 @@ rm tests/ui/sanitizer/kcfi-c-variadic.rs # same
rm tests/ui/c-variadic/same-program-multiple-abis-x86_64.rs # variadics for calling conventions other than C unsupported
rm tests/ui/delegation/fn-header.rs

# inline assembly features
rm tests/ui/asm/x86_64/issue-96797.rs # const and sym inline asm operands don't work entirely correctly
rm tests/ui/asm/global-asm-mono-sym-fn.rs # same
rm tests/ui/asm/naked-asm-mono-sym-fn.rs # same
rm tests/ui/asm/x86_64/goto.rs # inline asm labels not supported
rm tests/ui/asm/label-operand.rs # same
rm tests/ui/asm/may_unwind.rs # asm unwinding not supported
rm tests/ui/asm/aarch64/may_unwind.rs # same

# misc unimplemented things
rm tests/ui/target-feature/missing-plusminus.rs # error not implemented
rm -r tests/run-make/repr128-dwarf # debuginfo test
rm -r tests/run-make/split-debuginfo # same
rm -r tests/run-make/target-specs # i686 not supported by Cranelift
rm -r tests/run-make/mismatching-target-triples # same
rm tests/ui/asm/x86_64/issue-96797.rs # const and sym inline asm operands don't work entirely correctly
rm tests/ui/asm/global-asm-mono-sym-fn.rs # same
rm tests/ui/asm/naked-asm-mono-sym-fn.rs # same
rm tests/ui/asm/x86_64/goto.rs # inline asm labels not supported
rm tests/ui/asm/label-operand.rs # same
rm tests/ui/simd/simd-bitmask-notpow2.rs # non-pow-of-2 simd vector sizes
rm -r tests/run-make/used-proc-macro # used(linker) isn't supported yet
rm tests/ui/linking/no-gc-encapsulation-symbols.rs # same
rm tests/ui/attributes/fn-align-dyn.rs # per-function alignment not supported
rm -r tests/ui/explicit-tail-calls # tail calls
rm -r tests/run-make/pointer-auth-link-with-c # pointer auth
rm -r tests/ui/eii # EII not yet implemented
rm -r tests/run-make/forced-unwind-terminate-pof # forced unwinding doesn't take precedence

# requires LTO
rm -r tests/run-make/cdylib
Expand All @@ -78,6 +85,7 @@ rm -r tests/run-make/lto-*
rm -r tests/run-make/reproducible-build-2
rm -r tests/run-make/no-builtins-lto
rm -r tests/run-make/reachable-extern-fn-available-lto
rm -r tests/run-make/no-builtins-linker-plugin-lto

# coverage instrumentation
rm tests/ui/consts/precise-drop-with-coverage.rs
Expand All @@ -87,6 +95,7 @@ rm -r tests/ui/instrument-coverage/
# ==================
rm tests/ui/codegen/issue-28950.rs # depends on stack size optimizations
rm tests/ui/codegen/init-large-type.rs # same
rm tests/ui/codegen/StackColoring-not-blowup-stack-issue-40883.rs # same
rm tests/ui/statics/const_generics.rs # tests an optimization
rm tests/ui/linking/executable-no-mangle-strip.rs # requires --gc-sections to work for statics

Expand Down Expand Up @@ -143,6 +152,15 @@ rm tests/ui/errors/remap-path-prefix-sysroot.rs # different sysroot source path
rm -r tests/run-make/export/extern-opt # something about rustc version mismatches
rm -r tests/run-make/export # same
rm -r tests/ui/compiletest-self-test/compile-flags-incremental.rs # needs compiletest compiled with panic=unwind
rm tests/ui/async-await/in-trait/dont-project-to-specializable-projection.rs # something going wrong with stdlib source remapping
rm tests/ui/consts/miri_unleashed/drop.rs # same
rm tests/ui/error-emitter/multiline-removal-suggestion.rs # same
rm tests/ui/lint/lint-const-item-mutation.rs # same
rm tests/ui/lint/use-redundant/use-redundant-issue-71450.rs # same
rm tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.rs # same
rm tests/ui/specialization/const_trait_impl.rs # same
rm tests/ui/thir-print/offset_of.rs # same
rm tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs # same

# genuine bugs
# ============
Expand All @@ -157,6 +175,7 @@ rm tests/ui/lint/non-snake-case/lint-non-snake-case-crate.rs # same
rm tests/ui/async-await/async-drop/async-drop-initial.rs # same (rust-lang/rust#140493)
rm -r tests/ui/codegen/equal-pointers-unequal # make incorrect assumptions about the location of stack variables
rm -r tests/run-make-cargo/rustdoc-scrape-examples-paths # FIXME(rust-lang/rust#145580) incr comp bug
rm -r tests/incremental/extern_static/issue-49153.rs # assumes reference to undefined static gets optimized away

rm tests/ui/intrinsics/panic-uninitialized-zeroed.rs # really slow with unoptimized libstd
rm tests/ui/process/process-panic-after-fork.rs # same
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/driver/jit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ fn dep_symbol_lookup_fn(
diag.emit();
}
Linkage::Dynamic => {
dylib_paths.push(src.dylib.as_ref().unwrap().0.clone());
dylib_paths.push(src.dylib.as_ref().unwrap().clone());
}
}
}
Expand Down
29 changes: 29 additions & 0 deletions compiler/rustc_codegen_cranelift/src/intrinsics/llvm_x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,35 @@ pub(super) fn codegen_x86_llvm_intrinsic_call<'tcx>(
ret.write_cvalue_transmute(fx, res);
}

"llvm.x86.vcvtps2ph.128" => {
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_cvtps_ph
intrinsic_args!(fx, args => (a, _imm8); intrinsic);
let a = a.load_scalar(fx);

let imm8 =
if let Some(imm8) = crate::constant::mir_operand_get_const_val(fx, &args[1].node) {
imm8
} else {
fx.tcx
.dcx()
.span_fatal(span, "Index argument for `_mm_cvtps_ph` is not a constant");
};

let imm8 = imm8.to_u32();

codegen_inline_asm_inner(
fx,
&[InlineAsmTemplatePiece::String(format!("vcvtps2ph xmm0, xmm0, {imm8}").into())],
&[CInlineAsmOperand::InOut {
reg: InlineAsmRegOrRegClass::Reg(InlineAsmReg::X86(X86InlineAsmReg::xmm0)),
_late: true,
in_value: a,
out_place: Some(ret),
}],
InlineAsmOptions::NOSTACK | InlineAsmOptions::PURE | InlineAsmOptions::NOMEM,
);
}

_ => {
fx.tcx
.dcx()
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_codegen_cranelift/triagebot.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@

# Prevents un-canonicalized issue links (to avoid wrong issues being linked in r-l/rust)
[issue-links]

# Prevents mentions in commits to avoid users being spammed
[no-mentions]
Loading