@@ -200,7 +200,7 @@ struct reg_stat_type {
unsigned HOST_WIDE_INT last_set_nonzero_bits;
char last_set_sign_bit_copies;
- ENUM_BITFIELD(machine_mode) last_set_mode : 8;
+ ENUM_BITFIELD(machine_mode) last_set_mode : MACHINE_MODE_BITSIZE;
/* Set nonzero if references to register n in expressions should not be
used. last_set_invalid is set nonzero when this register is being
@@ -235,7 +235,7 @@ struct reg_stat_type {
truncation if we know that value already contains a truncated
value. */
- ENUM_BITFIELD(machine_mode) truncated_to_mode : 8;
+ ENUM_BITFIELD(machine_mode) truncated_to_mode : MACHINE_MODE_BITSIZE;
};
@@ -248,10 +248,8 @@ struct qty_table_elem
rtx comparison_const;
int comparison_qty;
unsigned int first_reg, last_reg;
- /* The sizes of these fields should match the sizes of the
- code and mode fields of struct rtx_def (see rtl.h). */
- ENUM_BITFIELD(rtx_code) comparison_code : 16;
- ENUM_BITFIELD(machine_mode) mode : 8;
+ ENUM_BITFIELD(machine_mode) mode : MACHINE_MODE_BITSIZE;
+ ENUM_BITFIELD(rtx_code) comparison_code : RTX_CODE_BITSIZE;
};
/* The table of all qtys, indexed by qty number. */
@@ -404,9 +402,7 @@ struct table_elt
struct table_elt *related_value;
int cost;
int regcost;
- /* The size of this field should match the size
- of the mode field of struct rtx_def (see rtl.h). */
- ENUM_BITFIELD(machine_mode) mode : 8;
+ ENUM_BITFIELD(machine_mode) mode : MACHINE_MODE_BITSIZE;
char in_memory;
char is_const;
char flag;
@@ -4152,10 +4148,8 @@ struct set
/* Nonzero if the SET_SRC contains something
whose value cannot be predicted and understood. */
char src_volatile;
- /* Original machine mode, in case it becomes a CONST_INT.
- The size of this field should match the size of the mode
- field of struct rtx_def (see rtl.h). */
- ENUM_BITFIELD(machine_mode) mode : 8;
+ /* Original machine mode, in case it becomes a CONST_INT. */
+ ENUM_BITFIELD(machine_mode) mode : MACHINE_MODE_BITSIZE;
/* Hash value of constant equivalent for SET_SRC. */
unsigned src_const_hash;
/* A constant equivalent for SET_SRC, if any. */
@@ -182,7 +182,8 @@ main (int argc, const char **argv)
progname = "genopinit";
- if (NUM_OPTABS > 0xffff || MAX_MACHINE_MODE >= 0xff)
+ if (NUM_OPTABS > 0xffff
+ || MAX_MACHINE_MODE >= ((1 << MACHINE_MODE_BITSIZE) - 1))
fatal ("genopinit range assumptions invalid");
if (!init_rtx_reader_args_cb (argc, argv, handle_arg))
@@ -281,13 +281,20 @@ struct ira_allocno
int regno;
/* Mode of the allocno which is the mode of the corresponding
pseudo-register. */
- ENUM_BITFIELD (machine_mode) mode : 8;
+ ENUM_BITFIELD (machine_mode) mode : MACHINE_MODE_BITSIZE;
/* Widest mode of the allocno which in at least one case could be
for paradoxical subregs where wmode > mode. */
- ENUM_BITFIELD (machine_mode) wmode : 8;
+ ENUM_BITFIELD (machine_mode) wmode : MACHINE_MODE_BITSIZE;
/* Register class which should be used for allocation for given
allocno. NO_REGS means that we should use memory. */
ENUM_BITFIELD (reg_class) aclass : 16;
+ /* Hard register assigned to given allocno. Negative value means
+ that memory was allocated to the allocno. During the reload,
+ spilled allocno has value equal to the corresponding stack slot
+ number (0, ...) - 2. Value -1 is used for allocnos spilled by the
+ reload (at this point pseudo-register has only one allocno) which
+ did not get stack slot yet. */
+ signed int hard_regno : 16;
/* A bitmask of the ABIs used by calls that occur while the allocno
is live. */
unsigned int crossed_calls_abis : NUM_ABI_IDS;
@@ -321,22 +328,6 @@ struct ira_allocno
This is only ever true for non-cap allocnos. */
unsigned int might_conflict_with_parent_p : 1;
- /* Hard register assigned to given allocno. Negative value means
- that memory was allocated to the allocno. During the reload,
- spilled allocno has value equal to the corresponding stack slot
- number (0, ...) - 2. Value -1 is used for allocnos spilled by the
- reload (at this point pseudo-register has only one allocno) which
- did not get stack slot yet. */
- signed int hard_regno : 16;
- /* Allocnos with the same regno are linked by the following member.
- Allocnos corresponding to inner loops are first in the list (it
- corresponds to depth-first traverse of the loops). */
- ira_allocno_t next_regno_allocno;
- /* There may be different allocnos with the same regno in different
- regions. Allocnos are bound to the corresponding loop tree node.
- Pseudo-register may have only one regular allocno with given loop
- tree node but more than one cap (see comments above). */
- ira_loop_tree_node_t loop_tree_node;
/* Accumulated usage references of the allocno. Here and below,
word 'accumulated' means info for given region and all nested
subregions. In this case, 'accumulated' means sum of references
@@ -362,6 +353,25 @@ struct ira_allocno
register class living at the point than number of hard-registers
of the class available for the allocation. */
int excess_pressure_points_num;
+ /* The number of objects tracked in the following array. */
+ int num_objects;
+ /* Accumulated frequency of calls which given allocno
+ intersects. */
+ int call_freq;
+ /* Accumulated number of the intersected calls. */
+ int calls_crossed_num;
+ /* The number of calls across which it is live, but which should not
+ affect register preferences. */
+ int cheap_calls_crossed_num;
+ /* Allocnos with the same regno are linked by the following member.
+ Allocnos corresponding to inner loops are first in the list (it
+ corresponds to depth-first traverse of the loops). */
+ ira_allocno_t next_regno_allocno;
+ /* There may be different allocnos with the same regno in different
+ regions. Allocnos are bound to the corresponding loop tree node.
+ Pseudo-register may have only one regular allocno with given loop
+ tree node but more than one cap (see comments above). */
+ ira_loop_tree_node_t loop_tree_node;
/* Allocno hard reg preferences. */
ira_pref_t allocno_prefs;
/* Copies to other non-conflicting allocnos. The copies can
@@ -374,21 +384,11 @@ struct ira_allocno
/* It is a link to allocno (cap) on lower loop level represented by
given cap. Null if given allocno is not a cap. */
ira_allocno_t cap_member;
- /* The number of objects tracked in the following array. */
- int num_objects;
/* An array of structures describing conflict information and live
ranges for each object associated with the allocno. There may be
more than one such object in cases where the allocno represents a
multi-word register. */
ira_object_t objects[2];
- /* Accumulated frequency of calls which given allocno
- intersects. */
- int call_freq;
- /* Accumulated number of the intersected calls. */
- int calls_crossed_num;
- /* The number of calls across which it is live, but which should not
- affect register preferences. */
- int cheap_calls_crossed_num;
/* Registers clobbered by intersected calls. */
HARD_REG_SET crossed_calls_clobbered_regs;
/* Array of usage costs (accumulated and the one updated during
@@ -242,6 +242,8 @@ extern const unsigned char mode_class[NUM_MACHINE_MODES];
|| CLASS == MODE_ACCUM \
|| CLASS == MODE_UACCUM)
+#define MACHINE_MODE_BITSIZE 16
+
/* An optional T (i.e. a T or nothing), where T is some form of mode class. */
template<typename T>
class opt_mode
@@ -564,10 +564,10 @@ enum ext_modified_kind
EXT_MODIFIED_SEXT
};
-struct ATTRIBUTE_PACKED ext_modified
+struct ext_modified
{
/* Mode from which ree has zero or sign extended the destination. */
- ENUM_BITFIELD(machine_mode) mode : 8;
+ ENUM_BITFIELD(machine_mode) mode : MACHINE_MODE_BITSIZE;
/* Kind of modification of the insn. */
ENUM_BITFIELD(ext_modified_kind) kind : 2;
@@ -254,7 +254,7 @@ private:
unsigned int m_spare : 2;
// The value returned by the accessor above.
- machine_mode m_mode : 8;
+ machine_mode m_mode : MACHINE_MODE_BITSIZE;
};
// A contiguous array of access_info pointers. Used to represent a
@@ -63,6 +63,8 @@ enum rtx_code {
# define NON_GENERATOR_NUM_RTX_CODE ((int) MATCH_OPERAND)
#endif
+#define RTX_CODE_BITSIZE 8
+
/* Register Transfer Language EXPRESSIONS CODE CLASSES */
enum rtx_class {
@@ -309,11 +311,11 @@ struct GTY((variable_size)) const_poly_int_def {
struct GTY((desc("0"), tag("0"),
chain_next ("RTX_NEXT (&%h)"),
chain_prev ("RTX_PREV (&%h)"))) rtx_def {
- /* The kind of expression this is. */
- ENUM_BITFIELD(rtx_code) code: 16;
-
/* The kind of value the expression has. */
- ENUM_BITFIELD(machine_mode) mode : 8;
+ ENUM_BITFIELD(machine_mode) mode : MACHINE_MODE_BITSIZE;
+
+ /* The kind of expression this is. */
+ ENUM_BITFIELD(rtx_code) code: RTX_CODE_BITSIZE;
/* 1 in a MEM if we should keep the alias set for this mem unchanged
when we access a component.
@@ -2164,7 +2166,7 @@ subreg_shape::operator != (const subreg_shape &other) const
inline unsigned HOST_WIDE_INT
subreg_shape::unique_id () const
{
- { STATIC_ASSERT (MAX_MACHINE_MODE <= 256); }
+ { STATIC_ASSERT (MAX_MACHINE_MODE <= (1 << MACHINE_MODE_BITSIZE)); }
{ STATIC_ASSERT (NUM_POLY_INT_COEFFS <= 3); }
{ STATIC_ASSERT (sizeof (offset.coeffs[0]) <= 2); }
int res = (int) inner_mode + ((int) outer_mode << 8);
@@ -100,7 +100,7 @@ public:
/* The mode of the reference. If IS_MULTIREG, this is the mode of
REGNO - MULTIREG_OFFSET. */
- machine_mode mode : 8;
+ machine_mode mode : MACHINE_MODE_BITSIZE;
/* If IS_MULTIREG, the offset of REGNO from the start of the register. */
unsigned int multireg_offset : 8;
@@ -1680,8 +1680,9 @@ struct GTY(()) tree_type_common {
tree attributes;
unsigned int uid;
+ ENUM_BITFIELD(machine_mode) mode : MACHINE_MODE_BITSIZE;
+
unsigned int precision : 16;
- ENUM_BITFIELD(machine_mode) mode : 8;
unsigned lang_flag_0 : 1;
unsigned lang_flag_1 : 1;
unsigned lang_flag_2 : 1;
@@ -1712,7 +1713,7 @@ struct GTY(()) tree_type_common {
unsigned empty_flag : 1;
unsigned indivisible_p : 1;
unsigned no_named_args_stdarg_p : 1;
- unsigned spare : 9;
+ unsigned spare : 1;
alias_set_type alias_set;
tree pointer_to;
@@ -1770,7 +1771,7 @@ struct GTY(()) tree_decl_common {
struct tree_decl_minimal common;
tree size;
- ENUM_BITFIELD(machine_mode) mode : 8;
+ ENUM_BITFIELD(machine_mode) mode : MACHINE_MODE_BITSIZE;
unsigned nonlocal_flag : 1;
unsigned virtual_flag : 1;
@@ -1828,7 +1829,7 @@ struct GTY(()) tree_decl_common {
/* In FIELD_DECL, this is DECL_NOT_FLEXARRAY. */
unsigned int decl_not_flexarray : 1;
- /* 13 bits unused. */
+ /* 5 bits unused. */
/* UID for points-to sets, stable over copying from inlining. */
unsigned int pt_uid;