Commit Graph

41 Commits

Author SHA1 Message Date
Antoni Boucher
6bfe2b0b05 Support more SIMD intrinsics 2022-05-03 17:47:46 -04:00
Antoni Boucher
a65418666f Implement simd_select_bitmask 2022-05-03 17:47:46 -04:00
Antoni Boucher
ddc152b04d Add more SIMD 2022-05-03 17:47:46 -04:00
Antoni Boucher
4636c59df5 Add more SIMD 2022-05-03 17:47:46 -04:00
Antoni Boucher
5088fb3d3b Cast arguments in SIMD function 2022-05-03 17:47:46 -04:00
antoyo
852735da05
Merge pull request #171 from GuillaumeGomez/update-intrinsics
Update intrinsics conversion generation
2022-05-03 17:47:03 -04:00
Guillaume Gomez
6e1bf49273 Give priority to intrinsics translations from llvm 2022-05-03 23:00:25 +02:00
Guillaume Gomez
618ba484e9 Handle a syntax corner case where a def does not end with a ; 2022-05-03 23:00:25 +02:00
Guillaume Gomez
f402cfe561 Update intrinsics 2022-05-03 21:24:22 +02:00
Guillaume Gomez
ed0ba311c5 Update intrinsics 2022-05-03 20:55:55 +02:00
Antoni Boucher
4d7de81199 Add feature for future libgccjit 12 release 2022-04-13 23:01:01 -04:00
antoyo
d69ada6bf3
Merge pull request #156 from yvt/fix-int-ops
Implement `saturating_{add, sub}` for non-native integer types
2022-04-06 10:14:19 -04:00
yvt
5061e3ad16 Remove redundant assertions 2022-04-06 21:49:54 +09:00
yvt
00677e5159 Implement saturating_{add, sub} for non-native integer types
Updates their unsigned code paths to use the `Builder::gcc_` methods
that automatically lower non-native integer operations to native ones.

Also updates the signed code path of `saturating_add` to support non-
native integer types. That of `saturating_sub` already supports this,
so no major changes have been made.
2022-04-06 01:48:37 +09:00
Guillaume Gomez
035ac03521 Add intrinsics not bound to a specific arch 2022-03-31 14:58:31 +02:00
Guillaume Gomez
68ac3a4b3b Generate all listed architectures from llvmint 2022-03-30 18:41:57 +02:00
Guillaume Gomez
3970825b92 Add intrinsic translation for x86 arch 2022-03-30 17:37:33 +02:00
bjorn3
9bb797c2ae Add missing vendor intrinsics 2022-03-30 14:16:02 +02:00
Antoni Boucher
267e5e1ea7 Add support for target builtins 2022-03-29 22:50:20 -04:00
Antoni Boucher
02970a6ca8 Add support for target builtins 2022-03-29 21:41:17 -04:00
bjorn3
db591778ac Sync from rust bc881e83d1 2022-03-26 12:52:21 +01:00
Nicholas Nethercote
d35fc85a44 Clarify Layout interning.
`Layout` is another type that is sometimes interned, sometimes not, and
we always use references to refer to it so we can't take any advantage
of the uniqueness properties for hashing or equality checks.

This commit renames `Layout` as `LayoutS`, and then introduces a new
`Layout` that is a newtype around an `Interned<LayoutS>`. It also
interns more layouts than before. Previously layouts within layouts
(via the `variants` field) were never interned, but now they are. Hence
the lifetime on the new `Layout` type.

Unlike other interned types, these ones are in `rustc_target` instead of
`rustc_middle`. This reflects the existing structure of the code, which
does layout-specific stuff in `rustc_target` while `TyAndLayout` is
generic over the `Ty`, allowing the type-specific stuff to occur in
`rustc_middle`.

