diff options
author | Anatoly Sokolov <aesok@post.ru> | 2011-08-03 22:03:04 +0400 |
---|---|---|
committer | Anatoly Sokolov <aesok@gcc.gnu.org> | 2011-08-03 22:03:04 +0400 |
commit | 35bdbc6962988219faf2c7bf2a0dabd3d8657adb (patch) | |
tree | c5e5b886196ec6b0e63a26f8d56c271be88dc87b /gcc/config/m32c/m32c.c | |
parent | 41ba34dbe7e8494254b524e8e31e394a1e6c6585 (diff) | |
download | gcc-35bdbc6962988219faf2c7bf2a0dabd3d8657adb.zip gcc-35bdbc6962988219faf2c7bf2a0dabd3d8657adb.tar.gz gcc-35bdbc6962988219faf2c7bf2a0dabd3d8657adb.tar.bz2 |
m32c.c (class_sizes): Remove.
* config/m32c/m32c.c (class_sizes): Remove.
(reduce_class): Change arguments and return type to reg_class_t.
Change type cc var to HARD_REG_SET. Change type best var to
reg_class_t. Change type best_size var to unsigned int. Remove
initialization class_sizes var. Use reg_class_size array instead
of class_sizes. Use reg_class_contents array instead
of class_contents.
From-SVN: r177290
Diffstat (limited to 'gcc/config/m32c/m32c.c')
-rw-r--r-- | gcc/config/m32c/m32c.c | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 4ae7228..4aeeb3d 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -318,44 +318,31 @@ reg_push_size (int regno) } } -static int *class_sizes = 0; - /* Given two register classes, find the largest intersection between them. If there is no intersection, return RETURNED_IF_EMPTY instead. */ -static int -reduce_class (int original_class, int limiting_class, int returned_if_empty) +static reg_class_t +reduce_class (reg_class_t original_class, reg_class_t limiting_class, + reg_class_t returned_if_empty) { - int cc = class_contents[original_class][0]; - int i, best = NO_REGS; - int best_size = 0; + HARD_REG_SET cc; + int i; + reg_class_t best = NO_REGS; + unsigned int best_size = 0; if (original_class == limiting_class) return original_class; - if (!class_sizes) - { - int r; - class_sizes = (int *) xmalloc (LIM_REG_CLASSES * sizeof (int)); - for (i = 0; i < LIM_REG_CLASSES; i++) - { - class_sizes[i] = 0; - for (r = 0; r < FIRST_PSEUDO_REGISTER; r++) - if (class_contents[i][0] & (1 << r)) - class_sizes[i]++; - } - } + cc = reg_class_contents[original_class]; + AND_HARD_REG_SET (cc, reg_class_contents[limiting_class]); - cc &= class_contents[limiting_class][0]; for (i = 0; i < LIM_REG_CLASSES; i++) { - int ic = class_contents[i][0]; - - if ((~cc & ic) == 0) - if (best_size < class_sizes[i]) + if (hard_reg_set_subset_p (reg_class_contents[i], cc)) + if (best_size < reg_class_size[i]) { - best = i; - best_size = class_sizes[i]; + best = (reg_class_t) i; + best_size = reg_class_size[i]; } } |