From 002ffd3caa684c3eb30f8f53206439b7aa34b370 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 30 Sep 2019 16:19:43 +0000 Subject: Add a target hook for getting an ABI from a function type This patch adds a target hook that allows targets to return the ABI associated with a particular function type. Generally, when multiple ABIs are in use, it must be possible to tell from a function type and its attributes which ABI it is using. 2019-09-30 Richard Sandiford gcc/ * target.def (fntype_abi): New target hook. * doc/tm.texi.in (TARGET_FNTYPE_ABI): Likewise. * doc/tm.texi: Regenerate. * target.h (predefined_function_abi): Declare. * function-abi.cc (fntype_abi): Call targetm.calls.fntype_abi, if defined. * config/aarch64/aarch64.h (ARM_PCS_SIMD): New arm_pcs value. * config/aarch64/aarch64.c: Include function-abi.h. (aarch64_simd_abi, aarch64_fntype_abi): New functions. (TARGET_FNTYPE_ABI): Define. From-SVN: r276308 --- gcc/doc/tm.texi | 10 ++++++++++ gcc/doc/tm.texi.in | 5 +++++ 2 files changed, 15 insertions(+) (limited to 'gcc/doc') diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index a86c210..0f79d38 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -1898,6 +1898,16 @@ must be defined. Modern ports should define @code{CALL_REALLY_USED_REGISTERS}. @cindex call-used register @cindex call-clobbered register @cindex call-saved register +@deftypefn {Target Hook} {const predefined_function_abi &} TARGET_FNTYPE_ABI (const_tree @var{type}) +Return the ABI used by a function with type @var{type}; see the +definition of @code{predefined_function_abi} for details of the ABI +descriptor. Targets only need to define this hook if they support +interoperability between several ABIs in the same translation unit. +@end deftypefn + +@cindex call-used register +@cindex call-clobbered register +@cindex call-saved register @deftypefn {Target Hook} bool TARGET_HARD_REGNO_CALL_PART_CLOBBERED (rtx_insn *@var{insn}, unsigned int @var{regno}, machine_mode @var{mode}) This hook should return true if @var{regno} is partly call-saved and partly call-clobbered, and if a value of mode @var{mode} would be partly diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 06dfcda..ed605c0 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -1709,6 +1709,11 @@ must be defined. Modern ports should define @code{CALL_REALLY_USED_REGISTERS}. @cindex call-used register @cindex call-clobbered register @cindex call-saved register +@hook TARGET_FNTYPE_ABI + +@cindex call-used register +@cindex call-clobbered register +@cindex call-saved register @hook TARGET_HARD_REGNO_CALL_PART_CLOBBERED @hook TARGET_REMOVE_EXTRA_CALL_PRESERVED_REGS -- cgit v1.1