diff options
author | Ken Raeburn <raeburn@cygnus.com> | 1998-06-08 15:56:47 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1998-06-08 09:56:47 -0600 |
commit | cb92366029011ef6ee679a2540a2c6a77ad7372e (patch) | |
tree | 910e5fa6251514ebff40b3b55346909bdfba1dea /gcc/config/mips/mips.c | |
parent | a1622f838f1188fca74ba0186300882f33006ae7 (diff) | |
download | gcc-cb92366029011ef6ee679a2540a2c6a77ad7372e.zip gcc-cb92366029011ef6ee679a2540a2c6a77ad7372e.tar.gz gcc-cb92366029011ef6ee679a2540a2c6a77ad7372e.tar.bz2 |
* 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
Diffstat (limited to 'gcc/config/mips/mips.c')
-rw-r--r-- | gcc/config/mips/mips.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index aad3c81..e10c048 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -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); +} |