The commit also adds a `HashStable` impl for `Interned`, which was
needed. It hashes the contents, unlike the `Hash` impl which hashes the
pointer.
2022-03-07 13:41:47 +11:00
Antoni Boucher
dcc0853a34 Add support for on_stack parameters 2022-02-27 22:23:03 -05:00
bjorn3
f7063174a4 Support -Cpanic=unwind without unwinding 2022-02-26 19:35:33 +01:00
bjorn3
a7c1c47c83 Fix review comments 2022-02-25 17:25:32 +01:00
bjorn3
ff6b398f1b Use bx.switch_to_block where possible 2022-02-25 15:28:56 +01:00
Antoni Boucher
9c3cce661f Implement simd_neg 2022-01-31 18:39:14 -05:00
antoyo
41f20fa3a5
Support 128-bit integers on platforms without native support (#103)
* Use sized integer types

* Add support for integer types not supported on some platforms

* Add feature to test non-native integers in CI
2022-01-30 21:45:14 -05:00
bjorn3
54d2ec1a82 Merge commit '1411a98352ba6bee8ba3b0131c9243e5db1e6a2e' into sync_cg_clif-2021-12-31 2021-12-31 16:26:32 +01:00
bjorn3
ebc6ad4185 Sync from rust 65d8785f0a 2021-12-30 15:25:38 +01:00
Nicholas Nethercote
bba8b97b83 Remove unnecessary sigils around Symbol::as_str() calls. 2021-12-15 17:32:14 +11:00
Andreas Jonson
a912fedd0f Remove workaround for the forward progress handling in LLVM 2021-11-14 16:35:09 +01:00
antoyo
fc8e79fea9
Sync from rust (#107)
* Rebase fallout.

* Move rustc_middle::middle::cstore to rustc_session.

* Create more accurate debuginfo for vtables.

Before this commit all vtables would have the same name "vtable" in
debuginfo. Now they get a name that identifies the implementing type
and the trait that is being implemented.

* Remove alloc::prelude

As per the libs team decision in #58935.

Closes #58935

* Make hash_result an Option.

* Properly check `target_features` not to trigger an assertion

* Add LLVM CFI support to the Rust compiler

This commit adds LLVM Control Flow Integrity (CFI) support to the Rust
compiler. It initially provides forward-edge control flow protection for
Rust-compiled code only by aggregating function pointers in groups
identified by their number of arguments.

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 defining and using compatible type identifiers
(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).

* Update to nightly-2021-10-30

* Add deduplication of constant values as rustc relies on LLVM doing that

Co-authored-by: Camille GILLOT <gillot.camille@gmail.com>
Co-authored-by: Michael Woerister <michaelwoerister@posteo>
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
Co-authored-by: Yuki Okushi <yuki.okushi@huawei.com>
Co-authored-by: Ramon de C Valle <rcvalle@users.noreply.github.com>
2021-10-30 18:21:33 -04:00
Ramon de C Valle
14b83de047 Add LLVM CFI support to the Rust compiler
This commit adds LLVM Control Flow Integrity (CFI) support to the Rust
compiler. It initially provides forward-edge control flow protection for
Rust-compiled code only by aggregating function pointers in groups
identified by their number of arguments.

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 defining and using compatible type identifiers
(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).
2021-10-25 16:23:01 -07:00
antoyo
669359530e
Add missing cast and change some bitcasts to casts to avoid a gimple verification failure (#100) 2021-10-11 10:56:08 -04:00
antoyo
cd4810de42
Fix warnings (#98) 2021-09-28 09:32:54 -04:00
antoyo
11c2023ef5
Fix/count trailing zeroes (#95)
* Fix count trailing zeroes
* Fix pop count
* Fix bit reverse
2021-09-27 20:35:45 -04:00
Commeownist
48d60ab7c5
Update to nightly-2021-09-11 (#79)
* Implement `black_box` as intrinsic

Responsibility of implementing the black box is now lies on backend

* Remove some TODOs

* Update to nightly-2021-09-17

* CI: don't fail on warnings
2021-09-17 17:19:25 -04:00
antoyo
e228f0c16e
Cleanup (#67) 2021-08-15 08:28:46 -04:00
antoyo
0c89065b93
Update to nightly-2021-08-12 (#61) 2021-08-14 10:05:49 -04:00
Antoni Boucher
afae271d5d Initial commit 2021-08-12 21:46:50 -04:00