Commit graph

4901 commits

Author SHA1 Message Date
beetrees
87c425b9e1
Add basic support for f16/f128 values 2025-05-24 13:45:19 +01:00
beetrees
f0fb19ccc8
Add missing float libcalls to compiler_builtins.rs 2025-05-24 13:45:12 +01:00
beetrees
dcd3168c97
Use correct sign extension on __powi*f2 arguments 2025-05-23 15:51:51 +01:00
beetrees
3ab6af049b
Use Cranelift bitcast instead of store & load to bitcast between vectors and non-vectors (#1580) 2025-05-21 15:59:52 +02:00
stefnotch
8e3d0b2b03
Update availability of Cranelift (#1579)
- include source
2025-05-20 17:17:36 +02:00
bjorn3
4c39287e34 Update to Cranelift 0.120 2025-05-20 12:59:03 +00:00
bjorn3
81af658cb3 Make clif ir debug output a bit nicer 2025-05-20 12:16:04 +00:00
bjorn3
04c7e5a7e3 Rustup to rustc 1.89.0-nightly (60dabef95 2025-05-19) 2025-05-20 09:43:45 +00:00
bjorn3
0e43247bc9 Fix rustc testsuite 2025-05-18 16:29:38 +00:00
bjorn3
bc02a99f8f Rustup to rustc 1.89.0-nightly (777d37277 2025-05-17) 2025-05-18 14:30:42 +00:00
bjorn3
7b670d243f Sync from rust 777d372772 2025-05-18 14:21:04 +00:00
Urgau
e6d288ba17 Use intrinsics for {f16,f32,f64,f128}::{minimum,maximum} operations 2025-05-09 17:11:23 +02:00
bjorn3
2f8f464390 Fix mini_core on Windows and macOS 2025-05-07 14:08:11 +00:00
bjorn3
9196eb3dd1 Fix mini_core for panic=unwind 2025-05-07 13:05:47 +00:00
bjorn3
fe059c1c54 Clif ir comment improvements 2025-05-07 12:25:01 +00:00
bjorn3
dfe76361d1 Rustup to rustc 1.88.0-nightly (13e879094 2025-05-04) 2025-05-05 13:53:58 +00:00
Michael Goulet
5930cd904e Rename Instance::new to Instance::new_raw and add a note that it is raw 2025-05-05 13:17:35 +00:00
bjorn3
a308984e69 Rustup to rustc 1.88.0-nightly (b45dd71d1 2025-04-30) 2025-05-01 09:26:49 +00:00
bjorn3
e864f0f244 Sync from rust b45dd71d18 2025-05-01 09:18:16 +00:00
Matthias Krüger
23f12ff125 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
bjorn3
66d2f6bb05 Fix rustc test suite 2025-04-30 14:48:45 +00:00
bjorn3
e17184bf9f Rustup to rustc 1.88.0-nightly (74509131e 2025-04-29) 2025-04-30 13:21:43 +00:00
bjorn3
88c48cd308 Sync from rust 74509131e8 2025-04-30 13:12:22 +00:00
bjorn3
bfabf71781 Fix naked asm symbol name for cg_clif on macOS 2025-04-30 12:59:50 +00:00
bjorn3
7a8d368ac9 Fix std_example.rs on s390x 2025-04-29 08:37:31 +00:00
Chris Denton
6412cfbacb Rollup merge of #140323 - tgross35:cfg-unstable-float, r=Urgau
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)

---

The second commit makes use of this config to replace `cfg_{f16,f128}{,_math}` in `library/`. I omitted providing a `cfg(bootstrap)` configuration to keep things simpler since the next beta branch is in two weeks.

try-job: aarch64-gnu
try-job: i686-msvc-1
try-job: test-various
try-job: x86_64-gnu
try-job: x86_64-msvc-ext2
2025-04-28 23:29:17 +00:00
bjorn3
17403cd406 Fix rustc test suite 2025-04-28 15:25:25 +00:00
bjorn3
fcf198b539 Rustup to rustc 1.88.0-nightly (cb31a009e 2025-04-27) 2025-04-28 15:25:21 +00:00
bjorn3
41dbfa749f Sync from rust cb31a009e3 2025-04-28 15:25:08 +00:00
Andrew Zhogin
c179f96fa9 AsyncDrop implementation using shim codegen of async_drop_in_place::{closure}, scoped async drop added. 2025-04-28 16:23:13 +07:00
Trevor Gross
daaae11f4d 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
Urgau
6e2490ca9f
Merge pull request #1576 from Urgau/triagebot-issue-links-no-mentions
Enable `[no-mentions]` and `[issue-links]` in `rustbot`
2025-04-27 20:14:46 +02:00
bjorn3
f55c2c0d89
Merge pull request #1575 from rust-lang/exception-handling-preparation
Preparations for exception handling support
2025-04-24 17:02:03 +02:00
bjorn3
b59f697ee9 Relocation improvements for .eh_frame
This is necessary to handle LSDA references in the future once unwinding
is supported.
2025-04-24 13:16:21 +00:00
bjorn3
349430c08e Avoid creating a second UnwindContext in finalize_definitions
Once UnwindContext sets the personality function it will need to define
a DW.ref.rust_eh_personality function which would cause a duplicate
definition if UnwindContext is called a second time.
2025-04-24 13:08:32 +00:00
bjorn3
eef57cb4e2 Pass Option<Span> to codegen_unwind_terminate
In preparation for unwinding support.
2025-04-24 13:02:28 +00:00
bendn
00417de6b8 Suggest {to,from}_ne_bytes for transmutations between arrays and integers, etc 2025-04-24 13:14:36 +07:00
bors
d9dac3cb38 Auto merge of #139309 - RalfJung:abi_unsupported_vector_types, r=fee1-dead,traviscross
make abi_unsupported_vector_types a hard error

Fixes https://github.com/rust-lang/rust/issues/116558 by completing the transition; see that issue for context. The lint was introduced with Rust 1.84 and this has been shown in cargo's future breakage reports since Rust 1.85, released 6 weeks ago, and so far we got 0 complaints by users. There's not even a backlink on the tracking issue. We did a [crater run](https://github.com/rust-lang/rust/pull/127731#issuecomment-2286736295) when the lint was originally added and found no breakage. So I don't think we need another crater run now, but I can do one if the team prefers that.

https://github.com/rust-lang/rust/issues/131800 is done, so for most current targets (in particular, all tier 1 and tier 2 targets) we have the information to implement this check (modulo the targets where we don't properly support SIMD vectors yet, see the sub-issues of https://github.com/rust-lang/rust/issues/116558). If a new target gets added in the future, it will default to reject all SIMD vector types until proper information is added, which is the default we want.

This will need approval by for `@rust-lang/lang.` Cc `@workingjubilee` `@veluca93`

try-job: test-various
try-job: armhf-gnu
try-job: dist-i586-gnu-i586-i686-musl
2025-04-24 00:44:40 +00:00
Folkert de Vries
0103c583fa
support -Zmin-function-alignment (#1572) 2025-04-21 22:19:19 +02:00
bjorn3
de372d3fff Update to Cranelift 0.119 2025-04-21 15:24:18 +00:00
bjorn3
91114bd289 Fix rustc test suite 2025-04-21 10:48:40 +00:00
bjorn3
4cfecfdfa6 Rustup to rustc 1.88.0-nightly (b8c54d635 2025-04-20) 2025-04-21 10:37:10 +00:00
bjorn3
934931b079 Sync from rust b8c54d6358 2025-04-21 10:21:28 +00:00
Ralf Jung
d50c76974f make abi_unsupported_vector_types a hard error 2025-04-20 11:34:56 +02:00
Folkert de Vries
88ddf9e203 stabilize naked_functions 2025-04-20 11:18:38 +02:00
Folkert de Vries
59c5ed0ba8 Make #[naked] an unsafe attribute 2025-04-19 00:03:35 +02:00
bjorn3
49bfa1aaf5 Fix simd_insert_dyn and simd_extract_dyn intrinsics with non-pointer sized indices 2025-04-18 10:30:44 +00:00
bjorn3
c8c87421a5 Nicer formatting for verifier errors during define_function 2025-04-18 09:02:00 +00:00
bjorn3
b3b1eddc5b Share part of the global_asm!() implementation between cg_ssa and cg_clif 2025-04-14 09:38:04 +00:00
bjorn3
c02e496ecc Use cg_ssa's version of codegen_naked_asm in cg_clif 2025-04-14 09:38:04 +00:00