Commit graph

2324 commits

Author SHA1 Message Date
antoyo
774c8a2912
Merge pull request #840 from GuillaumeGomez/sqrt-f32-intrinsic
Add missing intrinsic translation for `llvm.sqrt.f32`
2026-01-25 21:19:19 -05:00
Guillaume Gomez
d3df4bdba5 Add regression test for <https://github.com/rust-lang/rustc_codegen_gcc/issues/288> 2026-01-25 21:09:22 +01:00
Guillaume Gomez
81acbae770 Add missing intrinsic translation for llvm.sqrt.f32 2026-01-25 21:02:34 +01:00
antoyo
bcb24ceaba
Merge pull request #834 from rust-lang/fix/unreachable-segfault
Fix segfault related to __builtin_unreachable with inline asm
2026-01-24 13:26:20 -05:00
Antoni Boucher
58156c5cab Fix segfault related to __builtin_unreachable with inline asm 2026-01-24 12:30:39 -05:00
Guillaume Gomez
9b2d8e5c91
Merge pull request #824 from GuillaumeGomez/regen-intrinsics
Regenerate intrinsics
2026-01-16 22:32:07 +01:00
Guillaume Gomez
2177aa9ac7 Manually include intrinsic conversion that is not present in LLVM files 2026-01-16 18:55:09 +01:00
Guillaume Gomez
4f59819c26 Regenerate intrinsics 2026-01-16 17:46:34 +01:00
Guillaume Gomez
40973efd1c
Merge pull request #823 from GuillaumeGomez/simplify-intrinsics-generation
Simplify intrinsics generation
2026-01-16 17:45:40 +01:00
Guillaume Gomez
c848b28a5d Ignore src/intrinsic/old_archs.rs for typo checks 2026-01-16 17:14:09 +01:00
Guillaume Gomez
3dc60d0bf1 Simplify intrinsics translation generation script 2026-01-16 16:52:09 +01:00
Guillaume Gomez
3e789ed576 Stop cloning old llvmint repositories to generate intrinsics 2026-01-16 16:52:09 +01:00
antoyo
02f889aec5
Merge pull request #820 from rust-lang/sync_from_rust_2025_12_20
Sync from rust 2025/12/20
2025-12-20 18:08:23 -05:00
Antoni Boucher
1ac26a7b1c Add new failing tests 2025-12-20 17:31:53 -05:00
Antoni Boucher
93cf63b789 Move libgccjit.so to the new location within the sysroot 2025-12-20 17:08:08 -05:00
Antoni Boucher
cd8cc6ff38 Update to nightly-2025-12-20 2025-12-20 16:43:54 -05:00
Antoni Boucher
cf522c098c Merge branch 'master' into sync_from_rust_2025_12_20 2025-12-20 16:43:21 -05:00
David Wood
11bc2e0907 codegen: implement repr(scalable)
Introduces `BackendRepr::ScalableVector` corresponding to scalable
vector types annotated with `repr(scalable)` which lowers to a scalable
vector type in LLVM.

Co-authored-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
2025-12-16 11:00:12 +00:00
Antoni Boucher
f0418b3461 When we cannot load libgccjit.so, show the paths that were tried 2025-12-15 08:35:17 -05:00
bors
09c34cbac3 Auto merge of #149709 - Urgau:overhaul-filenames, r=davidtwco
Overhaul filename handling for cross-compiler consistency

This PR overhauls the way we handle filenames in the compiler and `rmeta` in order to achieve achieve cross-compiler consistency (ie. having the same path no matter if the filename was created in the current compiler session or is coming from `rmeta`).

