Commit graph

1056 commits

Author SHA1 Message Date
antoyo
d80802b042
Merge pull request #684 from FractalFir/master
Fix to 128 bit int unaligned loads
2025-05-27 18:16:07 -04:00
michal kostrubiec
1afdb55019 Fix to 128 bit int unaligned loads 2025-05-27 23:54:41 +02:00
Antoni Boucher
c430b87539 Fix typos 2025-05-21 18:06:19 -04:00
antoyo
3d962df0ae
Merge pull request #680 from FractalFir/master
Changes to constant handling - faster deduplication, more compact represtntation
2025-05-21 18:05:58 -04:00
michal kostrubiec
82160c49a3 Changes to constant handling - faster deduplication, more compact representation 2025-05-21 23:07:45 +02:00
Guillaume Gomez
f0648966e4 Add missing add_eval to generate __rdl_oom in the alloc error handler 2025-05-16 13:02:20 +02:00
Antoni Boucher
878a1732bc Fix for the fminimum intrinsics 2025-05-14 05:00:18 -04:00
Antoni Boucher
57011501d5 Fix for libgccjit 12 2025-05-12 11:22:13 -04:00
Antoni Boucher
47beac18f4 Merge branch 'master' into sync_from_rust_2025_05_12 2025-05-12 11:04:56 -04:00
antoyo
2d794d4758
Merge pull request #671 from GuillaumeGomez/regen-intrinsics-2
Regenerate intrinsics
2025-05-11 13:59:26 -04:00
antoyo
d8e2d24738
Merge pull request #666 from FractalFir/master
Fixed a recursive inling bug, added a test for it
2025-05-11 09:50:58 -04:00
León Orell Valerian Liehr
c7740d2f17 Rollup merge of #140792 - Urgau:minimum-maximum-intrinsics, r=scottmcm,traviscross,tgross35
Use intrinsics for `{f16,f32,f64,f128}::{minimum,maximum}` operations

This PR creates intrinsics for `{f16,f32,f64,f64}::{minimum,maximum}` operations.

This wasn't done when those operations were added as the LLVM support was too weak but now that LLVM has libcalls for unsupported platforms we can finally use them.

Cranelift and GCC[^1] support are partial, Cranelift doesn't support `f16` and `f128`, while GCC doesn't support `f16`.

r? `@tgross35`

try-job: aarch64-gnu
try-job: dist-various-1
try-job: dist-various-2

[^1]: https://www.gnu.org/software///gnulib/manual/html_node/Functions-in-_003cmath_002eh_003e.html
2025-05-11 02:44:36 +02:00
michal kostrubiec
f111416e43 Fixed a recursive inling bug, added a test for it 2025-05-10 22:24:16 +02:00
Guillaume Gomez
43b95881f0 Regenerate intrinsics 2025-05-10 18:02:54 +02:00
Matthias Krüger
db5831c76c Rollup merge of #140660 - RalfJung:more-order, r=WaffleLapkin
remove 'unordered' atomic intrinsics

