+Fri Feb 28 11:09:14 CET 2003 Jan Hubicka <jh@suse.cz>
+
+ * combine.c (gen_lowpart_for_combine): Update handling of
+ subregs_of_mode
+ * flow.c (life_analysis, mark_used_regs): Likewise.
+ * regclass.c (subregs_of_mode): Turn into single bitmap.
+ (cannot_change-mode_set_regs, invalid_mode_change_p): Update
+ dealing with subregs_of_mode
+ * regs.h (subregs_of_mode): Update prototype.
+
2003-02-28 Josef Zlomek <zlomekj@suse.cz>
* emit-rtl.c (set_reg_attrs_for_parm): New function.
&& GET_CODE (result) == SUBREG
&& GET_CODE (SUBREG_REG (result)) == REG
&& REGNO (SUBREG_REG (result)) >= FIRST_PSEUDO_REGISTER)
- SET_REGNO_REG_SET (&subregs_of_mode[GET_MODE (result)],
- REGNO (SUBREG_REG (result)));
+ bitmap_set_bit (&subregs_of_mode, REGNO (SUBREG_REG (result))
+ * MAX_MACHINE_MODE
+ + GET_MODE (result));
#endif
if (result)
#ifdef CANNOT_CHANGE_MODE_CLASS
if (flags & PROP_REG_INFO)
- {
- int j;
- for (j=0; j < NUM_MACHINE_MODES; ++j)
- INIT_REG_SET (&subregs_of_mode[j]);
- }
+ bitmap_initialize (&subregs_of_mode, 1);
#endif
if (! optimize)
#ifdef CANNOT_CHANGE_MODE_CLASS
if (GET_CODE (SUBREG_REG (x)) == REG
&& REGNO (SUBREG_REG (x)) >= FIRST_PSEUDO_REGISTER)
- SET_REGNO_REG_SET (&subregs_of_mode[GET_MODE (x)],
- REGNO (SUBREG_REG (x)));
+ bitmap_set_bit (&subregs_of_mode, REGNO (SUBREG_REG (x))
+ * MAX_MACHINE_MODE
+ + GET_MODE (x));
#endif
/* While we're here, optimize this case. */
if (GET_CODE (testreg) == SUBREG
&& GET_CODE (SUBREG_REG (testreg)) == REG
&& REGNO (SUBREG_REG (testreg)) >= FIRST_PSEUDO_REGISTER)
- SET_REGNO_REG_SET (&subregs_of_mode[GET_MODE (testreg)],
- REGNO (SUBREG_REG (testreg)));
+ bitmap_set_bit (&subregs_of_mode, REGNO (SUBREG_REG (testreg))
+ * MAX_MACHINE_MODE
+ + GET_MODE (testreg));
#endif
/* Modifying a single register in an alternate mode
/* Clean up previous run. */
stack_regs_mentioned_data = 0;
- if (!optimize)
- split_all_insns (0);
-
/* See if there is something to do. Flow analysis is quite
expensive so we might save some compilation time. */
for (i = FIRST_STACK_REG; i <= LAST_STACK_REG; i++)
#endif /* FORBIDDEN_INC_DEC_CLASSES */
#ifdef CANNOT_CHANGE_MODE_CLASS
-/* All registers that have been subreged. Indexed by mode, where each
- entry is a regset of registers. */
-regset_head subregs_of_mode [NUM_MACHINE_MODES];
+/* All registers that have been subreged. Indexed by regno * MAX_MACHINE_MODE
+ + mode. */
+bitmap_head subregs_of_mode;
#endif
/* Sample MEM values for use by memory_move_secondary_cost. */
unsigned int regno;
{
enum machine_mode to;
+ int n, i;
+ int start = regno * MAX_MACHINE_MODE;
- for (to = VOIDmode; to < MAX_MACHINE_MODE; ++to)
- if (REGNO_REG_SET_P (&subregs_of_mode[to], regno))
- {
- int i;
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (! TEST_HARD_REG_BIT (*used, i)
- && REG_CANNOT_CHANGE_MODE_P (i, from, to))
- SET_HARD_REG_BIT (*used, i);
- }
+ EXECUTE_IF_SET_IN_BITMAP (&subregs_of_mode, start, n,
+ if (n >= MAX_MACHINE_MODE + start)
+ return;
+ to = n - start;
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (! TEST_HARD_REG_BIT (*used, i)
+ && REG_CANNOT_CHANGE_MODE_P (i, from, to))
+ SET_HARD_REG_BIT (*used, i);
+ );
}
/* Return 1 if REGNO has had an invalid mode change in CLASS from FROM
enum machine_mode from_mode;
{
enum machine_mode to_mode;
-
- for (to_mode = 0; to_mode < NUM_MACHINE_MODES; ++to_mode)
- if (REGNO_REG_SET_P (&subregs_of_mode[(int) to_mode], regno)
- && CANNOT_CHANGE_MODE_CLASS (from_mode, to_mode, class))
+ int n;
+ int start = regno * MAX_MACHINE_MODE;
+
+ EXECUTE_IF_SET_IN_BITMAP (&subregs_of_mode, start, n,
+ if (n >= MAX_MACHINE_MODE + start)
+ return 0;
+ to_mode = n - start;
+ if (CANNOT_CHANGE_MODE_CLASS (from_mode, to_mode, class))
return 1;
+ );
return 0;
}
#endif /* CANNOT_CHANGE_MODE_CLASS */
extern varray_type reg_n_info;
-extern regset_head subregs_of_mode [NUM_MACHINE_MODES];
+extern bitmap_head subregs_of_mode;
/* Indexed by n, gives number of times (REG n) is used or set. */
#endif
/* If optimizing, then go ahead and split insns now. */
+#ifndef STACK_REGS
if (optimize > 0)
+#endif
split_all_insns (0);
cleanup_cfg (optimize ? CLEANUP_EXPENSIVE : 0);
close_dump_file (DFI_ce3, print_rtl_with_bb, insns);
timevar_pop (TV_IFCVT2);
}
-#ifdef STACK_REGS
- if (optimize)
- split_all_insns (1);
-#endif
#ifdef INSN_SCHEDULING
if (optimize > 0 && flag_schedule_insns_after_reload)