diff options
author | Richard Henderson <rth@redhat.com> | 2002-02-20 13:57:23 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-02-20 13:57:23 -0800 |
commit | 59bef1891833dd26e5820047c87f9b1d6b115ee9 (patch) | |
tree | 6d2a14cdcfe337cb01f96718208b12d5bcfbf6af /gcc | |
parent | 9338ffe610bc23fd9d31bd22a83cb5fdadd05d0a (diff) | |
download | gcc-59bef1891833dd26e5820047c87f9b1d6b115ee9.zip gcc-59bef1891833dd26e5820047c87f9b1d6b115ee9.tar.gz gcc-59bef1891833dd26e5820047c87f9b1d6b115ee9.tar.bz2 |
i386.c (ix86_expand_vector_move): Use the mode of the operand, rather than assuming TImode.
* config/i386/i386.c (ix86_expand_vector_move): Use the mode
of the operand, rather than assuming TImode.
(ix86_expand_binop_builtin): Cope with commutative patterns
using nonimmediate_operand for both operands.
(ix86_expand_timode_binop_builtin): Likewise.
(ix86_expand_store_builtin): Validate operand 1.
(ix86_expand_unop1_builtin): Likewise.
From-SVN: r49912
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 28 |
2 files changed, 34 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8f4d599..bbcf0f1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2002-02-20 Richard Henderson <rth@redhat.com> + + * config/i386/i386.c (ix86_expand_vector_move): Use the mode + of the operand, rather than assuming TImode. + (ix86_expand_binop_builtin): Cope with commutative patterns + using nonimmediate_operand for both operands. + (ix86_expand_timode_binop_builtin): Likewise. + (ix86_expand_store_builtin): Validate operand 1. + (ix86_expand_unop1_builtin): Likewise. + 2002-02-20 Philip Blundell <philb@gnu.org> PR 5705 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index ccaf1e3..fd84c07 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6732,7 +6732,7 @@ ix86_expand_vector_move (mode, operands) && !register_operand (operands[1], mode) && operands[1] != CONST0_RTX (mode)) { - rtx temp = force_reg (TImode, operands[1]); + rtx temp = force_reg (GET_MODE (operands[1]), operands[1]); emit_move_insn (operands[0], temp); return; } @@ -11363,6 +11363,12 @@ ix86_expand_binop_builtin (icode, arglist, target) if (! (*insn_data[icode].operand[2].predicate) (op1, mode1)) op1 = copy_to_mode_reg (mode1, op1); + /* In the commutative cases, both op0 and op1 are nonimmediate_operand, + yet one of the two must not be a memory. This is normally enforced + by expanders, but we didn't bother to create one here. */ + if (GET_CODE (op0) == MEM && GET_CODE (op1) == MEM) + op0 = copy_to_mode_reg (mode0, op0); + pat = GEN_FCN (icode) (target, op0, op1); if (! pat) return 0; @@ -11395,6 +11401,12 @@ ix86_expand_timode_binop_builtin (icode, arglist, target) if (! (*insn_data[icode].operand[2].predicate) (op1, TImode)) op1 = copy_to_mode_reg (TImode, op1); + /* In the commutative cases, both op0 and op1 are nonimmediate_operand, + yet one of the two must not be a memory. This is normally enforced + by expanders, but we didn't bother to create one here. */ + if (GET_CODE (op0) == MEM && GET_CODE (op1) == MEM) + op0 = copy_to_mode_reg (TImode, op0); + pat = GEN_FCN (icode) (target, op0, op1); if (! pat) return 0; @@ -11422,6 +11434,10 @@ ix86_expand_store_builtin (icode, arglist) op1 = safe_vector_operand (op1, mode1); op0 = gen_rtx_MEM (mode0, copy_to_mode_reg (Pmode, op0)); + + if (! (*insn_data[icode].operand[1].predicate) (op1, mode1)) + op1 = copy_to_mode_reg (mode1, op1); + pat = GEN_FCN (icode) (op0, op1); if (pat) emit_insn (pat); @@ -11476,7 +11492,7 @@ ix86_expand_unop1_builtin (icode, arglist, target) { rtx pat; tree arg0 = TREE_VALUE (arglist); - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); + rtx op1, op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); enum machine_mode tmode = insn_data[icode].operand[0].mode; enum machine_mode mode0 = insn_data[icode].operand[1].mode; @@ -11490,8 +11506,12 @@ ix86_expand_unop1_builtin (icode, arglist, target) if (! (*insn_data[icode].operand[1].predicate) (op0, mode0)) op0 = copy_to_mode_reg (mode0, op0); - - pat = GEN_FCN (icode) (target, op0, op0); + + op1 = op0; + if (! (*insn_data[icode].operand[2].predicate) (op1, mode0)) + op1 = copy_to_mode_reg (mode0, op1); + + pat = GEN_FCN (icode) (target, op0, op1); if (! pat) return 0; emit_insn (pat); |