Re: GCC internals chapter 16.14

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Panu-Kristian Poiksalo" <panu.poiksalo@xxxxxxx> writes:

> Sorry to bother you with an idiotic question, but I might have
> misunderstood something rather profoundly.
>
> See GCC internals chapter 16.14 "Canonicalization of Instructions".
> In item #4 of the list of canonicalizations, it is stated:
> "(plus (mult (neg A) B) C) is canonicalized as (minus A (mult B C))."
>
> Now, that looks a bit strange. Does that mean that
> ((-a) * b) + c)  is-equal-to  (a - (b * c))
>
> because it doesn't seem that way if I substitute a=3, b=5, c=7 I get
> ((-3) * 5) + 7) = (-15 + 7) = -8  and
> (3 - (5 * 7)) = (3 - (35)) = -32.

You're right, the docs are wrong.  It should say that (plus (mult (neg
B) C) A) is canonicalized as (minus A (mult B C)).  I'll fix it.
Thanks.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux