Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.16.MISMATCH!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe04.iad.POSTED!00000000!not-for-mail From: Lew Pitcher Subject: Re: Arithmetic overflow checking Newsgroups: comp.lang.java.programmer,comp.lang.c Followup-To: comp.lang.java.programmer Reply-To: lew.pitcher@digitalfreehold.ca References: <9LWdnZH2hdfmyYvTnZ2dnUVZ_vidnZ2d@posted.palinacquisition> <3797038f-22d1-40b2-8c12-60db5a0976b8@t5g2000yqj.googlegroups.com> <1d742049-31f6-4eb6-8832-9cce3f25091d@a31g2000vbt.googlegroups.com> <08jn17t10eb6qgfdlvriqq8j6e17k5u2ou@4ax.com> <32kp27hs1qqcvmdcs9ol4cqg9ge7e4q2u7@4ax.com> Lines: 50 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Message-ID: X-Complaints-To: abuse@UsenetServer.com NNTP-Posting-Date: Mon, 25 Jul 2011 14:24:09 UTC Date: Mon, 25 Jul 2011 10:24:09 -0400 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6533 comp.lang.c:8689 On July 24, 2011 22:13, in comp.lang.c, dave.thompson2@verizon.net wrote: > On Mon, 11 Jul 2011 21:31:11 -0700, 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. >> > S/360 and all successors have masked interrupts for overflows in > 'fixed-point' (integer) and decimal (BCD), and unmasked for (original) > floating-point now retronymed 'hex' floating-point. Since IIRC S/390 > there is also 'binary' (IEEE) floating-point with its own separate and > more complicated status flags, masks and interrupt causes. > > I can't find a usable ref on the IBM site, You probably want IBM's documentation site. Here's a link to z/Architecture Principles of Operations http://publibfp.dhe.ibm.com/cgi-bin/bookmgr/download/DZ9ZR006.pdf?DT=20080213005418&XKS=dz9zbk08 You want page 6-14 and after for "Program Interruption"; the various Data Exceptions are documented there, including fixed, floating point, and IEEE floating point data exceptions. HTH -- Lew Pitcher Master Codewright & JOAT-in-training | Registered Linux User #112576 Me: http://pitcher.digitalfreehold.ca/ | Just Linux: http://justlinux.ca/ ---------- Slackware - Because I know what I'm doing. ------