This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hi, This patch extends the MADD patch posted by Richard on http://gcc.gnu.org/ml/gcc-patches/2007-04/msg01559.html to support MSUB. Eight MIPS tests are included. The patch and tests are very similar to the original patch, except that the reversed-operand test is not included. If I swap the subtrahend and the minuend in the test, GCC does not swap operands back (before expanding tree to rtl) and fails to recognize the MSUB pattern. Ok to commit? Thanks! Regards, Chao-ying gcc/ 2007-05-07 Chao-ying Fu <fu@mips.com> * doc/md.texi (msub@var{m}@var{n}4, usub@var{m}@var{n}4): Document. * optabs.h (OTI_smsub_widen, OTI_umsub_widen): New optab_indexes. (smsub_widen_optab, umsub_widen_optab): Define. * optabs.c (init_optabs): Initialize smsub_widen_optab and umsub_widen_optab. * genopinit.c (optabs): Fill in smsub_widen_optab and umsub_widen_optab. * expr.c (expand_expr_real_1): Try to use smsub_widen_optab and umsub_widen_optab to implement multiply-subtract sequences. * config/mips/mips.md (*msac<u>_di): Rename to... (<u>msubsidi4): ...this. Extend condition to include GENERATE_MADD_MSUB and TARGET_DSPR2. Change the constraint of operand 0 to "ka" and use the three-operand form of msub<u> for TARGET_DSPR2. * config/mips/mips-dspr2.md (mips_msub, mips_msubu): Convert to define_expands. gcc/testsuite/ 2007-05-07 Chao-ying Fu <fu@mips.com> * gcc.target/mips/msub-1.c, gcc.target/mips/msub-2.c, * gcc.target/mips/msub-3.c, gcc.target/mips/msub-4.c, * gcc.target/mips/msubu-1.c, gcc.target/mips/msubu-2.c, * gcc.target/mips/msubu-3.c, gcc.target/mips/msubu-4.c: New tests.
Attachment:
gcc.diff
Description: gcc.diff
Attachment:
msub-1.c
Description: msub-1.c
Attachment:
msub-2.c
Description: msub-2.c
Attachment:
msub-3.c
Description: msub-3.c
Attachment:
msub-4.c
Description: msub-4.c
Attachment:
msubu-1.c
Description: msubu-1.c
Attachment:
msubu-2.c
Description: msubu-2.c
Attachment:
msubu-3.c
Description: msubu-3.c
Attachment:
msubu-4.c
Description: msubu-4.c
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |