Article View: comp.arch
Article #824Re: Large constants in RISC
From: Michael S
Date: Fri, 20 Nov 2026 10:26
Date: Fri, 20 Nov 2026 10:26
24 lines
2629 bytes
2629 bytes
On Thu, 19 Nov 2026 23:19:31 GMT scott@slp53.sl.home (Scott Lurndal) wrote: > Stefan Monnier <monnier@iro.umontreal.ca> writes: > >aph@littlepinkcloud.invalid [2026-11-19 09:42:51] wrote: > >> In a way, it does. Most large constants I see are addresses. > >> AArch64 (almost) always has a 48-bit user space, so except for > >> floating-point doubles and the very occasional large integer, > >> constant loads look like > >> > >> mov x0, 42857; movk x0, 0x60b8, lsl 16; movk x0, 0xaaaa, lsl 32 > > > >Interesting. I would have expected that most AArch64 code is > >position independent (e.g. for address space randomization > >purposes), so I wonder in which circumstances we end up with such > >instruction sequences to build hardcoded addresses. > > Consider the case where one is creating the 64-bit address (virtual or > physical) of a hardware component, or a VDSO. The vast majority of hardware addresses are not absolute addresses, but offsets relative to dynamically assigned PCI BARs. Therefore, constants larger than 30 bits are rare. Even 24 bits are uncommon.
Technical Details
Message-ID:
<20261120122630.000017cb@yahoo.com>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!.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> <11d9tq8$1b9c1$2@paganini.bofh.team> <2026Nov14.201017@mips.complang.tuwien.ac.at> <6af911ea.18530156@news.eternal-september.org> <SYScnWsR3rgGWWP3nZ2dnZfqn_WdnZ2d@supernews.com> <jwv1p8hhqmy.fsf-monnier+comp.arch@gnu.org> <7uLLS.701$b6r7.107@fx16.iad>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!.POSTED!not-for-mail From: Michael S <already5chosen@yahoo.com> Newsgroups: comp.arch Subject: Re: Large constants in RISC Date: Fri, 20 Nov 2026 12:26:30 +0200 Organization: A noiseless patient Spider Lines: 24 Message-ID: <20261120122630.000017cb@yahoo.com> 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> <11d9tq8$1b9c1$2@paganini.bofh.team> <2026Nov14.201017@mips.complang.tuwien.ac.at> <6af911ea.18530156@news.eternal-september.org> <SYScnWsR3rgGWWP3nZ2dnZfqn_WdnZ2d@supernews.com> <jwv1p8hhqmy.fsf-monnier+comp.arch@gnu.org> <7uLLS.701$b6r7.107@fx16.iad> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Date: Fri, 20 Nov 2026 10:26:29 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2785104"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+CTtmZmYyJK8pJxtg8SnVQJxVHX2zZtPI="; posting-host="c9277e243488dd36750115eaaca8b400" Cancel-Lock: sha1:YRtTh/18qRXUggFqCl4bizIK4P8= sha256:sn6CMEgPRSmGii2aCFmJZTwr1ZlCtrblcD2U/GNOt2k= sha1:AghHIYSqJ4jkR6VNiE3j/T+B5U8= sha256:hjHdQ28mfcgGndg9YeN8QyR3r1PO+eiHWe9R6KJ5zbk= X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)