🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #1032

Re: reassociation and undefined behaviour

#1032
From: Thomas Koenig
Date: Wed, 02 Dec 2026 20:08
23 lines
2458 bytes
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
> Thomas Koenig <tkoenig@netcologne.de> writes:
>>Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
>>> 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).
>
> The register allocation does not have the latency information.
> I am not aware that any compiler does have this information as is relevant
> for an OoO machine.

You might want to learn the TARGET_MEMORY_MOVE_COST hook
in gcc, which is used in register allocation.  You would
probably learn something.

-- 
This USENET posting was made without artificial intelligence,
artificial impertinence, artificial arrogance, artificial stupidity,
artificial flavorings or artificial colorants.
Technical Details
Message-ID: <11eptrk$3fi26$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> <11epogc$3cl08$1@dont-email.me> <2026Dec2.201455@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 20:08:20 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <11eptrk$3fi26$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>
 <11epogc$3cl08$1@dont-email.me>
 <2026Dec2.201455@mips.complang.tuwien.ac.at>
Injection-Date: Wed, 02 Dec 2026 20:08:21 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3655750"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19/8859lj3HLJmpFo6Q7zNaq89Y7ZtJ2gE="; posting-host="b68aab5bc8ae7bda68511d5dff26ec94"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:LeLFsKiXeLQpfVIx4Yf9sr8a7C4= sha256:zOtwEAct/Odzo7CH7NG8ZV9nLk8Tnz1L6dvBoV7O05w=
	sha1:e2mNeRFEOHyY+2+xDPGIALr0odc= sha256:XmFrYgGmThzThQqvDJuio6+p0nxoOpVv3l792/oDZXQ=