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.
Showing
- gcc/config.in 6 additions, 0 deletionsgcc/config.in
- gcc/config/loongarch/loongarch-opts.h 4 additions, 0 deletionsgcc/config/loongarch/loongarch-opts.h
- gcc/config/loongarch/loongarch.cc 43 additions, 3 deletionsgcc/config/loongarch/loongarch.cc
- gcc/config/loongarch/loongarch.md 12 additions, 0 deletionsgcc/config/loongarch/loongarch.md
- gcc/configure 31 additions, 0 deletionsgcc/configure
- gcc/configure.ac 5 additions, 0 deletionsgcc/configure.ac
- gcc/testsuite/gcc.target/loongarch/tls-le-relax.c 12 additions, 0 deletionsgcc/testsuite/gcc.target/loongarch/tls-le-relax.c
- gcc/testsuite/lib/target-supports.exp 12 additions, 0 deletionsgcc/testsuite/lib/target-supports.exp
Loading
Please register or sign in to comment