Article View: comp.arch
Article #726Re: Large constants in RISC
From: MitchAlsup
Date: Sat, 14 Nov 2026 18:53
Date: Sat, 14 Nov 2026 18:53
31 lines
2317 bytes
2317 bytes
Terje Mathisen <terje.mathisen@tmsw.no> posted: > Waldek Hebisch wrote: > > Terje Mathisen <terje.mathisen@tmsw.no> wrote: > >> Waldek Hebisch wrote: ---------------------------- > > If you assume that your constants are 64 bit or very short, then > > prefix looks better. However, pretty frequent case are not so > > small constants that fits into 28 bits. Basically, calls need > > addresses and they go semi-random in given library. 28 bit is > > enough for most libraries (and can be effectively increased by > > 2 bits if one assumes 4 byte alignment for the target), while > > 12 or even 16 bit offsets are too short. > > > > So this covers constants of various length, with smaller cost > > for smaller constants. I was mainly looking at integer case. > > For FPU use some constants may be represented in single precision > > and converted to doubles, but nontrivial fraction of double > > constants will need full 64 bits. OTOH it is not clear to > > me how much one gains thanks to 64 bit floating point constants. > > IME precomputed constants are frequently kept in tables, it > > is not clear to me if there could be significant gain from > > putting them into instructions. > > Ask Mitch! > > Seems he's getting very consisten gains from having 32 and 64-bit > immdiates as part of the instruction stream, one of the major ones being > no cache misses when loading said constant. > > Terje
Technical Details
Message-ID:
<1794682436-5857@newsgrouper.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!newsgrouper.org!.POSTED!not-for-mailReferences:
<11d76uq$11cdc$1@paganini.bofh.team> <11d7ct8$17akn$1@dont-email.me> <11d7ih2$11orr$1@paganini.bofh.team> <11d9d0d$1rsce$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!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: Large constants in RISC References: <11d76uq$11cdc$1@paganini.bofh.team> <11d7ct8$17akn$1@dont-email.me> <11d7ih2$11orr$1@paganini.bofh.team> <11d9d0d$1rsce$1@dont-email.me> Date: Sat, 14 Nov 2026 18:53:56 GMT Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID: <1794682436-5857@newsgrouper.org> Injection-Info: newsgrouper.org; mail-complaints-to="newsgrouper@yahoo.com"; posting-account=user5857 Injection-Date: Sat, 14 Nov 2026 18:53:56 GMT User-Agent: Newsgrouper/0.9.0