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: Comments on the suggestion to use infinite precision math for wide int.


On 4/8/13, Robert Dewar <dewar@adacore.com> wrote:
> On 4/8/2013 10:26 AM, Kenneth Zadeck wrote:
> > On 04/08/2013 10:12 AM, Robert Dewar wrote:
> > > On 4/8/2013 9:58 AM, Kenneth Zadeck wrote:
> > > > yes but the relevant question for the not officially
> > > > static integer constants is "in what precision are those
> > > > operations to be performed in?  I assume that you choose
> > > > gcc types for these operations and you expect the math to
> > > > be done within that type, i.e. exactly the way you expect
> > > > the machine to perform.
> > >
> > > As I explained in an earlier message, *within* a single
> > > expression, we are free to use higher precision, and we provide
> > > modes that allow this up to and including the usea of infinite
> > > precision. That applies not just to constant expressions but
> > > to all expressions.
> >
> > My confusion is what you mean by "we"?  Do you mean "we" the
> > writer of the program, "we" the person invoking the compiler
> > by the use command line options or "we", your company's
> > implementation of ada?
>
> Sorry, bad usage, The gcc implementation of Ada allows the user
> to specify by pragmas how intermediate overflow is handled.

Correct me if I'm wrong, but the Ada standard doesn't require any
particular maximum evaluation precision, but only that you get an
exception if the values exceed the chosen maximum.

> > My interpretation of your first email was that it was possible
> > for the programmer to do something equivalent to adding
> > attributes surrounding a block in the program to control the
> > precision and overflow detection of the expressions in the block.
> > And if this is so, then by the time the expression is seen by
> > the middle end of gcc, those attributes will have been converted
> > into tree code will evaluate the code in a well defined way by
> > both the optimization passes and the target machine.
>
> Yes, that's a correct understanding

In essence, you have moved some of the optimization from the back
end to the front end.  Correct?

-- 
Lawrence Crowl


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