diff options
author | DJ Delorie <dj@redhat.com> | 2005-05-31 20:20:13 -0400 |
---|---|---|
committer | DJ Delorie <dj@gcc.gnu.org> | 2005-05-31 20:20:13 -0400 |
commit | d2348bd59174b5f3c5c492da6190f80c3f6d745b (patch) | |
tree | ad8920def875a4093b66cd5ff53f14ecb758f32a /gcc/genmodes.c | |
parent | cc2f3fa620d43b024f4cc1ea800e5246798e1f00 (diff) | |
download | gcc-d2348bd59174b5f3c5c492da6190f80c3f6d745b.zip gcc-d2348bd59174b5f3c5c492da6190f80c3f6d745b.tar.gz gcc-d2348bd59174b5f3c5c492da6190f80c3f6d745b.tar.bz2 |
expr.c (convert_move): When a partial_int requires multiple conversion steps...
* expr.c (convert_move): When a partial_int requires multiple
conversion steps, make sure successive steps convert the
intermediate value, not the original value.
* expmed.c (expand_mult): Convert partial_int multiplies to
shift/add combinations too.
* genmodes.c (mode_data): Add wider_2x.
(calc_wider_mode): Calculate twice-wider mode too.
(emit_mode_wider): Emit twice-wider mode too.
* machmode.h (mode_2xwider, GET_MODE_2XWIDER_MODE): New.
* expr.c (expand_expr_real_1): Use it for expanding
multiplies.
From-SVN: r100414
Diffstat (limited to 'gcc/genmodes.c')
-rw-r--r-- | gcc/genmodes.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/gcc/genmodes.c b/gcc/genmodes.c index 6e282f3..74c71c9 100644 --- a/gcc/genmodes.c +++ b/gcc/genmodes.c @@ -64,6 +64,7 @@ struct mode_data struct mode_data *component; /* mode of components */ struct mode_data *wider; /* next wider mode */ + struct mode_data *wider_2x; /* 2x wider mode */ struct mode_data *contained; /* Pointer to list of modes that have this mode as a component. */ @@ -80,7 +81,7 @@ static struct mode_data *void_mode; static const struct mode_data blank_mode = { 0, "<unknown>", MAX_MODE_CLASS, -1U, -1U, -1U, -1U, - 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, "<unknown>", 0 }; @@ -717,6 +718,7 @@ calc_wider_mode (void) for (prev = 0, m = modes[c]; m; m = next) { m->wider = void_mode; + m->wider_2x = void_mode; /* this is nreverse */ next = m->next; @@ -951,6 +953,39 @@ emit_mode_wider (void) m->name); print_closer (); + print_decl ("unsigned char", "mode_2xwider", "NUM_MACHINE_MODES"); + + for_all_modes (c, m) + { + struct mode_data * m2; + + for (m2 = m; + m2 && m2 != void_mode; + m2 = m2->wider) + { + if (m2->bytesize < 2 * m->bytesize) + continue; + if (m->precision != (unsigned int) -1) + { + if (m2->precision != 2 * m->precision) + continue; + } + else + { + if (m2->precision != (unsigned int) -1) + continue; + } + + break; + } + if (m2 == void_mode) + m2 = 0; + tagged_printf ("%smode", + m2 ? m2->name : void_mode->name, + m->name); + } + + print_closer (); } static void |