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]

Re: [PATCH, ARM] soft/hard-float preprocessor symbol


On Thu, 2010-07-22 at 00:06 +0800, Chung-Lin Tang wrote:
> Hi, this patch adds built-in preprocessor symbols __ARM_PCS, 
> __ARM_PCS_VFP to indicate the current soft/hard-float calling 
> convention, as described in the draft ACLE.
> 
> If approved, please help to apply to trunk, as I don't have commit 
> rights yet.
> 
> Thanks,
> Chung-Lin
> 
> 2010-07-22  Chung-Lin Tang  <cltang@codesourcery.com>
> 
> 	* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __ARM_PCS or
> 	__ARM_PCS_VFP to indicate soft/hard-float calling convention.
> 
> 
> 
> plain text document attachment (pcs.diff)
> Index: arm.h
> ===================================================================
> --- arm.h	(revision 162381)
> +++ arm.h	(working copy)
> @@ -94,7 +94,13 @@
>  	if (arm_arch_iwmmxt)				\
>  	  builtin_define ("__IWMMXT__");		\
>  	if (TARGET_AAPCS_BASED)				\
> -	  builtin_define ("__ARM_EABI__");		\
> +	  {						\
> +	    if (TARGET_VFP && TARGET_HARD_FLOAT_ABI)	\
> +	      builtin_define ("__ARM_PCS_VFP");		\
> +	    else					\
> +	      builtin_define ("__ARM_PCS");		\
> +	    builtin_define ("__ARM_EABI__");		\
> +	  }						\
>      } while (0)
>  
>  /* The various ARM cores.  */

The tests should be on arm_pcs_default.  If that has the value
ARM_PCS_AAPCS_VFP then __ARM_PCS_VFP should be defined.  If it has the
value ARM_PCS_AAPCS, then __ARM_PCS should be defined.  In other cases,
I think neither should be defined (leaving the option open to create new
pre-processor defines in future).

That does leave nothing defined for the IWMMXT variant.  I'm not
entirely sure what to do about that.  It appears that this just follows
the base standard for calling, in which case __ARM_PCS probably should
be defined, but I want to think that case through further before making
that decision: there may be a subtlety that I've missed.

R.



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