Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: James Kuyper Newsgroups: comp.lang.java.programmer,comp.lang.c Subject: Re: Arithmetic overflow checking Date: Tue, 12 Jul 2011 06:28:27 -0400 Organization: A noiseless patient Spider Lines: 38 Message-ID: References: <2rydnez7l-H5BYnTnZ2dnUVZ_vGdnZ2d@earthlink.com> <9LWdnZH2hdfmyYvTnZ2dnUVZ_vidnZ2d@posted.palinacquisition> <3797038f-22d1-40b2-8c12-60db5a0976b8@t5g2000yqj.googlegroups.com> <1d742049-31f6-4eb6-8832-9cce3f25091d@a31g2000vbt.googlegroups.com> <08jn17t10eb6qgfdlvriqq8j6e17k5u2ou@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Date: Tue, 12 Jul 2011 10:28:29 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="z6x13JPcEt9SiQRsy+GiBQ"; logging-data="25651"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18+rgXYmumDfzfBgvmkj7YCS0/ltltoJLw=" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 In-Reply-To: <08jn17t10eb6qgfdlvriqq8j6e17k5u2ou@4ax.com> Cancel-Lock: sha1:jXPuIdIWAuqfbO3DSJU3xD5DmPc= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6110 comp.lang.c:8165 On 07/12/2011 12:31 AM, Gene Wirchenko wrote: > On Mon, 11 Jul 2011 21:51:28 -0400, Eric Sosman > wrote: > >> On 7/11/2011 5:54 PM, tm wrote: >>> [...] >>> Correct results can be computed without any slowdown, >>> when the CPU is able to trigger an overflow interupt. >>> >>> A slowdown would only happen when an overflow occurs. >>> Computations without overflow would run at full speed. >> >> Well, no. At least, not in any trap-capable architecture I've >> seen. Three points: > > [snipped nice explanation] > > How about an example of such an architecture? A URL would be > fine. I believe that /370 had something like that for floating point, > but not for integer. > >> These effects are all small (I think). But in an environment where >> a 3.63GHz part gets bragging rights over a mere 3.59GHz, I don't think >> "full speed" is entirely accurate. It's sort of like those car ads: >> "Best highway mileage *in its class*." > > I never did understand that phrase. With your post, I imagine > private, car obedience classes. Every car is the best in its class. [OT]The idea is borrowed from the concept of weight classes in the barbaric "sport" of boxing. An SUV and a sub-compact car are designed to carry very different loads; if you actually need the extra cargo/passenger capacity of the SUV, a sub-compact with much better gas mileage won't do you any good. However, I don't think that's the complete explanation for all the single-passenger SUVs I see every day while driving to and from work.[/OT] -- James Kuyper