1474 Commits

Author SHA1 Message Date
bjorn3
aee30c5ddc Implement _mm_abs_epi* 2023-06-23 10:37:57 +00:00
bjorn3
92a4093850 Implement _mm_storeu_pd 2023-06-23 10:31:52 +00:00
bjorn3
d957015234 Implement _mm_slli_epi64 2023-06-23 10:28:27 +00:00
bjorn3
cb0a9b9550 Implement _addcarryx_{u32,u64} 2023-06-23 10:23:20 +00:00
bjorn3
8cad29a529 Implement _xgetbv 2023-06-23 10:05:18 +00:00
bjorn3
aef31cb2f3 Implement _mm_srli_epi64 2023-06-23 09:35:39 +00:00
bjorn3
bbf45081b7 Implement _mm_srai_epi* and _mm256_srai_epi* 2023-06-23 09:32:52 +00:00
bjorn3
71cb045c7d Fix _mm_cmp*_ps 2023-06-23 09:27:15 +00:00
bjorn3
7cbc8bcb4b Implement nontemporal_store using a regular store 2023-06-23 09:19:11 +00:00
bjorn3
41af17a9d1 Implement more _mm_cmp*_{ps,pd} intrinsics 2023-06-23 09:18:56 +00:00
bjorn3
0311202fd4 Implement _addcarry_u32 and _subborrow_u32 2023-06-23 09:17:02 +00:00
bjorn3
ee1793432d Sync from rust 065a1f5df9c2f1d93269e4d25a2acabbddb0db8d 2023-06-22 18:40:02 +00:00
bjorn3
c8620a3cbf Nicer error when implementation limits are exceeded
Fixes #1370
2023-06-20 15:48:00 +00:00
bjorn3
aebbeceb88 Handle rust-call abi without self argument
Fixes #1236
2023-06-20 10:05:23 +00:00
Michael Goulet
7ba31b9938 Rollup merge of #112232 - fee1-dead-contrib:match-eq-const-msg, r=b-naber
Better error for non const `PartialEq` call generated by `match`

Resolves #90237
2023-06-19 17:53:33 -07:00
bjorn3
daf79b5685 Avoid the stack in a couple more cases in write_cvalue_maybe_transmute 2023-06-19 20:56:21 +00:00
bjorn3
ab836ca5e3 Fix transmuting fat pointers to integers
Fixes #1325
2023-06-19 20:55:55 +00:00
bjorn3
ece98a4b41 Simplify CPlaceInner::Addr branch of write_cvalue_maybe_transmute 2023-06-19 20:26:07 +00:00
bjorn3
d169ee3457 Recurse into function signatures in assert_assignable
Fixes #1311
2023-06-19 19:30:44 +00:00
Scott McMurray
0c3e15283f Remove unchecked_add/sub/mul/shl/shr from CTFE/cg_ssa/cg_clif 2023-06-19 01:47:03 -07:00
Scott McMurray
9efe5e746a Promote unchecked_add/sub/mul/shl/shr to mir::BinOp 2023-06-19 01:47:03 -07:00
Deadbeef
c96f17c51f Better error for non const PartialEq call generated by match 2023-06-18 05:24:38 +00:00
bjorn3
81ea0b29ea Merge commit '8830dccd1d4c74f1f69b0d3bd982a3f1fcde5807' into sync_cg_clif-2023-06-15 2023-06-15 17:56:01 +00:00
bjorn3
e9bd63af3c Ignore -Clink-arg=-import-instr-limit 2023-06-15 17:14:49 +00:00
bjorn3
c870c67bb2 Sync from rust df77afbcaf3365a32066a8ca4a00ae6fc9a69647 2023-06-13 10:40:16 +00:00
bjorn3
d4d8f1c1ff Sync from rust e6d4725c76f3b526c74454bc51afdf6daf133506 2023-06-06 14:00:40 +00:00
bjorn3
c09ef96878 Implement _mm_shuffle_epi8 2023-06-06 09:34:21 +00:00
bjorn3
e4d0811360 Implement _mm_srli_epi16 and _mm_slli_epi16 2023-06-06 09:34:21 +00:00
bjorn3
f36bb6d529 Make unimplemented trap messages show up in more contexts 2023-06-06 09:34:21 +00:00
bjorn3
76900705e8 Implement all vendor intrinsics used by regex on AVX2 systems
This allows it to work with --sysroot llvm
2023-06-05 15:33:54 +00:00
Andrew Xie
f8cde5884d Updated cranelift codegen to reflect modified trait signature 2023-06-04 21:54:38 -04:00
Michael Goulet
4ecd45a588 Rollup merge of #112168 - scottmcm:lower-div-rem-unchecked-to-mir, r=oli-obk
Lower `unchecked_div`/`_rem` to MIR's `BinOp::Div`/`Rem`

As described in <https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.BinOp.html#variant.Div>, the ordinary `BinOp`s for these are already UB for division by zero ([or overflow](https://llvm.org/docs/LangRef.html#sdiv-instruction), [demo](https://rust.godbolt.org/z/71e7P7Exh)), as MIR building is responsible for inserting code to panic for those cases regardless of whether the overflow checks are enabled.

