Commit Graph

689 Commits

Author SHA1 Message Date
Ellis Hoag
1f3ae14c83 Lint against untranslatable diagnostics in rustc_codegen_gcc 2022-09-24 10:24:48 -07:00
Ellis Hoag
534ce39aac Add LayoutSizeOverflow 2022-09-24 10:24:48 -07:00
Ellis Hoag
33b58ebf22 Add LTONotSupported 2022-09-24 10:24:48 -07:00
Ellis Hoag
7fc07caf67 Add UnwindingInlineAsm 2022-09-24 10:24:48 -07:00
Ellis Hoag
7277046d84 Add LinkageConstOrMutType 2022-09-24 10:24:48 -07:00
Ellis Hoag
23eae52d45 Add RanlibFailure 2022-09-24 10:24:48 -07:00
antoyo
1724042e22
Merge pull request #218 from rust-lang/fix/build-release-sysroot
Fix build of release sysroot in test.sh
2022-09-14 09:22:50 -04:00
Antoni Boucher
3e6710962e Fix build of release sysroot in test.sh 2022-09-14 08:26:59 -04:00
antoyo
b0ccfd1f90
Merge pull request #215 from sadlerap/extract-element
simd: impl extract_element for vector types
2022-09-10 07:31:45 -04:00
Andy Sadler
d7d820fc47
simd: impl extract_element for vector types
This fixes some tests that needed vector element extraction.

Signed-off-by: Andy Sadler <andrewsadler122@gmail.com>
2022-09-09 10:07:36 -05:00
Oli Scherer
c3dce60ac7 Remove dead broken code from const zst handling in backends 2022-09-06 14:09:49 +00:00
Antoni Boucher
2ecd620acb Fix IRC badge 2022-09-04 19:34:24 -04:00
Antoni Boucher
9560cb13fe Add IRC channel in the readme 2022-09-04 19:29:45 -04:00
antoyo
f623e5325a
Merge pull request #214 from sadlerap/minmax
simd: implement simd_fmin/fmax
2022-08-30 21:08:04 -04:00
Andy Sadler
1d3ca135d0
simd: implement simd_fmin/fmax
This implements simd_fmin/fmax in a largely-optimal method.

Signed-off-by: Andy Sadler <andrewsadler122@gmail.com>
2022-08-30 19:34:27 -05:00
Dylan DPC
ecb861316e Rollup merge of #100653 - cuviper:fptoint_sat, r=michaelwoerister,antoyo
Move the cast_float_to_int fallback code to GCC

Now that we require at least LLVM 13, that codegen backend is always
using its intrinsic `fptosi.sat` and `fptoui.sat` conversions, so it
doesn't need the manual implementation. However, the GCC backend still
needs it, so we can move all of that code down there.
2022-08-30 16:56:09 +05:30
Dylan DPC
f2d73af6d7 Rollup merge of #101101 - RalfJung:read-pointer-as-bytes, r=oli-obk
interpret: make read-pointer-as-bytes a CTFE-only error with extra information

Next step in the reaction to https://github.com/rust-lang/rust/issues/99923. Also teaches Miri to implicitly strip provenance in more situations when transmuting pointers to integers, which fixes https://github.com/rust-lang/miri/issues/2456.

Pointer-to-int transmutation during CTFE now produces a message like this:
```
   = help: this code performed an operation that depends on the underlying bytes representing a pointer
   = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
```

r? ``@oli-obk``
2022-08-30 11:26:51 +05:30
antoyo
2342414f49
Merge pull request #213 from rust-lang/fix/bitcast-wrong-size
Fix bitcast to a type of a different size
2022-08-29 17:35:50 -04:00
Antoni Boucher
45ec5f2676 Fix bitcast to a type of a different size 2022-08-28 20:58:11 -04:00
bors
7006047b2d Auto merge of #96946 - WaffleLapkin:ptr_mask, r=scottmcm
Add pointer masking convenience functions

This PR adds the following public API:
```rust
impl<T: ?Sized> *const T {
    fn mask(self, mask: usize) -> *const T;
}

impl<T: ?Sized> *mut T {
    fn mask(self, mask: usize) -> *const T;
}

// mod intrinsics
fn mask<T>(ptr: *const T, mask: usize) -> *const T
```
This is equivalent to `ptr.map_addr(|a| a & mask)` but also uses a cool llvm intrinsic.

Proposed in https://github.com/rust-lang/rust/pull/95643#issuecomment-1121562352

cc `@Gankra` `@scottmcm` `@RalfJung`

r? rust-lang/libs-api
2022-08-28 01:34:47 +00:00
antoyo
866f9c527a
Merge pull request #210 from rust-lang/fix/asm-newline
Remove extra newline in asm
2022-08-27 20:50:38 -04:00
Antoni Boucher
fc56c54416 Remove extra newline in asm 2022-08-27 19:41:37 -04:00
antoyo
06b6ec0ebe
Merge pull request #211 from rust-lang/fix/used-function-attribute-inline-asm
Add used function attribute from inline asm
2022-08-27 18:42:26 -04:00
Antoni Boucher
5c2dec038c Add used function attribute from inline asm 2022-08-27 17:26:46 -04:00
antoyo
9d6b4a9875
Merge pull request #207 from GuillaumeGomez/regen-intrinsics
Regenerate intrinsics
2022-08-27 15:40:59 -04:00
Guillaume Gomez
e82c6a07ff Regen intrinsics 2022-08-27 21:05:25 +02:00
Ralf Jung
c32ad5c229 interpret: rename relocation → provenance 2022-08-27 14:11:19 -04:00
antoyo
346ae2ad4b
Merge pull request #183 from sadlerap/simd-reduction-intrinsics
simd: Implement missing reduction intrinsics
2022-08-27 14:02:24 -04:00
Andy Sadler
4df874f73d simd: Implement missing reduction intrinsics
Implements the following simd reduction intrinsics:
- simd_reduce_add_ordered
- simd_reduce_mul_ordered
- simd_reduce_min_nanless
- simd_reduce_max_nanless
- simd_reduce_xor
- simd_reduce_any
- simd_reduce_all

