arm.c (arm_return_in_memory): Implement ATPCS return-in-memory rules.

* config/arm/arm.c (arm_return_in_memory): Implement ATPCS
return-in-memory rules.
* config/arm/arm.h (ARM_FLAG_ATPCS, TARGET_ATPCS): Define.

From-SVN: r56858
This commit is contained in:
Jason Thorpe 2002-09-05 17:11:47 +00:00 committed by Jason Thorpe
parent b5b620a4e8
commit dc0ba55a5b
3 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2002-09-05 Jason Thorpe <thorpej@wasabisystems.com>
* config/arm/arm.c (arm_return_in_memory): Implement ATPCS
return-in-memory rules.
* config/arm/arm.h (ARM_FLAG_ATPCS, TARGET_ATPCS): Define.
2002-09-05 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/xcoff.h (HOT_TEXT_SECTION_NAME): Delete.

View File

@ -1756,9 +1756,20 @@ int
arm_return_in_memory (type)
tree type;
{
HOST_WIDE_INT size;
if (!AGGREGATE_TYPE_P (type))
/* All simple types are returned in registers. */
return 0;
size = int_size_in_bytes (type);
if (TARGET_ATPCS)
{
/* ATPCS returns aggregate types in memory only if they are
larger than a word (or are variable size). */
return (size < 0 || size > UNITS_PER_WORD);
}
/* For the arm-wince targets we choose to be compitable with Microsoft's
ARM and Thumb compilers, which always return aggregates in memory. */
@ -1767,7 +1778,7 @@ arm_return_in_memory (type)
Also catch the case where int_size_in_bytes returns -1. In this case
the aggregate is either huge or of varaible size, and in either case
we will want to return it via memory and not in a register. */
if (((unsigned int) int_size_in_bytes (type)) > UNITS_PER_WORD)
if (size < 0 || size > UNITS_PER_WORD)
return 1;
if (TREE_CODE (type) == RECORD_TYPE)

View File

@ -373,6 +373,9 @@ Unrecognized value in TARGET_CPU_DEFAULT.
/* Nonzero means target uses VFP FP. */
#define ARM_FLAG_VFP (1 << 21)
/* Nonzero means to use ARM/Thumb Procedure Call Standard conventions. */
#define ARM_FLAG_ATPCS (1 << 22)
#define TARGET_APCS_FRAME (target_flags & ARM_FLAG_APCS_FRAME)
#define TARGET_POKE_FUNCTION_NAME (target_flags & ARM_FLAG_POKE)
#define TARGET_FPE (target_flags & ARM_FLAG_FPE)
@ -380,6 +383,7 @@ Unrecognized value in TARGET_CPU_DEFAULT.
#define TARGET_APCS_STACK (target_flags & ARM_FLAG_APCS_STACK)
#define TARGET_APCS_FLOAT (target_flags & ARM_FLAG_APCS_FLOAT)
#define TARGET_APCS_REENT (target_flags & ARM_FLAG_APCS_REENT)
#define TARGET_ATPCS (target_flags & ARM_FLAG_ATPCS)
#define TARGET_MMU_TRAPS (target_flags & ARM_FLAG_MMU_TRAPS)
#define TARGET_SOFT_FLOAT (target_flags & ARM_FLAG_SOFT_FLOAT)
#define TARGET_HARD_FLOAT (! TARGET_SOFT_FLOAT)