summaryrefslogtreecommitdiff
path: root/gcc/genmodes.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2011-12-10 12:42:55 -0800
committerRichard Henderson <rth@gcc.gnu.org>2011-12-10 12:42:55 -0800
commita7de2c2a71940a25408c1320498c1c1ca2472313 (patch)
tree914df35ba46de67da8ba88eabaff049134debfe9 /gcc/genmodes.c
parentbe94c03412ea6b8613033c2e0fd07e628ef7b4af (diff)
downloadgcc-a7de2c2a71940a25408c1320498c1c1ca2472313.tar.gz
Let GET_MODE_2XWIDER_MODE find a double-width vector mode.
* genmodes.c (struct mode_data): Remove wider_2x member. (blank_mode): Adjust initializer. (calc_wider_mode): Use XALLOCAVEC. (emit_move_wider): Select double-width same-element vectors for 2xwider vectors. * machmode.h (GET_MODE_2XWIDER_MODE): Update documentation. * config/i386/i386.c (doublesize_vector_mode): Remove. (expand_vselect_vconcat): Use GET_MODE_2XWIDER_MODE instead. From-SVN: r182191
Diffstat (limited to 'gcc/genmodes.c')
-rw-r--r--gcc/genmodes.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/gcc/genmodes.c b/gcc/genmodes.c
index dae7e38ebdb..8b6f5bce96b 100644
--- a/gcc/genmodes.c
+++ b/gcc/genmodes.c
@@ -63,7 +63,6 @@ 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. */
@@ -83,7 +82,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, 0, 0, 0
};
@@ -790,7 +789,7 @@ calc_wider_mode (void)
/* Allocate max_n_modes + 1 entries to leave room for the extra null
pointer assigned after the qsort call below. */
- sortbuf = (struct mode_data **) alloca ((max_n_modes + 1) * sizeof (struct mode_data *));
+ sortbuf = XALLOCAVEC (struct mode_data *, max_n_modes + 1);
for (c = 0; c < MAX_MODE_CLASS; c++)
{
@@ -804,7 +803,6 @@ 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;
@@ -827,7 +825,6 @@ calc_wider_mode (void)
for (j = 0; j < i; j++)
sortbuf[j]->next = sortbuf[j]->wider = sortbuf[j + 1];
-
modes[c] = sortbuf[0];
}
}
@@ -1062,6 +1059,21 @@ emit_mode_wider (void)
continue;
}
+ /* For vectors we want twice the number of components,
+ with the same element type. */
+ if (m->cl == MODE_VECTOR_INT
+ || m->cl == MODE_VECTOR_FLOAT
+ || m->cl == MODE_VECTOR_FRACT
+ || m->cl == MODE_VECTOR_UFRACT
+ || m->cl == MODE_VECTOR_ACCUM
+ || m->cl == MODE_VECTOR_UACCUM)
+ {
+ if (m2->ncomponents != 2 * m->ncomponents)
+ continue;
+ if (m->component != m2->component)
+ continue;
+ }
+
break;
}
if (m2 == void_mode)