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]

Re: [PATCH] Re: Checking out PR4483 (constant overflow on PPC, problems compiling Linux kernel)



On Saturday, December 1, 2001, at 07:46 , Richard Kenner wrote:
> There indeed would be some things simplified by having CONST_INTs (and
> integral CONST_DOUBLEs) have modes, but there are other things that
> might get more complex and I'm not sure I agree that modes are the
> right approach, but I'm also not strongly against it.
>

One of the reasons against it may be that *operations* need to know the
mode of their results. In this case, we have a PLUS operation in SI 
mode.
The compiler should know that information. What the mode of the operand
is does not really matter here. We have two mathematical quantities 
x and y
and we want to do a certain operation on them. This operation can
conceptually be separated in a mathematically exact part (the familiar
notion of +) and a rounding/truncating step. This is similar to
floating-point arithmetic.

As long as a constant is exact, it really doesn't make a lot of sense
to talk about its mode.

   -Geert


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