Article View: comp.arch
Article #877Re: Large constants in RISC
From: Waldek Hebisch
Date: Sun, 22 Nov 2026 02:36
Date: Sun, 22 Nov 2026 02:36
29 lines
2591 bytes
2591 bytes
Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> On 2026-Nov-19 08:59, Stefan Monnier wrote:
>> 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.
>
> EricP [2026-11-20 15:47:57] wrote:
>> An application or OS can require that certain data structures
>> are mapped at predefined virtual addresses.
>
> I find it hard to believe that these thingies would account for a large
> portion of large constants.
In a Lisp-like system that I use 3 most frequently used addresses
are address of empty list, address of boolean false and
address of boolean true. There is bunch of other constat singleton
things whose addresses are needed, but the 3 above are most
frequent. OTOH they are all allocated within first 2GB of memory,
so 32-bit constants are enough.
--
Waldek Hebisch
Technical Details
Message-ID:
<11dtkfe$3o204$2@paganini.bofh.team>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!paganini.bofh.team!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> <4m2MS.132607$Lt64.106487@fx41.iad> <jwvo6bidgit.fsf-monnier+comp.arch@gnu.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!paganini.bofh.team!not-for-mail
From: antispam@fricas.org (Waldek Hebisch)
Newsgroups: comp.arch
Subject: Re: Large constants in RISC
Date: Sun, 22 Nov 2026 02:36:32 -0000 (UTC)
Organization: bofh.team Usenet service
Message-ID: <11dtkfe$3o204$2@paganini.bofh.team>
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> <4m2MS.132607$Lt64.106487@fx41.iad> <jwvo6bidgit.fsf-monnier+comp.arch@gnu.org>
Injection-Date: Sun, 22 Nov 2026 02:36:32 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="3934212"; mail-complaints-to="usenet@bofh.team"; posting-host="d028f9ad2fa2c51f22dbfed0d81d7daf"; posting-account="69e66f1681224ab92235b464ce7a90b6"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-9-amd64 (x86_64))
X-Postfilter: Postfilter-NG 2026.10.2