Commit Graph

367 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Antoni Boucher
672eec3055 Support symbol visibility 2022-08-03 19:34:47 -04:00
bjorn3
3a8ff6140b Introduce an ArchiveBuilderBuilder
This avoids monomorphizing all linker code for each codegen backend and
will allow passing in extra information to the archive builder from the
codegen backend.
2022-07-28 09:08:47 +00:00
bjorn3
56f34865ae Inline inject_dll_import_lib 2022-07-28 08:43:15 +00:00
bjorn3
a3ea31b846 Move output argument from ArchiveBuilder::new to .build() 2022-07-28 08:39:19 +00:00
bors
fe5cc38098 Auto merge of #98989 - dpaoliello:rawdylibbin, r=michaelwoerister
Enable raw-dylib for bin crates

Fixes #93842

When `raw-dylib` is used in a `bin` crate, we need to collect all of the `raw-dylib` functions, generate the import library and add that to the linker command line.

I also changed the tests so that 1) the C++ dlls are created after the Rust dlls, thus there is no chance of accidentally using them in the Rust linking process and 2) disabled generating import libraries when building with MSVC.
2022-07-26 01:47:34 +00:00
bors
c5528ce643 Auto merge of #95548 - rcvalle:rust-cfi-2, r=nagisa
Add fine-grained LLVM CFI support to the Rust compiler

This PR improves the LLVM Control Flow Integrity (CFI) support in the Rust compiler by providing forward-edge control flow protection for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types.

Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue https://github.com/rust-lang/rust/issues/89653).

LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto).

Thank you again, `@eddyb,` `@nagisa,` `@pcc,` and `@tmiasko` for all the help!
2022-07-24 01:22:36 +00:00
antoyo
a227994b53
Merge pull request #202 from rust-lang/fix/recursive-types
Cleanup regarding handling of recursive types
2022-07-23 21:08:07 -04:00
Antoni Boucher
5f630f3c81 Cleanup regarding handling of recursive types 2022-07-23 20:37:55 -04:00
Ramon de C Valle
bfe3c24e9a Add fine-grained LLVM CFI support to the Rust compiler
This commit improves the LLVM Control Flow Integrity (CFI) support in
the Rust compiler by providing forward-edge control flow protection for
Rust-compiled code only by aggregating function pointers in groups
identified by their return and parameter types.

Forward-edge control flow protection for C or C++ and Rust -compiled
code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code
share the same virtual address space) will be provided in later work as
part of this project by identifying C char and integer type uses at the
time types are encoded (see Type metadata in the design document in the
tracking issue #89653).

LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e.,
-Clto).
2022-07-23 10:51:34 -07:00
Daniel Paoliello
fef3b3e27d Enable raw-dylib for binaries 2022-07-22 09:55:14 -07:00
bors
e5e7395cca Auto merge of #99420 - RalfJung:vtable, r=oli-obk
make vtable pointers entirely opaque

This implements the scheme discussed in https://github.com/rust-lang/unsafe-code-guidelines/issues/338: vtable pointers should be considered entirely opaque and not even readable by Rust code, similar to function pointers.

- We have a new kind of `GlobalAlloc` that symbolically refers to a vtable.
- Miri uses that kind of allocation when generating a vtable.
- The codegen backends, upon encountering such an allocation, call `vtable_allocation` to obtain an actually dataful allocation for this vtable.
- We need new intrinsics to obtain the size and align from a vtable (for some `ptr::metadata` APIs), since direct accesses are UB now.

I had to touch quite a bit of code that I am not very familiar with, so some of this might not make much sense...
r? `@oli-obk`
2022-07-22 01:33:49 +00:00
Ralf Jung
59d223d1ed slightly cleaner, if more verbose, vtable handling in codegen backends 2022-07-20 17:12:07 -04:00
Ralf Jung
3f24eb870d consistently use VTable over Vtable (matching stable stdlib API RawWakerVTable) 2022-07-20 17:12:07 -04:00
Ralf Jung
8f290184d2 add a Vtable kind of symbolic allocations 2022-07-20 16:57:31 -04:00
Michael Woerister
4f118ce102 Remove unused StableMap and StableSet types from rustc_data_structures 2022-07-20 13:11:39 +02:00
Joshua Nelson
bca7b0279f Rename debugging_opts to unstable_opts
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`).
Rename it to be more clear.
2022-07-13 17:47:06 -05:00
Dylan DPC
6bcab05690 Rollup merge of #99155 - Amanieu:unstable-target-features, r=davidtwco
Keep unstable target features for asm feature checking

Inline assembly uses the target features to determine which registers
are available on the current target. However it needs to be able to
access unstable target features for this.

Fixes #99071
2022-07-13 19:32:36 +05:30
Amanieu d'Antras
c98d66cabf Keep unstable target features for asm feature checking
Inline assembly uses the target features to determine which registers
are available on the current target. However it needs to be able to
access unstable target features for this.

Fixes #99071
2022-07-11 14:26:58 +01:00
antoyo
22e4f181cb
Merge pull request #201 from GuillaumeGomez/cache-rust
Add cache for rust repository
2022-07-10 10:42:04 -04:00
Guillaume Gomez
28b11119e7 Add cache for rust repository 2022-07-10 12:43:33 +02:00
Ralf Jung
33e8d4c2d4 fix cranelift and gcc backends 2022-07-09 07:27:29 -04:00
antoyo
7c9db86fa1
Merge pull request #200 from GuillaumeGomez/sort-find
Sort ui_tests to ensure they remain coherent across different jobs
2022-07-08 16:11:50 -04:00