🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #851

Re: Large constants in RISC

#851
From: aph
Date: Sat, 21 Nov 2026 10:38
20 lines
2447 bytes
Stefan Monnier <monnier@iro.umontreal.ca> 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.

One other thing: even though this address is in the instruction
stream, it's not fixed: its target gets moved by garbage collection,
and of course the collector has to rewrite these instructions as it
goes along.

Andrew.
Technical Details
Message-ID: <PSmdnUEArIMo6Zz2nZ2dnZfqnPqdnZ2d@supernews.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-4.nntp.ord.giganews.com!nntp.supernews.com!news.supernews.com.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!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-4.nntp.ord.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 21 Nov 2026 10:38:45 +0000
Sender: Andrew Haley <aph@li-f2cf9ecc-3241-11b2-a85c-b613f11f80f0.ibm.com>
From: aph@littlepinkcloud.invalid
Subject: Re: Large constants in RISC
Newsgroups: comp.arch
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>
User-Agent: tin/1.9.2-20070201 ("Dalaruan") (UNIX) (Linux/7.3.3-100.fc43.x86_64 (x86_64))
Message-ID: <PSmdnUEArIMo6Zz2nZ2dnZfqnPqdnZ2d@supernews.com>
Date: Sat, 21 Nov 2026 10:38:45 +0000
Lines: 20
X-Trace: sv3-toMFOuDN/4c0fqchkiA0XhJ0BNH/xnqO+X/qhv9ksnN3rZZXvBOG6hBbnPcFy7GJDOmiIDuRym5vvTZ!hHwPS5Zv1emEqQ5k6M+YgYGazdUg4tfiDE2JYu6aAcBUBZNWbSvCdblyHN1Gdr3G0p1ihZcQt239!wAD/NkIKSweo
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40