🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #1044

Re: hardware reassociation

#1044
From: EricP
Date: Thu, 03 Dec 2026 14:02
47 lines
3230 bytes
On 2026-Dec-03 02:40, Anton Ertl wrote:
> 
> But you are apparently thinking of add instructions that trap on
> overflow, like MIPS add and Alpha addv.  The overflow conditions are
> not associative.  You have to compute each addition as specified to
> perform exactly the architectural overflows.  If you reassociate, and
> there is no overflow, you might have missed an overflow that occurs
> with the original association.
> 
> However, you can do something: Compute a+b+c+d to get the register
> result, and compute a+b, t1+c, t2+d, with more latency to produce the
> architectural overflow result (latency is not that important here).
> And when there is an actual overflow, use the results of the latter
> computations. no microtrapping necessary.
> 
> But given architectural trends, trapping on overflow is something of
> the past, so I would not invest any hardware in making it fast.  These
> days, if you think that overflow is possible, you use Bigints, not
> traps.
> 
> - anton

As you note, various optimizations can introduce or remove
"transient" exceptions during expression evaluation.
Whether this matter depends on the language definition.

Transient overflows can be avoided by promoting to a larger type
for the calculations and sign contracting the final result and
checking if it fits into the destination. Only if the final
result is out of range does it throw an overflow exception.

Ada83 which has overflow and other exceptions makes explicit
allowance for their interaction with various optimizations.
For expressions the result should be as optimal as C's UB.

Ada '83 Language Reference Manual
11.6. Exceptions and Optimization
http://archive.adaic.com/standards/83lrm/html/lrm-11-06.html#11.6

Later language versions say the same thing but reworded

Ada Reference Manual (Ada 2022 with Amendment 1)
11.6 Exceptions and Optimization
http://www.ada-auth.org/standards/22rm_w_amd1/html/RM-11-6.html


Technical Details
Message-ID: <ODeQS.179983$_S94.33345@fx42.iad>
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx42.iad.POSTED!not-for-mail
References: <11cpqih$acf5$1@dont-email.me> <86o6b6kaqf.fsf@linuxsc.com> <11ejr5e$nk8$1@reader2.panix.com> <11ejtoe$eoj7$1@dont-email.me> <11el2c1$q43$1@reader2.panix.com> <11emcgn$1k681$1@dont-email.me> <11emvbp$1sc68$3@dont-email.me> <2026Dec2.084013@mips.complang.tuwien.ac.at> <1796233819-5857@newsgrouper.org> <2026Dec2.190958@mips.complang.tuwien.ac.at> <1796263840-5857@newsgrouper.org> <2026Dec3.084005@mips.complang.tuwien.ac.at>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx42.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: EricP <ThatWouldBeTelling@thevillage.com>
Subject: Re: hardware reassociation
Newsgroups: comp.arch
References: <11cpqih$acf5$1@dont-email.me> <86o6b6kaqf.fsf@linuxsc.com>
 <11ejr5e$nk8$1@reader2.panix.com> <11ejtoe$eoj7$1@dont-email.me>
 <11el2c1$q43$1@reader2.panix.com> <11emcgn$1k681$1@dont-email.me>
 <11emvbp$1sc68$3@dont-email.me> <2026Dec2.084013@mips.complang.tuwien.ac.at>
 <1796233819-5857@newsgrouper.org>
 <2026Dec2.190958@mips.complang.tuwien.ac.at>
 <1796263840-5857@newsgrouper.org>
 <2026Dec3.084005@mips.complang.tuwien.ac.at>
Content-Language: en-CA
In-Reply-To: <2026Dec3.084005@mips.complang.tuwien.ac.at>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 47
Message-ID: <ODeQS.179983$_S94.33345@fx42.iad>
X-Complaints-To: abuse@UsenetServer.com
NNTP-Posting-Date: Thu, 03 Dec 2026 14:02:22 UTC
Date: Thu, 3 Dec 2026 09:02:20 -0500
X-Received-Bytes: 3009