summaryrefslogtreecommitdiff
path: root/gcc/genmodes.c
diff options
context:
space:
mode:
authordj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-01 00:20:13 +0000
committerdj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-01 00:20:13 +0000
commit0663398065295b8b03266c3f4a1df130d6bdf712 (patch)
treead8920def875a4093b66cd5ff53f14ecb758f32a /gcc/genmodes.c
parent58f70b5c59a190feb5fb0b1beb8ee9b6dad292ef (diff)
downloadgcc-0663398065295b8b03266c3f4a1df130d6bdf712.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100414 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genmodes.c')
-rw-r--r--gcc/genmodes.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/gcc/genmodes.c b/gcc/genmodes.c
index 6e282f36dd9..74c71c94658 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