public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Merge #1543
@ 2022-10-10 7:34 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-10-10 7:34 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:bef31ea273689021f0fc8168f417edf386060512
commit bef31ea273689021f0fc8168f417edf386060512
Merge: e623ee314fb bb5efc657ae
Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Date: Fri Oct 7 11:03:59 2022 +0000
Merge #1543
1543: Reintroduce targetrustm hooks without the maze of macro definitions in target headers r=CohenArthur a=ibuclaw
- Adds skeleton support and documentation for targetrustm hooks.
- Re-adds previously reverted `TARGET_RUST_CPU_INFO` target hook.
- Re-adds the previously reverted `TARGET_RUST_OS_INFO` target hook.
- Implements `TARGET_RUST_CPU_INFO` hook for x86 (only a subset of the original i386-rust.cc was re-added)
- Implements `TARGET_RUST_OS_INFO` hook for darwin (covers both x86 and powerpc).
There's quite a bit to unpick from what was removed, but I hope this shows how firstly `rust-target.h` and `tm_rust.h` should be kept as empty as possible for the `default-rust.cc` source file that pulls in these headers; secondly all rust macros and declarations be put in rust-specific headers, then pulled into tm_rust.h as-needed. From every other `${target}-rust.cc` file, you can include as much as you like in order to pry out the information you need to get at.
I've verified this does work as expected with the `-frust-dump-target_options` switch, e.g with `-mavx2`
```
target_endian: "little"
target_pointer_width: "64"
target_feature: "fxsr"
target_feature: "popcnt"
target_feature: "avx2"
target_feature: "ssse3"
target_feature: "sse4.1"
target_feature: "sse3"
target_feature: "avx"
target_feature: "sse"
target_feature: "xsave"
target_feature: "sse4.2"
target_feature: "sse2"
target_feature: "mmx"
target_arch: "x86_64"
```
I've also built a few darwin cross compilers with the following results on i686-darwin
```
target_pointer_width: "32"
target_env: ""
target_vendor: "apple"
target_endian: "little"
target_os: "macos"
target_family: "unix"
target_feature: "sse3"
target_feature: "sse"
target_feature: "sse2"
target_feature: "mmx"
target_arch: "x86"
```
and on powerpc64-darwin
```
target_pointer_width: "64"
target_env: ""
target_vendor: "apple"
target_endian: "big"
target_os: "macos"
target_family: "unix"
```
Co-authored-by: Iain Buclaw <ibuclaw@gdcproject.org>
Diff:
.github/bors_log_expected_warnings | 8 +--
gcc/Makefile.in | 34 +++++++++-
gcc/config.gcc | 27 ++++++++
gcc/config/darwin-rust.cc | 44 +++++++++++++
gcc/config/default-rust.cc | 29 +++++++++
gcc/config/i386/i386-rust.cc | 129 +++++++++++++++++++++++++++++++++++++
gcc/config/i386/i386-rust.h | 22 +++++++
gcc/config/i386/t-i386 | 4 ++
gcc/config/t-darwin | 4 ++
gcc/configure | 21 +++++-
gcc/configure.ac | 14 ++++
gcc/doc/tm.texi | 26 ++++++++
gcc/doc/tm.texi.in | 17 +++++
gcc/genhooks.cc | 1 +
gcc/rust/rust-lang.cc | 2 -
gcc/rust/rust-session-manager.cc | 8 ++-
gcc/rust/rust-target-def.h | 20 ++++++
gcc/rust/rust-target.def | 52 +++++++++++++++
gcc/rust/rust-target.h | 35 ++++++++++
19 files changed, 487 insertions(+), 10 deletions(-)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-10-10 7:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-10 7:34 [gcc/devel/rust/master] Merge #1543 Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).