🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #1027

Re: reassociation and undefined behaviour

#1027
From: Thomas Koenig
Date: Wed, 02 Dec 2026 18:37
21 lines
2299 bytes
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
> Thomas Koenig <tkoenig@netcologne.de> writes:
>>Even with OoO, latency is king; reducing it is always good because
>>if it ends up on the critical path, it will matter.
>>
>>Just about the only exception where rearranging a+b+c+d into
>>(a+b)+(c+d) is not profitable are single-issue processors where
>>the result is available on the next cacle.
>
> There are lots of cases where (a+b)+(c+d) is not the fastest way to
> get the sum of a,b,c,d.  E.g., if a is available by an addition
> latency (or more) after b, and c and d are available by two addition
> latencies or more after a, then a+(b+(c+d)) is better.

So this is something to be left to the phase where registers
are allocated (as in the test case).

-- 
This USENET posting was made without artificial intelligence,
artificial impertinence, artificial arrogance, artificial stupidity,
artificial flavorings or artificial colorants.
Technical Details
Message-ID: <11epogc$3cl08$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.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>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Thomas Koenig <tkoenig@netcologne.de>
Newsgroups: comp.arch
Subject: Re: reassociation and undefined behaviour
Date: Wed, 2 Dec 2026 18:37:00 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <11epogc$3cl08$1@dont-email.me>
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>
Injection-Date: Wed, 02 Dec 2026 18:37:00 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3560456"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX197qxmB7fpj9UGJmo6zq3m0kixvD2VR1/E="; posting-host="b68aab5bc8ae7bda68511d5dff26ec94"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:JuwqJlSFi9Go2rzWIOLVVHnut10= sha256:lqTt2imzEML3PE44AbJKo9J33QD3UqGWnI/wADDg25s=
	sha1:xow5dQcyAisz7EagwPMBUuWvvag= sha256:7JKQWmdJKjxo/yN2QsqQIn+uRaOzWorndHoMoRGwRTg=