This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, ARM] soft/hard-float preprocessor symbol
- From: Chung-Lin Tang <cltang at codesourcery dot com>
- To: Richard Earnshaw <rearnsha at arm dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 26 Jul 2010 13:01:03 +0800
- Subject: Re: [PATCH, ARM] soft/hard-float preprocessor symbol
- References: <4C471AF4.4000302@codesourcery.com> <1279921608.2191.14.camel@rwe-pc>
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
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