diff options
author | Lulu Cheng <chenglulu@loongson.cn> | 2023-12-12 16:32:31 +0800 |
---|---|---|
committer | Lulu Cheng <chenglulu@loongson.cn> | 2024-01-02 09:33:27 +0800 |
commit | 3c20e6263abc361b5eec8a515388959ed4434776 (patch) | |
tree | ff26e4a55e8279d87cb6a59cb3d7a8bf1f2493b6 /gcc/configure | |
parent | d3d6a96d45108d30395b6506fe4b3a91cd40f573 (diff) | |
download | gcc-3c20e6263abc361b5eec8a515388959ed4434776.zip gcc-3c20e6263abc361b5eec8a515388959ed4434776.tar.gz gcc-3c20e6263abc361b5eec8a515388959ed4434776.tar.bz2 |
LoongArch: Added TLS Le Relax support.
Check whether the assembler supports tls le relax. If it supports it, the assembly
instruction sequence of tls le relax will be generated by default.
The original way to obtain the tls le symbol address:
lu12i.w $rd, %le_hi20(sym)
ori $rd, $rd, %le_lo12(sym)
add.{w/d} $rd, $rd, $tp
If the assembler supports tls le relax, the following sequence is generated:
lu12i.w $rd, %le_hi20_r(sym)
add.{w/d} $rd,$rd,$tp,%le_add_r(sym)
addi.{w/d} $rd,$rd,%le_lo12_r(sym)
gcc/ChangeLog:
* config.in: Regenerate.
* config/loongarch/loongarch-opts.h (HAVE_AS_TLS_LE_RELAXATION): Define.
* config/loongarch/loongarch.cc (loongarch_legitimize_tls_address):
Added TLS Le Relax support.
(loongarch_print_operand_reloc): Add the output string of TLS Le Relax.
* config/loongarch/loongarch.md (@add_tls_le_relax<mode>): New template.
* configure: Regenerate.
* configure.ac: Check if binutils supports TLS le relax.
gcc/testsuite/ChangeLog:
* lib/target-supports.exp: Add a function to check whether binutil supports
TLS Le Relax.
* gcc.target/loongarch/tls-le-relax.c: New test.
Diffstat (limited to 'gcc/configure')
-rwxr-xr-x | gcc/configure | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/configure b/gcc/configure index de72cb1..996046f 100755 --- a/gcc/configure +++ b/gcc/configure @@ -31052,6 +31052,37 @@ $as_echo "#define HAVE_AS_COND_BRANCH_RELAXATION 1" >>confdefs.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for tls le relaxation support" >&5 +$as_echo_n "checking assembler for tls le relaxation support... " >&6; } +if ${gcc_cv_as_loongarch_tls_le_relaxation_support+:} false; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_as_loongarch_tls_le_relaxation_support=no + if test x$gcc_cv_as != x; then + $as_echo 'lu12i.w $t0,%le_hi20_r(a)' > conftest.s + if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then + gcc_cv_as_loongarch_tls_le_relaxation_support=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_loongarch_tls_le_relaxation_support" >&5 +$as_echo "$gcc_cv_as_loongarch_tls_le_relaxation_support" >&6; } +if test $gcc_cv_as_loongarch_tls_le_relaxation_support = yes; then + +$as_echo "#define HAVE_AS_TLS_LE_RELAXATION 1" >>confdefs.h + +fi + ;; s390*-*-*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .gnu_attribute support" >&5 |