Commit 77ccdfed by Eric Christopher Committed by Eric Christopher

rs6000.c (TARGET_MS_BITFIELD_LAYOUT_P): Define.

2006-04-04  Eric Christopher  <echristo@apple.com>

        * config/rs6000/rs6000.c (TARGET_MS_BITFIELD_LAYOUT_P): Define.
        (TARGET_USE_MS_BITFIELD_LAYOUT): Ditto.
        (rs6000_handle_struct_attribute): New.
        (rs6000_ms_bitfield_layout_p): Ditto.

From-SVN: r112693
parent b3c2c547
2006-04-04 Eric Christopher <echristo@apple.com>
* config/rs6000/rs6000.c (TARGET_MS_BITFIELD_LAYOUT_P): Define.
(TARGET_USE_MS_BITFIELD_LAYOUT): Ditto.
(rs6000_handle_struct_attribute): New.
(rs6000_ms_bitfield_layout_p): Ditto.
2006-04-04 Geoffrey Keating <geoffk@apple.com> 2006-04-04 Geoffrey Keating <geoffk@apple.com>
* config/darwin-crt3.c (atexit): Pass &__dso_handle rather than * config/darwin-crt3.c (atexit): Pass &__dso_handle rather than
......
...@@ -602,6 +602,8 @@ static void rs6000_assemble_visibility (tree, int); ...@@ -602,6 +602,8 @@ static void rs6000_assemble_visibility (tree, int);
static int rs6000_ra_ever_killed (void); static int rs6000_ra_ever_killed (void);
static tree rs6000_handle_longcall_attribute (tree *, tree, tree, int, bool *); static tree rs6000_handle_longcall_attribute (tree *, tree, tree, int, bool *);
static tree rs6000_handle_altivec_attribute (tree *, tree, tree, int, bool *); static tree rs6000_handle_altivec_attribute (tree *, tree, tree, int, bool *);
static bool rs6000_ms_bitfield_layout_p (tree);
static tree rs6000_handle_struct_attribute (tree *, tree, tree, int, bool *);
static void rs6000_eliminate_indexed_memrefs (rtx operands[2]); static void rs6000_eliminate_indexed_memrefs (rtx operands[2]);
static const char *rs6000_mangle_fundamental_type (tree); static const char *rs6000_mangle_fundamental_type (tree);
extern const struct attribute_spec rs6000_attribute_table[]; extern const struct attribute_spec rs6000_attribute_table[];
...@@ -932,6 +934,9 @@ static const char alt_reg_names[][8] = ...@@ -932,6 +934,9 @@ static const char alt_reg_names[][8] =
#define TARGET_BINDS_LOCAL_P darwin_binds_local_p #define TARGET_BINDS_LOCAL_P darwin_binds_local_p
#endif #endif
#undef TARGET_MS_BITFIELD_LAYOUT_P
#define TARGET_MS_BITFIELD_LAYOUT_P rs6000_ms_bitfield_layout_p
#undef TARGET_ASM_OUTPUT_MI_THUNK #undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK rs6000_output_mi_thunk #define TARGET_ASM_OUTPUT_MI_THUNK rs6000_output_mi_thunk
...@@ -2104,7 +2109,7 @@ num_insns_constant (rtx op, enum machine_mode mode) ...@@ -2104,7 +2109,7 @@ num_insns_constant (rtx op, enum machine_mode mode)
} }
/* Return true if OP can be synthesized with a particular vspltisb, vspltish /* Return true if OP can be synthesized with a particular vspltisb, vspltish
or vspltisw instruction. OP is a CONST_VECTOR. Which instruction is used or vspltisw instruction. OP is a CONST_VECTOR. Which instruction is used
depends on STEP and COPIES, one of which will be 1. If COPIES > 1, depends on STEP and COPIES, one of which will be 1. If COPIES > 1,
all items are set to the same value and contain COPIES replicas of the all items are set to the same value and contain COPIES replicas of the
...@@ -2171,7 +2176,7 @@ vspltis_constant (rtx op, unsigned step, unsigned copies) ...@@ -2171,7 +2176,7 @@ vspltis_constant (rtx op, unsigned step, unsigned copies)
} }
/* Return true if OP is of the given MODE and can be synthesized /* Return true if OP is of the given MODE and can be synthesized
with a vspltisb, vspltish or vspltisw. */ with a vspltisb, vspltish or vspltisw. */
bool bool
...@@ -17349,6 +17354,8 @@ const struct attribute_spec rs6000_attribute_table[] = ...@@ -17349,6 +17354,8 @@ const struct attribute_spec rs6000_attribute_table[] =
{ "altivec", 1, 1, false, true, false, rs6000_handle_altivec_attribute }, { "altivec", 1, 1, false, true, false, rs6000_handle_altivec_attribute },
{ "longcall", 0, 0, false, true, true, rs6000_handle_longcall_attribute }, { "longcall", 0, 0, false, true, true, rs6000_handle_longcall_attribute },
{ "shortcall", 0, 0, false, true, true, rs6000_handle_longcall_attribute }, { "shortcall", 0, 0, false, true, true, rs6000_handle_longcall_attribute },
{ "ms_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute },
{ "gcc_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute },
#ifdef SUBTARGET_ATTRIBUTE_TABLE #ifdef SUBTARGET_ATTRIBUTE_TABLE
SUBTARGET_ATTRIBUTE_TABLE, SUBTARGET_ATTRIBUTE_TABLE,
#endif #endif
...@@ -17547,6 +17554,54 @@ rs6000_longcall_ref (rtx call_ref) ...@@ -17547,6 +17554,54 @@ rs6000_longcall_ref (rtx call_ref)
return force_reg (Pmode, call_ref); return force_reg (Pmode, call_ref);
} }
#ifndef TARGET_USE_MS_BITFIELD_LAYOUT
#define TARGET_USE_MS_BITFIELD_LAYOUT 0
#endif
/* Handle a "ms_struct" or "gcc_struct" attribute; arguments as in
struct attribute_spec.handler. */
static tree
rs6000_handle_struct_attribute (tree *node, tree name,
tree args ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
tree *type = NULL;
if (DECL_P (*node))
{
if (TREE_CODE (*node) == TYPE_DECL)
type = &TREE_TYPE (*node);
}
else
type = node;
if (!(type && (TREE_CODE (*type) == RECORD_TYPE
|| TREE_CODE (*type) == UNION_TYPE)))
{
warning (OPT_Wattributes, "%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
else if ((is_attribute_p ("ms_struct", name)
&& lookup_attribute ("gcc_struct", TYPE_ATTRIBUTES (*type)))
|| ((is_attribute_p ("gcc_struct", name)
&& lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (*type)))))
{
warning (OPT_Wattributes, "%qs incompatible attribute ignored",
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
return NULL_TREE;
}
static bool
rs6000_ms_bitfield_layout_p (tree record_type)
{
return (TARGET_USE_MS_BITFIELD_LAYOUT &&
!lookup_attribute ("gcc_struct", TYPE_ATTRIBUTES (record_type)))
|| lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (record_type));
}
#ifdef USING_ELFOS_H #ifdef USING_ELFOS_H
/* A get_unnamed_section callback, used for switching to toc_section. */ /* A get_unnamed_section callback, used for switching to toc_section. */
......
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