diff options
author | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-25 20:53:12 +0000 |
---|---|---|
committer | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-25 20:53:12 +0000 |
commit | b01136a6c3b535c6d1653fe58911a3012a588d7e (patch) | |
tree | c2db4cd8de7d2c7b7267d32f1bb7a124d815bb5a /gcc/optabs.c | |
parent | 79c2c2aa6364d7b4a17e353eff4b8b58085c468a (diff) | |
download | gcc-b01136a6c3b535c6d1653fe58911a3012a588d7e.tar.gz |
gcc:
* optabs.c (expand_vector_binop, expand_vector_unop): Don't assume
GET_MODE_UNIT_SIZE (mode) == UNITS_PER_WORD.
gcc/testsuite:
* gcc.c-torture/execute/simd-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54994 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index 61990e3eb08..d3568b2998e 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -1924,13 +1924,14 @@ expand_vector_binop (mode, binoptab, op0, op1, target, unsignedp, methods) enum optab_methods methods; { enum machine_mode submode; - int elts, i; + int elts, subsize, i; rtx t, a, b, res, seq; enum mode_class class; class = GET_MODE_CLASS (mode); submode = GET_MODE_INNER (mode); + subsize = GET_MODE_UNIT_SIZE (mode); elts = GET_MODE_NUNITS (mode); if (!target) @@ -1951,11 +1952,11 @@ expand_vector_binop (mode, binoptab, op0, op1, target, unsignedp, methods) for (i = 0; i < elts; ++i) { t = simplify_gen_subreg (submode, target, mode, - i * UNITS_PER_WORD); + i * subsize); a = simplify_gen_subreg (submode, op0, mode, - i * UNITS_PER_WORD); + i * subsize); b = simplify_gen_subreg (submode, op1, mode, - i * UNITS_PER_WORD); + i * subsize); if (binoptab->code == DIV) { @@ -1999,10 +2000,11 @@ expand_vector_unop (mode, unoptab, op0, target, unsignedp) int unsignedp; { enum machine_mode submode; - int elts, i; + int elts, subsize, i; rtx t, a, res, seq; submode = GET_MODE_INNER (mode); + subsize = GET_MODE_UNIT_SIZE (mode); elts = GET_MODE_NUNITS (mode); if (!target) @@ -2016,8 +2018,8 @@ expand_vector_unop (mode, unoptab, op0, target, unsignedp) for (i = 0; i < elts; ++i) { - t = simplify_gen_subreg (submode, target, mode, i * UNITS_PER_WORD); - a = simplify_gen_subreg (submode, op0, mode, i * UNITS_PER_WORD); + t = simplify_gen_subreg (submode, target, mode, i * subsize); + a = simplify_gen_subreg (submode, op0, mode, i * subsize); res = expand_unop (submode, unoptab, a, t, unsignedp); |