Re: Supporting 'MAC' instruction on gcc v4.1.1

2007-05-16 Thread Rask Ingemann Lambertsen
On Wed, May 16, 2007 at 11:16:59AM +0530, Rahul wrote: > But for -O0 optimization, even the 'progname.c.*.combine file' is > *not* getting generated for '-fdump-rtl-all / -fdump-rtl-combine' > options. The *.combine dumpfile is generated when the combine pass runs. > Please tell me whether th

Re: Supporting 'MAC' instruction on gcc v4.1.1

2007-05-15 Thread Rahul
On 5/12/07, Paul Brook <[EMAIL PROTECTED]> wrote: > But for the following example > int a = 1; > int b = 2; > int c = 3; > c = c + a * b; > the MAC pattern is not getting recognized, instead it is still using > PLUS and MULT patterns. Your example is bogus. This is optimized to "c = 5" w

Re: Supporting 'MAC' instruction on gcc v4.1.1

2007-05-11 Thread Paul Brook
> But for the following example > int a = 1; > int b = 2; > int c = 3; > c = c + a * b; > the MAC pattern is not getting recognized, instead it is still using > PLUS and MULT patterns. Your example is bogus. This is optimized to "c = 5" well before we get to RTL. Paul

Re: Supporting 'MAC' instruction on gcc v4.1.1

2007-05-11 Thread Geert Bosch
On May 11, 2007, at 11:31, Andrew Haley wrote: It shouldn't have. All args are ints, and if we are assuming (as the C standard says) that int overflow is undefined, the transformation is valid. Aarghh..! I even quoted the part that mentioned ints, but still thought it was about float. Sure,

Re: Supporting 'MAC' instruction on gcc v4.1.1

2007-05-11 Thread Andrew Haley
Geert Bosch writes: > > On May 11, 2007, at 08:26, Rahul wrote: > > But for the following example > > int a = 1; > > int b = 2; > > int c = 3; > > c = c + a * b; > > the MAC pattern is not getting recognized, instead it is still using > > PLUS and MULT patterns. > > In general, thi

Re: Supporting 'MAC' instruction on gcc v4.1.1

2007-05-11 Thread Geert Bosch
On May 11, 2007, at 08:26, Rahul wrote: But for the following example int a = 1; int b = 2; int c = 3; c = c + a * b; the MAC pattern is not getting recognized, instead it is still using PLUS and MULT patterns. In general, this transformation is not valid, as it has different rounding beha

Re: Supporting 'MAC' instruction on gcc v4.1.1

2007-05-11 Thread Rask Ingemann Lambertsen
On Fri, May 11, 2007 at 05:56:16PM +0530, Rahul wrote: > I have PLUS, MULT and following MAC pattern, in my target.md file. > (define_insn "" > [(set (match_operand:SI 0 "data_reg" "=f") > (plus:SI (mult:SI (match_operand:SI 1 "data_reg" "f") > (match_ope

Re: Supporting 'MAC' instruction on gcc v4.1.1

2007-05-11 Thread Revital1 Eres
[EMAIL PROTECTED] wrote on 11/05/2007 15:26:16: > Hello all, > > I am working on gcc v4.1.1 for a non-gcc target. I want to support > 'MAC' instruction > (mac OP1, OP2, OP3 => OP3 += OP1 * OP2). > http://gcc.gnu.org/ml/gcc/2007-05/msg00114.html seems relevant to your problem. Revital > > > R