🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #830

Re: Large constants in RISC

#830
From: Anton Ertl
Date: Fri, 20 Nov 2026 16:01
21 lines
2320 bytes
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.

You can support ASLR without PIC when you generate your code at
run-time (i.e., a load-and-go or JIT compiler).

- anton
-- 
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
  Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
Technical Details
Message-ID: <2026Nov20.170131@mips.complang.tuwien.ac.at>
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
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>

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: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: Large constants in RISC
Date: Fri, 20 Nov 2026 16:01:31 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 21
Message-ID: <2026Nov20.170131@mips.complang.tuwien.ac.at>
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>
Injection-Date: Fri, 20 Nov 2026 16:05:03 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3474693"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18N+hK8sYV2WBlU14wORSpC"; posting-host="0a06324a2c9cb3ce4cb3c9eabedef5b7"
Cancel-Lock: sha1:UwDWcVd8YNpNmPopGNT3R2PvM3Q= sha256:3OZ/s9qHsy/PrxHWukGuJfxY1fbJoqiioV2Vuv483mM=
	sha1:n2zPGqqkZMqHr4xbBBqgLqC5UaY= sha256:jAxunuC3Kz4sMo3fsIK5/4hEhBjNXeWjXLcPnpzaRwY=
X-newsreader: xrn 10.11