Skip to content
Snippets Groups Projects
Commit 094cca42 authored by Lulu Cheng's avatar Lulu Cheng
Browse files

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: default avatarXi Ruoyao <xry111@xry111.site>
parent 841008d3
No related branches found
No related tags found
Loading
Showing
with 268 additions and 36 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment