Commit 3d9cd79a by Ulrich Weigand Committed by Ben Elliston

spu.c (TARGET_ENCODE_SECTION_INFO): Define.

	* config/spu/spu.c (TARGET_ENCODE_SECTION_INFO): Define.
	(spu_encode_section_info): New.
	* config/spu/spu.h (ALIGNED_SYMBOL_REF_P): Adjust.
	(SYMBOL_FLAG_ALIGN1): New.

From-SVN: r119803
parent 1f70491b
2006-12-13 Ulrich Weigand <uweigand@de.ibm.com>
* config/spu/spu.c (TARGET_ENCODE_SECTION_INFO): Define.
(spu_encode_section_info): New.
* config/spu/spu.h (ALIGNED_SYMBOL_REF_P): Adjust.
(SYMBOL_FLAG_ALIGN1): New.
2006-12-12 Andrew Pinski <andrew_pinski@playstation.sony.com> 2006-12-12 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR tree-opt/28624 PR tree-opt/28624
......
...@@ -129,6 +129,7 @@ static unsigned char spu_function_ok_for_sibcall (tree decl, tree exp); ...@@ -129,6 +129,7 @@ static unsigned char spu_function_ok_for_sibcall (tree decl, tree exp);
static void spu_init_libfuncs (void); static void spu_init_libfuncs (void);
static bool spu_return_in_memory (tree type, tree fntype); static bool spu_return_in_memory (tree type, tree fntype);
static void fix_range (const char *); static void fix_range (const char *);
static void spu_encode_section_info (tree, rtx, int);
extern const char *reg_names[]; extern const char *reg_names[];
rtx spu_compare_op0, spu_compare_op1; rtx spu_compare_op0, spu_compare_op1;
...@@ -244,6 +245,9 @@ const struct attribute_spec spu_attribute_table[]; ...@@ -244,6 +245,9 @@ const struct attribute_spec spu_attribute_table[];
#undef TARGET_RETURN_IN_MEMORY #undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY spu_return_in_memory #define TARGET_RETURN_IN_MEMORY spu_return_in_memory
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO spu_encode_section_info
struct gcc_target targetm = TARGET_INITIALIZER; struct gcc_target targetm = TARGET_INITIALIZER;
/* Sometimes certain combinations of command options do not make sense /* Sometimes certain combinations of command options do not make sense
...@@ -3178,6 +3182,20 @@ aligned_mem_p (rtx mem) ...@@ -3178,6 +3182,20 @@ aligned_mem_p (rtx mem)
return 0; return 0;
} }
/* Encode symbol attributes (local vs. global, tls model) of a SYMBOL_REF
into its SYMBOL_REF_FLAGS. */
static void
spu_encode_section_info (tree decl, rtx rtl, int first)
{
default_encode_section_info (decl, rtl, first);
/* If a variable has a forced alignment to < 16 bytes, mark it with
SYMBOL_FLAG_ALIGN1. */
if (TREE_CODE (decl) == VAR_DECL
&& DECL_USER_ALIGN (decl) && DECL_ALIGN (decl) < 128)
SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_ALIGN1;
}
/* Return TRUE if we are certain the mem refers to a complete object /* Return TRUE if we are certain the mem refers to a complete object
which is both 16-byte aligned and padded to a 16-byte boundary. This which is both 16-byte aligned and padded to a 16-byte boundary. This
would make it safe to store with a single instruction. would make it safe to store with a single instruction.
......
...@@ -87,6 +87,7 @@ extern const char *spu_fixed_range_string; ...@@ -87,6 +87,7 @@ extern const char *spu_fixed_range_string;
/* symbol_ref's of functions are not aligned to 16 byte boundary. */ /* symbol_ref's of functions are not aligned to 16 byte boundary. */
#define ALIGNED_SYMBOL_REF_P(X) \ #define ALIGNED_SYMBOL_REF_P(X) \
(GET_CODE (X) == SYMBOL_REF \ (GET_CODE (X) == SYMBOL_REF \
&& (SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_ALIGN1) == 0 \
&& (! SYMBOL_REF_FUNCTION_P (X) \ && (! SYMBOL_REF_FUNCTION_P (X) \
|| align_functions >= 16)) || align_functions >= 16))
...@@ -373,6 +374,9 @@ warn_main = 0; \ ...@@ -373,6 +374,9 @@ warn_main = 0; \
#define FUNCTION_VALUE_REGNO_P(N) ((N) >= (FIRST_RETURN_REGNUM) && (N) <= (LAST_RETURN_REGNUM)) #define FUNCTION_VALUE_REGNO_P(N) ((N) >= (FIRST_RETURN_REGNUM) && (N) <= (LAST_RETURN_REGNUM))
/* Machine-specific symbol_ref flags. */
#define SYMBOL_FLAG_ALIGN1 (SYMBOL_FLAG_MACH_DEP << 0)
/* Aggregate Return */ /* Aggregate Return */
#define DEFAULT_PCC_STRUCT_RETURN 0 #define DEFAULT_PCC_STRUCT_RETURN 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment