This is the mail archive of the
mailing list for the GCC project.
expand_mult for partial_int modes?
- From: DJ Delorie <dj at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 27 May 2005 22:10:20 -0400
- Subject: expand_mult for partial_int modes?
Any reason why we don't use the shift/add optimization for partial_int
modes? I can't think of a reason why we'd allow multiply without also
allowing shift and add, and I'd expect shift/add to be implemented
more often than a hardware multiply.
Only three ports use partial_int at the moment, and none of those
define anything other than "move" for them, so this can't be tested
but shouldn't be able to break anything either. I've been using this
patch with an internal port and it works fine for me.
* expmed.c (expand_mult): Convert partial_int multiplies to
shift/add combinations too.
RCS file: /cvs/gcc/gcc/gcc/expmed.c,v
retrieving revision 1.228
diff -p -U3 -r1.228 expmed.c
--- expmed.c 27 Apr 2005 16:02:33 -0000 1.228
+++ expmed.c 28 May 2005 01:54:03 -0000
@@ -3030,7 +3030,8 @@ expand_mult (enum machine_mode mode, rtx
/* These are the operations that are potentially turned into a sequence
of shifts and additions. */
- if (GET_MODE_CLASS (mode) == MODE_INT
+ if ((GET_MODE_CLASS (mode) == MODE_INT
+ || GET_MODE_CLASS (mode) == MODE_PARTIAL_INT)
&& (unsignedp || !flag_trapv))
HOST_WIDE_INT coeff = 0;