This is required as some parts of the compiler rely on consistent paths for the soundness of generated code (see rust-lang/rust#148328).

In order to achieved consistency multiple steps are being taken by this PR:
 - by making `RealFileName` immutable
 - by only having `SourceMap::to_real_filename` create `RealFileName`
   - currently `RealFileName` can be created from any `Path` and are remapped afterwards, which creates consistency issue
 - by also making `RealFileName` holds it's working directory, embeddable name and the remapped scopes
   - this removes the need for a `Session`, to know the current(!) scopes and cwd, which is invalid as they may not be equal to the scopes used when creating the filename

In order for `SourceMap::to_real_filename` to know which scopes to apply `FilePathMapping` now takes the current remapping scopes to apply, which makes `FileNameDisplayPreference` and company useless and are removed.

This PR is split-up in multiple commits (unfortunately not atomic), but should help review the changes.

Unblocks https://github.com/rust-lang/rust/pull/147611
Fixes https://github.com/rust-lang/rust/issues/148328
2025-12-13 14:32:09 +00:00
Jacob Pratt
2afb92fe61 Rollup merge of #148837 - estebank:let-else, r=Kivooeo
Use `let...else` instead of `match foo { ... _ => return };` and `if let ... else return`
2025-12-13 00:55:55 -05:00
Jacob Pratt
8ff1c63605 Rollup merge of #145278 - notJoon:doc/rotate-operation, r=antoyo
Update `rustc_codegen_gcc` rotate operation document

## Description

This PR resolves a TODO comment in the `rustc_codegen_gcc` backend by documenting that the rotate operations (`rotate_left` and `rotate_right`) already implement the optimized branchless algorithm from comment.

The existing implementation already uses the optimal branchless rotation pattern:
- For left rotation: `(x << n) | (x >> (-n & (width-1)))`
- For right rotation: `(x >> n) | (x << (-n & (width-1)))`

This pattern avoids branches and generates efficient machine code across different platforms, which was the goal mentioned in the original TODO.

## Changes

- Removed the TODO comment that suggested implementing the algorithm from https://blog.regehr.org/archives/1063
2025-12-13 00:55:54 -05:00
Esteban Küber
824f41ea6f Use let...else instead of match foo { ... _ => return }; and if let ... else return 2025-12-12 17:52:39 +00:00
Urgau
a95aaca249 Adapt and fix cg_gcc to the overhauled filename remapping 2025-12-12 07:34:52 +01:00
Matthias Krüger
bc06068785 Rollup merge of #149458 - GuillaumeGomez:clippy-cg_gcc, r=kobzol
Run clippy on cg_gcc in CI

This is to prevent [this issue](https://github.com/rust-lang/rust/pull/149449#discussion_r2573045524): in cg_gcc repository, we run clippy on our code but not in here, which can create issues.

cc ````@antoyo````
r? ````@Kobzol````
2025-12-10 07:54:19 +01:00
Matthias Krüger
c53b4c3fe2 Rollup merge of #147725 - bjorn3:remove_oom_panic, r=Amanieu
Remove -Zoom=panic

There are major questions remaining about the reentrancy that this allows. It doesn't have any users on github outside of a single project that uses it in a panic=abort project to show backtraces. It can still be emulated through `#[alloc_error_handler]` or `set_alloc_error_hook` depending on if you use the standard library or not. And finally it makes it harder to do various improvements to the allocator shim.

With this PR the sole remaining symbol in the allocator shim that is not effectively emulating weak symbols is the symbol that prevents skipping the allocator shim on stable even when it would otherwise be empty because libstd + `#[global_allocator]` is used.

Closes https://github.com/rust-lang/rust/issues/43596
Fixes https://github.com/rust-lang/rust/issues/126683
2025-12-10 07:54:17 +01:00
Guillaume Gomez
e6143962f9 Fix clippy lint in cg_gcc 2025-12-09 16:26:10 +01:00
antoyo
059950eaa8
Merge pull request #815 from Urgau/triagebot-remove-no-mentions
Remove `[no-mentions]` handler in our triagebot config
2025-12-08 13:47:22 -05:00
Urgau
1314419ccd Remove [no-mentions] handler in our triagebot config
https://github.blog/changelog/2025-11-07-removing-notifications-for-mentions-in-commit-messages/
2025-12-08 19:23:10 +01:00
Antoni Boucher
ff29461e1a Remove libgccjit_path function 2025-12-05 09:58:37 -05:00
Antoni Boucher
b00418c0f5 Fix lib path 2025-12-05 09:55:02 -05:00
Antoni Boucher
8e77eeb017 Move to rustlib directory 2025-12-05 09:52:02 -05:00
Antoni Boucher
c0d4f5fab1 Move the libgccjit.so file in a target directory
Since GCC is not multi-target, we need multiple libgccjit.so.
Our solution to have a directory per target so that we can have multiple
libgccjit.so.
2025-12-05 09:51:26 -05:00
bors
8d9b1d0292 Auto merge of #149642 - GuillaumeGomez:subtree-update_cg_gcc_2025-12-04, r=GuillaumeGomez
cg_gcc subtree update

cc `@antoyo`

r? ghost
2025-12-04 17:48:32 +00:00
antoyo
180ce53ffe
Merge pull request #814 from GuillaumeGomez/update-intrinsics
Regenerate intrinsics
2025-12-04 12:18:18 -05:00
Guillaume Gomez
897099e693 Regenerate intrinsics 2025-12-04 17:53:01 +01:00
Guillaume Gomez
701b9ba0fb Merge commit 'dab6863ce8' into subtree-update_cg_gcc_2025-12-04 2025-12-04 14:53:08 +01:00
Paul Murphy
5c467cb4d1 Allow PowerPC spe_acc as clobber-only register
This register is only supported on the *powerpc*spe targets. It is
only recognized by LLVM. gcc does not accept this as a clobber, nor
does it support these targets.

This is a volatile register, thus it is included with clobber_abi.
2025-12-03 12:37:22 -06:00
antoyo
dab6863ce8
Merge pull request #812 from rust-lang/update/gccjit_sys
Update gccjit_sys
2025-12-02 13:33:37 -05:00
Antoni Boucher
ed64abc14d Update gccjit_sys 2025-12-02 11:39:15 -05:00
antoyo
df9894b877
Merge pull request #811 from rust-lang/fix/use-fallback-sysroot
Use fallback sysroot directory if we cannot find libgccjit.so in the explicit directory
2025-11-30 15:08:53 -05:00
Antoni Boucher
2da3314f39 Use fallback sysroot directory if we cannot find libgccjit.so in the explicit directory 2025-11-30 14:36:18 -05:00
AudaciousAxiom
1c89fe9d6d Remove an unnecessary unwrap in rustc_codegen_gcc 2025-11-29 10:34:07 +01:00
Harin
b87bfdc9fc
Better document some combinations of flags (#808)
---------

Co-authored-by: FrancescoV1985 <franci.vi@tiscali.it>
Co-authored-by: FrancescoV1985 <62872737+FrancescoV1985@users.noreply.github.com>
Co-authored-by: antoyo <antoyo@users.noreply.github.com>
2025-11-28 14:58:07 -05:00
bjorn3
4054d07d38 Remove -Zoom=panic
There are major questions remaining about the reentrancy that this
allows. It doesn't have any users on github outside of a single project
that uses it in a panic=abort project to show backtraces. It
can still be emulated through #[alloc_error_handler] or
set_alloc_error_hook depending on if you use the standard library or
not. And finally it makes it harder to do various improvements to the
allocator shim.
2025-11-28 19:30:39 +00:00
antoyo
c3c8a9a85f
Merge pull request #635 from dvermd/fix_128b_leading_zeros_ub
fix 128bits ctlz intrinsincs UB
2025-11-28 10:11:51 -05:00
antoyo
55bd9bf692
Merge pull request #810 from rust-lang/generic-checked-binop
Use generic builtin for saturating add/sub
2025-11-28 00:02:18 -05:00
bors
d923fdd90b Auto merge of #149348 - GuillaumeGomez:subtree-update_cg_gcc_2025-11-26, r=GuillaumeGomez
cg_gcc subtree sync

cc `@antoyo`
2025-11-28 01:53:22 +00:00
Antoni Boucher
c1f50c0a17 Use generic builtin for saturating add/sub 2025-11-27 17:02:13 -05:00
antoyo
05af078498
Merge pull request #809 from rust-lang/generic-checked-binop
Use generic builtin for checked binary operation
2025-11-27 16:50:39 -05:00