Also fixes the ordering of simd_reduce_min and simd_reduce_max,
which were tested to be flipped.

Both simd_reduce_min_nanless and simd_reduce_max_nanless are identical
to their non-nanless variants for the time being.  An attempt was made
at a more optimal codegen solution based on vector_reduce_op.  However,
this approach ran into masking issues for floating-point vector types,
which appears to be broken for the same reason that comparison
operations such as simd_lt are broken for floating-point vector types.
More investigation is required, however, to determine a root cause and
appropriate fix.

This should be enough to pass the generic-reduction-pass.rs ui tests
with the 'master' feature enabled.

Signed-off-by: Andy Sadler <andrewsadler122@gmail.com>
2022-08-27 12:16:37 -05:00
antoyo
b4626b3ca0
Merge pull request #209 from rust-lang/2022-08-26_sync_from_rust
2022/08/26 sync from rust
2022-08-27 12:09:37 -04:00
Antoni Boucher
61a7b96c80 Disable test mir_heavy_promoted 2022-08-27 11:44:21 -04:00
Antoni Boucher
eed6603c0a Fix tests 2022-08-27 11:10:34 -04:00
bors
1a61b6e919 Auto merge of #100999 - nnethercote:shrink-FnAbi, r=bjorn3
Shrink `FnAbi`

Because they can take up a lot of memory in debug and release builds.

r? `@bjorn3`
2022-08-27 14:00:53 +00:00
Antoni Boucher
7d01d51e9f Fix tests 2022-08-27 09:50:38 -04:00
Antoni Boucher
9a6b75515e Fix merge conflicts 2022-08-27 09:50:38 -04:00
Antoni Boucher
081eb744d2 Merge branch 'master' into 2022-08-26_sync_from_rust 2022-08-26 20:00:56 -04:00
Nicholas Nethercote
89003418b3 Move ArgAbi::pad_i32 into PassMode::Cast.
Because it's only needed for that variant. This shrinks the types and
clarifies the logic.
2022-08-26 11:12:36 +10:00
Nicholas Nethercote
d83636d3fa Turn ArgAbi::pad into a bool.
Because it's only ever set to `None` or `Some(Reg::i32())`.
2022-08-26 10:53:41 +10:00
Yuki Okushi
5b1229eb45 Rollup merge of #100604 - dtolnay:okorerr, r=m-ou-se
Remove unstable Result::into_ok_or_err

Pending FCP: https://github.com/rust-lang/rust/issues/82223#issuecomment-1214920203

```@rustbot``` label +waiting-on-fcp
2022-08-26 09:51:44 +09:00
Nicholas Nethercote
5a6992916e Simplify arg capacity calculations.
Currently they try to be very precise. But they are wrong, i.e. they
don't match what's happening in the loop below. This code isn't hot
enough for it to matter that much.
2022-08-26 10:45:45 +10:00
Nicholas Nethercote
f78592f1bc Change FnAbi::args to a boxed slice. 2022-08-26 10:30:36 +10:00
Nicholas Nethercote
93191f66dc Box CastTarget within PassMode.
Because `PassMode::Cast` is by far the largest variant, but is
relatively rare.

This requires making `PassMode` not impl `Copy`, and `Clone` is no
longer necessary. This causes lots of sigil adjusting, but nothing very
notable.
2022-08-26 09:35:28 +10:00
Maybe Waffle
1acc3b45e3 Fix ptr_mask impl in cg gcc 2022-08-21 05:27:14 +04:00
Maybe Waffle
34d33f2299 Implement ptr_mask intrinsic in cg gcc 2022-08-21 05:27:14 +04:00
Maybe Waffle
928ef372c3 Replace most uses of pointer::offset with add and sub 2022-08-21 02:21:41 +04:00
David Tolnay
f21a3003e5 Remove unstable Result::into_ok_or_err 2022-08-17 17:20:42 -07:00
Josh Stone
0646f0dda6 Move the cast_float_to_int fallback code to GCC
Now that we require at least LLVM 13, that codegen backend is always
using its intrinsic `fptosi.sat` and `fptoui.sat` conversions, so it
doesn't need the manual implementation. However, the GCC backend still
needs it, so we can move all of that code down there.
2022-08-16 15:46:17 -07:00
antoyo
b4eb2c30a2
Merge pull request #204 from rust-lang/fix/mxcsr-builtins
Fix the mxcsr builtins
2022-08-04 21:12:19 -04:00
Antoni Boucher
deedd28881 Fix the mxcsr builtins 2022-08-04 20:46:32 -04:00
antoyo
70c7c06b80
Merge pull request #203 from rust-lang/feature/visibility
Support symbol visibility
2022-08-03 20:09:13 -04:00