This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ARM/hard_vfp_branch] Fix VFP ABI / half-precision interaction


Now that the half-precision support has been merged to
branches/ARM/hard_vfp_branch, this patch fixes the interactions
between half-precision support and the VFP ABI: the libgcc functions
for conversions between HFmode and SFmode have to use the base ABI
rather than the VFP ABI (they are defined using integer arguments /
return values since the half-precision specification doesn't allow
half-precision arguments or return values at all in C code).

Tested with cross to arm-none-eabi (-mfloat-abi=hard).  OK to commit
to branches/ARM/hard_vfp_branch?

2009-07-20  Joseph Myers  <joseph@codesourcery.com>

	* config/arm/arm.c (arm_libcall_value, arm_init_cumulative_args):
	Use base ABI for conversion libfuncs between HFmode and SFmode.

Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	(revision 149823)
+++ gcc/config/arm/arm.c	(working copy)
@@ -3156,7 +3156,11 @@ arm_libcall_value (enum machine_mode mod
 	  || rtx_equal_p (libcall,
 			  convert_optab_libfunc (sfloat_optab, mode, DImode))
 	  || rtx_equal_p (libcall,
-			  convert_optab_libfunc (ufloat_optab, mode, DImode)))
+			  convert_optab_libfunc (ufloat_optab, mode, DImode))
+	  || rtx_equal_p (libcall,
+			  convert_optab_libfunc (trunc_optab, HFmode, SFmode))
+	  || rtx_equal_p (libcall,
+			  convert_optab_libfunc (sext_optab, SFmode, HFmode)))
 	return gen_rtx_REG (mode, ARG_REGISTER(1));
 
       /* XXX There are other libcalls that return in integer registers,
@@ -4062,7 +4066,7 @@ aapcs_layout_arg (CUMULATIVE_ARGS *pcum,
    For a library call, FNTYPE is NULL.  */
 void
 arm_init_cumulative_args (CUMULATIVE_ARGS *pcum, tree fntype,
-			  rtx libname  ATTRIBUTE_UNUSED,
+			  rtx libname,
 			  tree fndecl ATTRIBUTE_UNUSED)
 {
   /* Long call handling.  */
@@ -4084,7 +4088,11 @@ arm_init_cumulative_args (CUMULATIVE_ARG
 	  || rtx_equal_p (libname,
 			  convert_optab_libfunc (sfix_optab, DImode, SFmode))
 	  || rtx_equal_p (libname,
-			  convert_optab_libfunc (ufix_optab, DImode, SFmode)))
+			  convert_optab_libfunc (ufix_optab, DImode, SFmode))
+	  || rtx_equal_p (libname,
+			  convert_optab_libfunc (trunc_optab, HFmode, SFmode))
+	  || rtx_equal_p (libname,
+			  convert_optab_libfunc (sext_optab, SFmode, HFmode)))
 	pcum->pcs_variant = ARM_PCS_AAPCS;
  
       pcum->aapcs_ncrn = pcum->aapcs_next_ncrn = 0;

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]