This is the mail archive of the gcc@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]

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


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, this transformation is not valid, as it has
 > different rounding behavior from the expression with the
 > + and * operations.

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.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]