Article View: comp.arch
Article #1034Re: reassociation and undefined behaviour
From: MitchAlsup
Date: Thu, 03 Dec 2026 02:07
Date: Thu, 03 Dec 2026 02:07
25 lines
1973 bytes
1973 bytes
David Brown <david.brown@hesbynett.no> posted:
> On 02/12/2026 13:24, Anton Ertl wrote:
> > David Brown <david.brown@hesbynett.no> writes:
> >> On 01/12/2026 20:01, Stefan Monnier wrote:
----------------------------------
> In general, "(x<<n) | (x>>(32-n))" cannot be replaced with "undef"
It should be replaced with::
ROTW Rt,Rx,Rn
--------------
> I suspect (but have not thought it through in detail) that some kinds of
> strength reduction or other expression simplification could result in
> code where some operations in the internal re-arranged expression would
> have new UB if evaluated with "UB on overflow" semantics.
Older ISA would avoid UB by defining 2× MUL and 2× DIV to avoid Overflow
MULD {Rt1,Rt2},Ra,Rb
DIV {Rrem,Rquo},{Rt1,Rt2},Rdiv
Technical Details
Message-ID:
<1796263648-5857@newsgrouper.org>Path:
mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!newsgrouper.org!.POSTED!not-for-mailReferences:
<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> <jwvbj74bzm4.fsf-monnier+comp.arch@gnu.org> <11eolqn$2peg5$1@dont-email.me> <2026Dec2.132411@mips.complang.tuwien.ac.at> <11epd07$362ph$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!newsgrouper.org!.POSTED!not-for-mail From: MitchAlsup <user5857@newsgrouper.org.invalid> Newsgroups: comp.arch Subject: Re: reassociation and undefined behaviour 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> <jwvbj74bzm4.fsf-monnier+comp.arch@gnu.org> <11eolqn$2peg5$1@dont-email.me> <2026Dec2.132411@mips.complang.tuwien.ac.at> <11epd07$362ph$1@dont-email.me> Date: Thu, 03 Dec 2026 02:07:28 GMT Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID: <1796263648-5857@newsgrouper.org> Injection-Info: newsgrouper.org; mail-complaints-to="newsgrouper@yahoo.com"; posting-account=user5857 Injection-Date: Thu, 03 Dec 2026 02:07:28 GMT User-Agent: Newsgrouper/0.9.0