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: Robert Dewar <dewar at adacore dot com>
- To: Kenneth Zadeck <zadeck at naturalbridge dot com>
- Cc: Lawrence Crowl <crowl at google dot com>, 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>, rdsandiford at googlemail dot com, Ian Lance Taylor <iant at google dot com>
- Date: Mon, 08 Apr 2013 17:48:59 -0400
- Subject: Re: Comments on the suggestion to use infinite precision math for wide int.
- References: <506C72C7 dot 7090207 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> <5162D04F dot 7020907 at adacore dot com> <5162D37F dot 40403 at naturalbridge dot com> <5162D59E dot 4010700 at adacore dot com> <CAGqM8fYDPhNn3U29QN2yOw_huxG7M2HEOTrUJJiArdUVgA2rGw at mail dot gmail dot com> <51633878 dot 9090206 at adacore dot com> <51633AAA dot 5040404 at naturalbridge dot com>
On 4/8/2013 5:46 PM, Kenneth Zadeck wrote:
In some sense you have to think in terms of three worlds:
1) what you call "compile-time static expressions" is one world which in
gcc is almost always done by the front ends.
2) the second world is what the optimizers can do. This is not
compile-time static expressions because that is what the front end has
3) there is run time.
My view on this is that optimization is just doing what is normally done
at run time but doing it early. From that point of view, we are if not
required, morally obligated to do thing in the same way that the
hardware would have done them. This is why i am so against richi on
wanting to do infinite precision. By the time the middle or the back
end sees the representation, all of the things that are allowed to be
done in infinite precision have already been done. What we are left
with is a (mostly) strongly typed language that pretty much says exactly
what must be done. Anything that we do in the middle end or back ends in
infinite precision will only surprise the programmer and make them want
to use llvm.
That may be so in C, in Ada it would be perfectly reasonable to use
infinite precision for intermediate results in some cases, since the
language standard specifically encourages this approach.