Commit cb923660 by Ken Raeburn Committed by Jeff Law

* Revamped multiply support for MIPS chips.

        * mips.c (extend_operator): New function.
        (highpart_shift_operator): Likewise.
        * mips.h: Declare new functions.
        (PREDICATE_CODES): Add support for new predicates.
        * mips.md (mulsi3 expander): Simplify.
        (mulsi_mult3): Add another constraint alternative.  Support
        3 operand multiply instructions as found on various mips
        parts.
        (mulsi3_r4650): Delete pattern, now handled by mulsi_mult3.
        (mul_acc_si): New pattern and associated splitters.
        (mulsidi3 expander): Rework to use mulsidi3_64bit and
        mulsidi3_internal.
        (umulsidi3): New expander.
        (mulsidi3_internal): Accept either sign or zero extended
        operands and generate code as appropriate appropriately.
        (mulsidi3_64bit): Similarly.
        (smulsi3_highpart): Turn into an expander and generate code
        to match new patterns.
        (umulsi3_highpart): Likewise.
        (xmulsi3_highpart_internal): New pattern.
        (maddi patterns): Delete.  Replace with:
        (mul_acc_di, mul-acc_64bit_di): New patterns.

Co-Authored-By: Jeffrey A Law <law@cygnus.com>

From-SVN: r20337
parent a1622f83
Mon Jun 8 16:54:12 1998 Ken Raeburn <raeburn@cygnus.com>
Jeff Law <law@cygnus.com>
* Revamped multiply support for MIPS chips.
* mips.c (extend_operator): New function.
(highpart_shift_operator): Likewise.
* mips.h: Declare new functions.
(PREDICATE_CODES): Add support for new predicates.
* mips.md (mulsi3 expander): Simplify.
(mulsi_mult3): Add another constraint alternative. Support
3 operand multiply instructions as found on various mips
parts.
(mulsi3_r4650): Delete pattern, now handled by mulsi_mult3.
(mul_acc_si): New pattern and associated splitters.
(mulsidi3 expander): Rework to use mulsidi3_64bit and
mulsidi3_internal.
(umulsidi3): New expander.
(mulsidi3_internal): Accept either sign or zero extended
operands and generate code as appropriate appropriately.
(mulsidi3_64bit): Similarly.
(smulsi3_highpart): Turn into an expander and generate code
to match new patterns.
(umulsi3_highpart): Likewise.
(xmulsi3_highpart_internal): New pattern.
(maddi patterns): Delete. Replace with:
(mul_acc_di, mul-acc_64bit_di): New patterns.
Mon Jun 8 14:16:15 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
* eh-common.h: Remove NEW_EH_MODEL compile time flag, and replace with
......
......@@ -8408,3 +8408,29 @@ machine_dependent_reorg (first)
constants table, we don't need to output the constant in the real
constant table, but we have no way to prevent that. */
}
/* Return nonzero if X is a SIGN or ZERO extend operator. */
int
extend_operator (x, mode)
rtx x;
enum machine_mode mode;
{
enum rtx_code code = GET_CODE (x);
return code == SIGN_EXTEND || code == ZERO_EXTEND;
}
/* Accept any operator that can be used to shift the high half of the
input value to the lower half, suitable for truncation. The
remainder (the lower half of the input, and the upper half of the
output) will be discarded. */
int
highpart_shift_operator (x, mode)
rtx x;
enum machine_mode mode;
{
enum rtx_code code = GET_CODE (x);
return (code == LSHIFTRT
|| code == ASHIFTRT
|| code == ROTATERT
|| code == ROTATE);
}
......@@ -260,6 +260,8 @@ extern int se_uns_arith_operand ();
extern int se_arith_operand ();
extern int se_nonmemory_operand ();
extern int se_nonimmediate_operand ();
extern int extend_operator ();
extern int highpart_shift_operator ();
extern int m16_uimm3_b ();
extern int m16_simm4_1 ();
extern int m16_nsimm4_1 ();
......@@ -3641,7 +3643,10 @@ while (0)
REG, SIGN_EXTEND }}, \
{"se_nonimmediate_operand", { SUBREG, REG, MEM, SIGN_EXTEND }}, \
{"consttable_operand", { LABEL_REF, SYMBOL_REF, CONST_INT, \
CONST_DOUBLE, CONST }},
CONST_DOUBLE, CONST }}, \
{"extend_operator", { SIGN_EXTEND, ZERO_EXTEND }}, \
{"highpart_shift_operator", { ASHIFTRT, LSHIFTRT, ROTATERT, ROTATE }},
/* If defined, a C statement to be executed just prior to the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment