This is the mail archive of the
mailing list for the GCC project.
Re: Comments on the suggestion to use infinite precision math for wide int.
- From: Kenneth Zadeck <zadeck at naturalbridge dot com>
- To: Robert Dewar <dewar at adacore dot com>
- Cc: Florian Weimer <fweimer at redhat dot com>, Richard Biener <richard dot guenther at gmail dot com>, Mike Stump <mikestump at comcast dot net>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Lawrence Crowl <crowl at google dot com>, rdsandiford at googlemail dot com, Ian Lance Taylor <iant at google dot com>
- Date: Mon, 08 Apr 2013 10:26:07 -0400
- Subject: Re: Comments on the suggestion to use infinite precision math for wide int.
- References: <506C72C7 dot 7090207 at naturalbridge dot com> <50912D85 dot 1070002 at naturalbridge dot com> <CAFiYyc2Q2UQPmkhExi2c8f-BSGLv+Rq1rOy4NdPQmTqSRE1A0A at mail dot gmail dot com> <5091331C dot 3030504 at naturalbridge dot com> <CAFiYyc1L6zuehE75dEfd_fB1-81F1fDHpL3kS=tbk6qAK3Texg at mail dot gmail dot com> <512D686B dot 90000 at naturalbridge dot com> <CAFiYyc3fXewAW2dU6-RHLiTQ-ZiLgdWmfwdFF6k1VqxPsrvZbQ at mail dot gmail dot com> <515B16EB dot 5020303 at naturalbridge dot com> <CAFiYyc2qWwDcqzCMpMSiQ72w5ry=a3ZpxkFkiK7OvvBA0h4eGw at mail dot gmail dot com> <515C1AFB dot 3080105 at naturalbridge dot com> <CAFiYyc12qGj92j+5yCUEpghOZXqjjAgOzS_H6QJpKvd-dyfU0A at mail dot gmail dot com> <515C55D7 dot 7020003 at naturalbridge dot com> <CAFiYyc0sp1wbq1J+FXoJWcb9UcsOWiwjJ_KaQkbbgCnddxhVzA at mail dot gmail dot com> <5161AA07 dot 7090706 at naturalbridge dot com> <51628648 dot 3030606 at redhat dot com> <5162C2EB dot 4070601 at naturalbridge dot com> <5162C3CF dot 9090506 at adacore dot com> <5162C4CD dot 1030404 at naturalbridge dot com> <5162CB9B dot 6070309 at adacore dot com> <5162CCF9 dot 9030305 at naturalbridge dot com > <5162D04F dot 7020907 at adacore dot com>
On 04/08/2013 10:12 AM, Robert Dewar wrote:
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?
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 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.