Article View: comp.arch
Article #774Re: Large constants in RISC
From: Anton Ertl
Date: Mon, 16 Nov 2026 08:04
Date: Mon, 16 Nov 2026 08:04
29 lines
2370 bytes
2370 bytes
BGB <cr88192@gmail.com> writes: >Or, if one happens to use something like a rarely-used global variable >(in the static-count sense) in the middle of a loop in the middle of the >hot path (which is where this sort of thing is seemingly most prone to >show up sometimes). > >So, sometimes it is better to be defensive and mostly address the last >few percent as a precautionary effort against slow-cases randomly >showing up in the hot path. > > >Well, at least excluding programmer-level "everyone already knows this >is slow" things, like integer divide and modulo. > > >Pretty much everyone seems to expect things like integer constants and >global variables to be nearly free though. What makes you think that everybody expects accesses to global variables to be fast? Certainly my take has been for decades that anything that's not in registers is slow. And that global variables are not in registers, in general. - anton -- 'Anyone trying for "industrial quality" ISA should avoid undefined behavior.' Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
Technical Details
Message-ID:
<2026Nov16.090453@mips.complang.tuwien.ac.at>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11d76uq$11cdc$1@paganini.bofh.team> <11d9d0d$1rsce$1@dont-email.me> <11d9tq8$1b9c1$2@paganini.bofh.team> <11dabct$26fdl$1@dont-email.me> <11dahac$2t74$1@gal.iecc.com> <1794768602-5857@newsgrouper.org> <11dd91o$33nqv$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: anton@mips.complang.tuwien.ac.at (Anton Ertl) Newsgroups: comp.arch Subject: Re: Large constants in RISC Date: Mon, 16 Nov 2026 08:04:53 GMT Organization: Institut fuer Computersprachen, Technische Universitaet Wien Lines: 29 Message-ID: <2026Nov16.090453@mips.complang.tuwien.ac.at> References: <11d76uq$11cdc$1@paganini.bofh.team> <11d9d0d$1rsce$1@dont-email.me> <11d9tq8$1b9c1$2@paganini.bofh.team> <11dabct$26fdl$1@dont-email.me> <11dahac$2t74$1@gal.iecc.com> <1794768602-5857@newsgrouper.org> <11dd91o$33nqv$1@dont-email.me> Injection-Date: Mon, 16 Nov 2026 08:12:12 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3570534"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19NE1H7YfO/4R65yvQtaIKF"; posting-host="162378f659f64fe0e343a03d3521a08a" Cancel-Lock: sha1:eYC7OQENGgeLcFba4XVk6rvbewE= sha256:8SivMst5SPFVq6cNMfSTfJYPQMTpOMhbOOb4TlAKJ2k= sha1:l1A1wLW4C0FD0AcKHm4bYfZLg54= sha256:GJV5WV5yf2K7NUnxlyN09uPJn/ty9Y2xtFqTFMlRI0s= X-newsreader: xrn 10.11