diff options
author | Jan Hubicka <jh@suse.cz> | 2003-02-28 11:11:47 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2003-02-28 10:11:47 +0000 |
commit | 10a3fdd92639518f67976f894a58df753f6eb858 (patch) | |
tree | 90126b3c24f149851de417e946284822a2bf0b58 /gcc/regclass.c | |
parent | e459243b87904cd66d4bb85892eb831d9e006c2c (diff) | |
download | gcc-10a3fdd92639518f67976f894a58df753f6eb858.tar.gz |
combine.c (gen_lowpart_for_combine): Update handling of subregs_of_mode
* 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.
From-SVN: r63552
Diffstat (limited to 'gcc/regclass.c')
-rw-r--r-- | gcc/regclass.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/gcc/regclass.c b/gcc/regclass.c index abbd6eabe3d..01c08f3a078 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -232,9 +232,9 @@ static char *in_inc_dec; #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. */ @@ -2638,16 +2638,18 @@ cannot_change_mode_set_regs (used, from, regno) 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 @@ -2660,11 +2662,16 @@ invalid_mode_change_p (regno, class, from_mode) 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 */ |