So we can lower these in the same arm that lowers `wrapping_add` to MIR `BinOp::Add` and such, as all these cases turn into ordinary `Rvalue::BinaryOp`s.
2023-06-02 16:02:06 -07:00
bjorn3
b1961baf43 Sync from rust d59363ad0b6391b7fc5bbb02c9ccf9300eef3753 2023-06-02 12:44:25 +00:00
Deadbeef
fcd93accb4 Use translatable diagnostics in rustc_const_eval 2023-06-01 14:45:18 +00:00
Scott McMurray
919da2f16c remove unchecked_div/_rem from cg_cranelift 2023-06-01 00:05:55 -07:00
lcnr
b488625178 EarlyBinder::new -> EarlyBinder::bind 2023-05-29 13:46:10 +02:00
Kyle Matsuda
4e87728772 Replace EarlyBinder(x) with EarlyBinder::new(x) 2023-05-28 10:44:50 -06:00
bjorn3
ba0ab0a830 Sync from rust cca7ee58110726983951a19d5fb7316d9243925d 2023-05-28 09:49:57 +00:00
Guillaume Gomez
be82095e1c Rollup merge of #111952 - cjgillot:drop-replace, r=WaffleLapkin
Remove DesugaringKind::Replace.

A simple boolean flag is enough.
2023-05-27 13:38:31 +02:00
bjorn3
35acd910bb Sync from rust a2b1646c597329d0a25efa3889b66650f65de1de 2023-05-26 08:22:10 +00:00
Michael Goulet
2f250c73ba Rollup merge of #111950 - cjgillot:expn-noinline, r=oli-obk
Remove ExpnKind::Inlined.

Suggested in https://github.com/rust-lang/rust/pull/111815#issuecomment-1561903339

r? ``@oli-obk``
2023-05-25 13:58:02 -07:00
Camille GILLOT
03f275bc5a Remove DesugaringKind::Replace. 2023-05-25 17:40:46 +00:00
bors
e6d1a0ed95 Auto merge of #86844 - bjorn3:global_alloc_improvements, r=pnkfelix
Support #[global_allocator] without the allocator shim

This makes it possible to use liballoc/libstd in combination with `--emit obj` if you use `#[global_allocator]`. This is what rust-for-linux uses right now and systemd may use in the future. Currently they have to depend on the exact implementation of the allocator shim to create one themself as `--emit obj` doesn't create an allocator shim.

Note that currently the allocator shim also defines the oom error handler, which is normally required too. Once `#![feature(default_alloc_error_handler)]` becomes the only option, this can be avoided. In addition when using only fallible allocator methods and either `--cfg no_global_oom_handling` for liballoc (like rust-for-linux) or `--gc-sections` no references to the oom error handler will exist.

To avoid this feature being insta-stable, you will have to define `__rust_no_alloc_shim_is_unstable` to avoid linker errors.

(Labeling this with both T-compiler and T-lang as it originally involved both an implementation detail and had an insta-stable user facing change. As noted above, the `__rust_no_alloc_shim_is_unstable` symbol requirement should prevent unintended dependence on this unstable feature.)
2023-05-25 16:59:57 +00:00
Camille GILLOT
f9dabd8b88 Remove ExpnKind::Inlined. 2023-05-25 16:43:14 +00:00
Maybe Waffle
a3b816be53 Use is_some_and/is_ok_and in less obvious spots 2023-05-24 14:33:43 +00:00
bjorn3
031bfa659f Print symbol name in PrintOnPanic for define_function 2023-05-23 11:48:34 +00:00
bjorn3
6900c9943d Update Cranelift to 0.96.0 2023-05-22 16:06:01 +00:00
Dylan DPC
84644eb9c6 Rollup merge of #111633 - nnethercote:avoid-ref-format, r=WaffleLapkin
Avoid `&format("...")` calls in error message code.

Some error message cleanups. Best reviewed one commit at a time.

r? `@davidtwco`
2023-05-18 10:52:35 +05:30
Nilstrieb
74ab27c269 Remove LangItems::require
It's just a short wrapper used by `tcx.require_lang_item`. Deleting it
gives us a negative diff.
2023-05-16 19:53:38 +02:00
Nicholas Nethercote
8a9b38fd3b Avoid &format("...") calls in error message code.
Error message all end up passing into a function as an `impl
Into<{D,Subd}iagnosticMessage>`. If an error message is creatd as
`&format("...")` that means we allocate a string (in the `format!`
call), then take a reference, and then clone (allocating again) the
reference to produce the `{D,Subd}iagnosticMessage`, which is silly.

This commit removes the leading `&` from a lot of these cases. This
means the original `String` is moved into the
`{D,Subd}iagnosticMessage`, avoiding the double allocations. This
requires changing some function argument types from `&str` to `String`
(when all arguments are `String`) or `impl
Into<{D,Subd}iagnosticMessage>` (when some arguments are `String` and
some are `&str`).
2023-05-16 17:59:56 +10:00