Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 12 Jul 2011 14:38:39 -0500 Date: Tue, 12 Jul 2011 12:38:40 -0700 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer,comp.lang.c Subject: Re: Arithmetic overflow checking References: <2rydnez7l-H5BYnTnZ2dnUVZ_vGdnZ2d@earthlink.com> <9LWdnZH2hdfmyYvTnZ2dnUVZ_vidnZ2d@posted.palinacquisition> <3797038f-22d1-40b2-8c12-60db5a0976b8@t5g2000yqj.googlegroups.com> <4e1bf1bc$0$15671$4fafbaef@reader2.news.tin.it> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Lines: 22 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 75.11.53.97 X-Trace: sv3-bx6ZF0QW98bzmDOAEGZkuljRM//WGUxpXv74N04sOFvt/HGoMYnbqIiaApPO0WSRcHnxHBhxq3uYTt0!2WsUtYNA4C6W6XhdNMp1mTlJGK/5w2o1OMmjF799lDyTFGxajs4F1p7XejwAn4VpuEC6ISIP27BZ!XjWUw1V58D96QbI+JGz7YiAVF1PwJ+zS8wu69pj5jFg= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2384 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6130 comp.lang.c:8187 On 7/12/2011 11:39 AM, Gene Wirchenko wrote: > On Tue, 12 Jul 2011 02:22:41 -0700 (PDT), tm > wrote: > > [snip] > >> Yes, but it must be checked after every operation. >> A hardware that triggers an interrupt, would save this >> extra checks. > > No, it would not. The check would simply be implemented in > hardware. It will still take time. It would not necessarily directly take time. It could be done in parallel with the stage that writes results back to register files, or bypasses them to other instructions. As has already been pointed out, there may be a tiny performance cost because the space taken by the check logic might have been used for something else. Patricia