]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/configure.ac
LoongArch: Add code generation support for call36 function calls.
authorLulu Cheng <chenglulu@loongson.cn>
Thu, 16 Nov 2023 07:06:11 +0000 (15:06 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Sat, 18 Nov 2023 08:14:33 +0000 (16:14 +0800)
commit094cca429399680cb1c8f4e65041350da71d6937
treee8c7d612371e067615d2c680091c537e0245be51
parent841008d3966c0fe7a80ec10703a50fbdab7620ac
LoongArch: Add code generation support for call36 function calls.

When compiling with '-mcmodel=medium', the function call is made through
'pcaddu18i+jirl' if binutils supports call36, otherwise the
native implementation 'pcalau12i+jirl' is used.

gcc/ChangeLog:

* config.in: Regenerate.
* config/loongarch/loongarch-opts.h (HAVE_AS_SUPPORT_CALL36): Define macro.
* config/loongarch/loongarch.cc (loongarch_legitimize_call_address):
If binutils supports call36, the function call is not split over expand.
* config/loongarch/loongarch.md: Add call36 generation code.
* config/loongarch/predicates.md: Likewise.
* configure: Regenerate.
* configure.ac: Check whether binutils supports call36.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/func-call-medium-5.c: If the assembler supports call36,
the test is abandoned.
* gcc.target/loongarch/func-call-medium-6.c: Likewise.
* gcc.target/loongarch/func-call-medium-7.c: Likewise.
* gcc.target/loongarch/func-call-medium-8.c: Likewise.
* lib/target-supports.exp: Added a function to see if the assembler supports
the call36 relocation.
* gcc.target/loongarch/func-call-medium-call36-1.c: New test.
* gcc.target/loongarch/func-call-medium-call36.c: New test.

Co-authored-by: Xi Ruoyao <xry111@xry111.site>
14 files changed:
gcc/config.in
gcc/config/loongarch/loongarch-opts.h
gcc/config/loongarch/loongarch.cc
gcc/config/loongarch/loongarch.md
gcc/config/loongarch/predicates.md
gcc/configure
gcc/configure.ac
gcc/testsuite/gcc.target/loongarch/func-call-medium-5.c
gcc/testsuite/gcc.target/loongarch/func-call-medium-6.c
gcc/testsuite/gcc.target/loongarch/func-call-medium-7.c
gcc/testsuite/gcc.target/loongarch/func-call-medium-8.c
gcc/testsuite/gcc.target/loongarch/func-call-medium-call36-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/loongarch/func-call-medium-call36.c [new file with mode: 0644]
gcc/testsuite/lib/target-supports.exp