diff options
author | Tatsuyuki Ishi <ishitatsuyuki@gmail.com> | 2024-03-29 14:52:39 +0900 |
---|---|---|
committer | Kito Cheng <kito.cheng@sifive.com> | 2024-04-08 22:28:05 +0800 |
commit | 97069657c4e40b209c7b774e12faaca13812a86c (patch) | |
tree | ce8ca0338fcab2f48f3a259773ed375ba304818c /gcc/config/riscv/riscv-opts.h | |
parent | d5d84487dec06186fd9246b505f44ef68a66d6a2 (diff) | |
download | gcc-97069657c4e40b209c7b774e12faaca13812a86c.zip gcc-97069657c4e40b209c7b774e12faaca13812a86c.tar.gz gcc-97069657c4e40b209c7b774e12faaca13812a86c.tar.bz2 |
RISC-V: Implement TLS Descriptors.
This implements TLS Descriptors (TLSDESC) as specified in [1].
The 4-instruction sequence is implemented as a single RTX insn for
simplicity, but this can be revisited later if instruction scheduling or
more flexible RA is desired.
The default remains to be the traditional TLS model, but can be configured
with --with-tls={trad,desc}. The choice can be revisited once toolchain
and libc support ships.
[1]: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/373.
gcc/ChangeLog:
* config/riscv/riscv.opt: Add -mtls-dialect to configure TLS flavor.
* config.gcc: Add --with-tls configuration option to change the
default TLS flavor.
* config/riscv/riscv.h: Add TARGET_TLSDESC determined from
-mtls-dialect and with_tls defaults.
* config/riscv/riscv-opts.h: Define enum riscv_tls_type for the
two TLS flavors.
* config/riscv/riscv-protos.h: Define SYMBOL_TLSDESC symbol type.
* config/riscv/riscv.md: Add instruction sequence for TLSDESC.
* config/riscv/riscv.cc (riscv_symbol_insns): Add instruction
sequence length data for TLSDESC.
(riscv_legitimize_tls_address): Add lowering of TLSDESC.
* doc/install.texi: Document --with-tls for RISC-V.
* doc/invoke.texi: Document -mtls-dialect for RISC-V.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/tls_1.x: Add TLSDESC GD test case.
* gcc.target/riscv/tlsdesc.c: Same as above.
Diffstat (limited to 'gcc/config/riscv/riscv-opts.h')
-rw-r--r-- | gcc/config/riscv/riscv-opts.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/config/riscv/riscv-opts.h b/gcc/config/riscv/riscv-opts.h index 392b916..1b2dd57 100644 --- a/gcc/config/riscv/riscv-opts.h +++ b/gcc/config/riscv/riscv-opts.h @@ -154,4 +154,10 @@ enum rvv_vector_bits_enum { #define TARGET_MAX_LMUL \ (int) (rvv_max_lmul == RVV_DYNAMIC ? RVV_M8 : rvv_max_lmul) +/* TLS types. */ +enum riscv_tls_type { + TLS_TRADITIONAL, + TLS_DESCRIPTORS +}; + #endif /* ! GCC_RISCV_OPTS_H */ |