public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, ARM] soft/hard-float preprocessor symbol
@ 2010-07-21 16:06 Chung-Lin Tang
  2010-07-22 22:32 ` Mark Mitchell
  2010-07-23 21:47 ` Richard Earnshaw
  0 siblings, 2 replies; 6+ messages in thread
From: Chung-Lin Tang @ 2010-07-21 16:06 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 458 bytes --]

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.




[-- Attachment #2: pcs.diff --]
[-- Type: text/plain, Size: 560 bytes --]

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.  */

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH, ARM] soft/hard-float preprocessor symbol
  2010-07-21 16:06 [PATCH, ARM] soft/hard-float preprocessor symbol Chung-Lin Tang
@ 2010-07-22 22:32 ` Mark Mitchell
  2010-07-23 21:47 ` Richard Earnshaw
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Mitchell @ 2010-07-22 22:32 UTC (permalink / raw)
  To: Chung-Lin Tang; +Cc: gcc-patches

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.

Do you have a pointer to that document?  I just want to double-check the
specification, and then I can review/approve this.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH, ARM] soft/hard-float preprocessor symbol
  2010-07-21 16:06 [PATCH, ARM] soft/hard-float preprocessor symbol Chung-Lin Tang
  2010-07-22 22:32 ` Mark Mitchell
@ 2010-07-23 21:47 ` Richard Earnshaw
  2010-07-26  5:01   ` Chung-Lin Tang
  1 sibling, 1 reply; 6+ messages in thread
From: Richard Earnshaw @ 2010-07-23 21:47 UTC (permalink / raw)
  To: Chung-Lin Tang; +Cc: gcc-patches

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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH, ARM] soft/hard-float preprocessor symbol
  2010-07-23 21:47 ` Richard Earnshaw
@ 2010-07-26  5:01   ` Chung-Lin Tang
  2010-07-27 16:35     ` Richard Earnshaw
  0 siblings, 1 reply; 6+ messages in thread
From: Chung-Lin Tang @ 2010-07-26  5:01 UTC (permalink / raw)
  To: Richard Earnshaw; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 811 bytes --]

Richard Earnshaw wrote:
> 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.
Hi Richard, I have update the patch as you have suggested.
Please see if this is okay.

Thanks,
Chung-Lin



[-- Attachment #2: pcs2.diff --]
[-- Type: text/plain, Size: 1280 bytes --]

Index: arm.c
===================================================================
--- arm.c	(revision 162525)
+++ arm.c	(working copy)
@@ -711,7 +711,7 @@
    the next function.  */
 static int after_arm_reorg = 0;
 
-static enum arm_pcs arm_pcs_default;
+enum arm_pcs arm_pcs_default;
 
 /* For an explanation of these variables, see final_prescan_insn below.  */
 int arm_ccfsm_state;
Index: arm.h
===================================================================
--- arm.h	(revision 162525)
+++ arm.h	(working copy)
@@ -94,7 +94,13 @@
 	if (arm_arch_iwmmxt)				\
 	  builtin_define ("__IWMMXT__");		\
 	if (TARGET_AAPCS_BASED)				\
-	  builtin_define ("__ARM_EABI__");		\
+	  {						\
+	    if (arm_pcs_default == ARM_PCS_AAPCS_VFP)	\
+	      builtin_define ("__ARM_PCS_VFP");		\
+	    else if (arm_pcs_default == ARM_PCS_AAPCS)	\
+	      builtin_define ("__ARM_PCS");		\
+	    builtin_define ("__ARM_EABI__");		\
+	  }						\
     } while (0)
 
 /* The various ARM cores.  */
@@ -1641,6 +1647,9 @@
   ARM_PCS_UNKNOWN
 };
 
+/* Default procedure calling standard of current compilation unit. */
+extern enum arm_pcs arm_pcs_default;
+
 /* A C type for declaring a variable that is used as the first argument of
    `FUNCTION_ARG' and other related values.  */
 typedef struct

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH, ARM] soft/hard-float preprocessor symbol
  2010-07-26  5:01   ` Chung-Lin Tang
@ 2010-07-27 16:35     ` Richard Earnshaw
  2010-07-28 15:49       ` Chung-Lin Tang
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Earnshaw @ 2010-07-27 16:35 UTC (permalink / raw)
  To: Chung-Lin Tang; +Cc: gcc-patches


On Mon, 2010-07-26 at 13:01 +0800, Chung-Lin Tang wrote:
> Richard Earnshaw wrote:
> > 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.
> Hi Richard, I have update the patch as you have suggested.
> Please see if this is okay.

This is OK, but it needs an updated changelog entry (covering the
changes to arm.c as well).

R.

> 
> Thanks,
> Chung-Lin
> 
> 
> plain text document attachment (pcs2.diff)
> Index: arm.c
> ===================================================================
> --- arm.c	(revision 162525)
> +++ arm.c	(working copy)
> @@ -711,7 +711,7 @@
>     the next function.  */
>  static int after_arm_reorg = 0;
>  
> -static enum arm_pcs arm_pcs_default;
> +enum arm_pcs arm_pcs_default;
>  
>  /* For an explanation of these variables, see final_prescan_insn below.  */
>  int arm_ccfsm_state;
> Index: arm.h
> ===================================================================
> --- arm.h	(revision 162525)
> +++ arm.h	(working copy)
> @@ -94,7 +94,13 @@
>  	if (arm_arch_iwmmxt)				\
>  	  builtin_define ("__IWMMXT__");		\
>  	if (TARGET_AAPCS_BASED)				\
> -	  builtin_define ("__ARM_EABI__");		\
> +	  {						\
> +	    if (arm_pcs_default == ARM_PCS_AAPCS_VFP)	\
> +	      builtin_define ("__ARM_PCS_VFP");		\
> +	    else if (arm_pcs_default == ARM_PCS_AAPCS)	\
> +	      builtin_define ("__ARM_PCS");		\
> +	    builtin_define ("__ARM_EABI__");		\
> +	  }						\
>      } while (0)
>  
>  /* The various ARM cores.  */
> @@ -1641,6 +1647,9 @@
>    ARM_PCS_UNKNOWN
>  };
>  
> +/* Default procedure calling standard of current compilation unit. */
> +extern enum arm_pcs arm_pcs_default;
> +
>  /* A C type for declaring a variable that is used as the first argument of
>     `FUNCTION_ARG' and other related values.  */
>  typedef struct

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH, ARM] soft/hard-float preprocessor symbol
  2010-07-27 16:35     ` Richard Earnshaw
@ 2010-07-28 15:49       ` Chung-Lin Tang
  0 siblings, 0 replies; 6+ messages in thread
From: Chung-Lin Tang @ 2010-07-28 15:49 UTC (permalink / raw)
  To: Richard Earnshaw; +Cc: gcc-patches

Richard Earnshaw wrote:
> This is OK, but it needs an updated changelog entry (covering the
> changes to arm.c as well).
>
> R.
Patch committed, here's the updated ChangeLog entry:
        * config/arm/arm.c (arm_pcs_default): Remove static.
        * config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __ARM_PCS or
        __ARM_PCS_VFP to indicate soft/hard-float calling convention.
        (arm_pcs_default): Declare.

Thanks,
Chung-Lin

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-07-28 15:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-21 16:06 [PATCH, ARM] soft/hard-float preprocessor symbol Chung-Lin Tang
2010-07-22 22:32 ` Mark Mitchell
2010-07-23 21:47 ` Richard Earnshaw
2010-07-26  5:01   ` Chung-Lin Tang
2010-07-27 16:35     ` Richard Earnshaw
2010-07-28 15:49       ` Chung-Lin Tang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).