As their doc comment already indicates, these operations do not currently have a place in our memory model. The intrinsics were introduced to support a hack in compiler-builtins, but that hack recently got removed (see https://github.com/rust-lang/compiler-builtins/issues/788).
2025-05-10 16:26:02 +02:00
michal kostrubiec
33966ccbb6 Add a workaround for 128 bit switches 2025-05-10 00:34:54 +02:00
Ralf Jung
7e5fa896a2 remove 'unordered' atomic intrinsics 2025-05-09 17:39:52 +02:00
Urgau
1ac228397d Use intrinsics for {f16,f32,f64,f128}::{minimum,maximum} operations 2025-05-09 17:11:23 +02:00
Guillaume Gomez
390fc73ae7 Fix new clippy lints 2025-05-07 17:32:31 +02:00
Guillaume Gomez
0bdf0726cf Mark back::lto::optimize_thin_module and back::write::codegen` functions as safe 2025-05-07 17:20:25 +02:00
Guillaume Gomez
dcfd5c30d4 Remove unneeded let_chains feature 2025-05-07 17:12:22 +02:00
Guillaume Gomez
3278cb5545 Migrate to 2024 edition 2025-05-07 16:34:32 +02:00
Antoni Boucher
e608520b12 Stop ignoring the feature -sse 2025-05-06 17:58:21 -04:00
Michael Goulet
fcb4ef584d Rename Instance::new to Instance::new_raw and add a note that it is raw 2025-05-05 13:17:35 +00:00
Bryanskiy
7008f351b6 Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
Antoni Boucher
6fad1bac72 Support more calling convention attributes 2025-04-30 13:51:52 -04:00
Matthias Krüger
283e2cf80b Rollup merge of #134232 - bjorn3:naked_asm_improvements, r=wesleywiser
Share the naked asm impl between cg_ssa and cg_clif

This was introduced in https://github.com/rust-lang/rust/pull/128004.
2025-04-30 17:27:57 +02:00
Trevor Gross
d62fe1e043 Implement the internal feature cfg_target_has_reliable_f16_f128
Support for `f16` and `f128` is varied across targets, backends, and
backend versions. Eventually we would like to reach a point where all
backends support these approximately equally, but until then we have to
work around some of these nuances of support being observable.

Introduce the `cfg_target_has_reliable_f16_f128` internal feature, which
provides the following new configuration gates:

* `cfg(target_has_reliable_f16)`
* `cfg(target_has_reliable_f16_math)`
* `cfg(target_has_reliable_f128)`
* `cfg(target_has_reliable_f128_math)`

`reliable_f16` and `reliable_f128` indicate that basic arithmetic for
the type works correctly. The `_math` versions indicate that anything
relying on `libm` works correctly, since sometimes this hits a separate
class of codegen bugs.

These options match configuration set by the build script at [1]. The
logic for LLVM support is duplicated as-is from the same script. There
are a few possible updates that will come as a follow up.

The config introduced here is not planned to ever become stable, it is
only intended to replace the build scripts for `std` tests and
`compiler-builtins` that don't have any way to configure based on the
codegen backend.

MCP: https://github.com/rust-lang/compiler-team/issues/866
Closes: https://github.com/rust-lang/compiler-team/issues/866

[1]: 555e1d0386/library/std/build.rs (L84-L186)
2025-04-27 19:58:44 +00:00
Antoni Boucher
61d1c13b3e Merge commit '4f83a4258d' into subtree-update_cg_gcc_2025-04-25 2025-04-25 10:44:19 -04:00
Antoni Boucher
5e5ad10bc6 Fix clippy warnings 2025-04-25 10:10:50 -04:00
Antoni Boucher
5dbe271045 Merge branch 'master' into sync_from_rust_2025_04_25_2 2025-04-25 10:05:03 -04:00
Chris Denton
ccbcbee5e7 Rollup merge of #137953 - RalfJung:simd-intrinsic-masks, r=WaffleLapkin
simd intrinsics with mask: accept unsigned integer masks, and fix some of the errors

It's not clear at all why the mask would have to be signed, it is anyway interpreted bitwise. The backend should just make sure that works no matter the surface-level type; our LLVM backend already does this correctly. The note of "the mask may be widened, which only has the correct behavior for signed integers" explains... nothing? Why can't the code do the widening correctly? If necessary, just cast to the signed type first...

Also while we are at it, fix the errors. For simd_masked_load/store, the errors talked about the "third argument" but they meant the first argument (the mask is the first argument there). They also used the wrong type for `expected_element`.

I have extremely low confidence in the GCC part of this PR.

See [discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/257879-project-portable-simd/topic/On.20the.20sign.20of.20masks)
2025-04-20 13:02:48 +00:00
Ralf Jung
fc4afeafc1 simd intrinsics with mask: accept unsigned integer masks 2025-04-20 12:25:27 +02:00
Guillaume Gomez
e32e494097 Fix import 2025-04-19 00:08:03 +02:00
Guillaume Gomez
acdd3b729f Fix compilation error in GCC backend 2025-04-18 22:46:43 +02:00
Guillaume Gomez
8f9a32aaf8 Merge commit 'db1a31c243' into subtree-update_cg_gcc_2025-04-18 2025-04-18 21:20:11 +02:00
Antoni Boucher
52b06872fe Simplify handling of some SIMD intrinsics 2025-04-18 12:07:10 -04:00
Antoni Boucher
98dd5a30b3 Fix for libgccjit 12 2025-04-18 11:45:30 -04:00
Antoni Boucher
65b87aae21 Support new target builtins 2025-04-18 11:21:32 -04:00
Antoni Boucher
4b5940ad77 Fix overflow operations 2025-04-17 08:50:06 -04:00
Antoni Boucher
0d773175cc Add support for simd_insert_dyn and simd_extract_dyn 2025-04-17 08:50:02 -04:00
Antoni Boucher
6504f4c09c Format 2025-04-17 08:49:52 -04:00
Antoni Boucher
bc0bc8d5e1 Fix int_to_float_cast for f128 2025-04-17 08:49:49 -04:00
Antoni Boucher
5cf2bbc4e2 Fix clippy warnings 2025-04-17 08:49:37 -04:00
Antoni Boucher
e1fa74b4a9 Implement copysignf128 2025-04-17 08:49:24 -04:00
Antoni Boucher
5c832e5ece Remove most of builtins hack since it's not necessary anymore 2025-04-17 08:49:21 -04:00
Antoni Boucher
be75a58538 Fix compilation 2025-04-17 08:49:15 -04:00
Antoni Boucher
90c6c9f6a9 Merge branch 'master' into sync_from_rust_2025_04_17 2025-04-17 08:34:28 -04:00
bjorn3
25df5d021d Pass &mut self to codegen_global_asm 2025-04-14 09:38:04 +00:00
bjorn3
8582bc4e37 Pass MonoItemData to MonoItem::define 2025-04-14 09:38:03 +00:00