🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #845

Re: Large constants in RISC

#845
From: EricP
Date: Fri, 20 Nov 2026 23:17
47 lines
3171 bytes
On 2026-Nov-20 16:01, MitchAlsup wrote:
> EricP <ThatWouldBeTelling@thevillage.com> posted:
> 
>> 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.
>>>
>>>
>>> === Stefan
>>
>> An application or OS can require that certain data structures
>> are mapped at predefined virtual addresses.
>> For example, an OS could define that the page tables are mapped at 0xC00...00.
>> The user mode OS interface could define that an int64 system clock is mapped
>> read-only at a particular virtual address so it can be read without a system call.
> 
> This just gave me an idea::
> 
> a) when walking the page tables (TLB miss)
> b) and you are at the (smallest) page level and you get another PTP
> ...instead of a PTE,
> then
> c) this PTP accesses a PTE which provides for accessing a single
> c.1) Double Word
> or
> c.2) Single line
> 
> Making such access/PTE not blead address space to where it is not desired.
> So, you can access the timer/time but not the surrounding control registers.
> 
> You saw it here first!

I meant the software clock in memory. There are two clocks,
a hardware and a software clock that the OS controls the adjustments
HW clock can drift so OS adjusts its memory copy according to its own algorithm.

Technical Details
Message-ID: <uy4MS.79596$EAo4.22156@fx22.iad>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!panix!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx22.iad.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> <4m2MS.132607$Lt64.106487@fx41.iad> <1795208471-5857@newsgrouper.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!panix!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx22.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Large constants in RISC
Content-Language: en-CA
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>
 <4m2MS.132607$Lt64.106487@fx41.iad> <1795208471-5857@newsgrouper.org>
From: EricP <ThatWouldBeTelling@thevillage.com>
In-Reply-To: <1795208471-5857@newsgrouper.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 47
Message-ID: <uy4MS.79596$EAo4.22156@fx22.iad>
X-Complaints-To: abuse@UsenetServer.com
NNTP-Posting-Date: Fri, 20 Nov 2026 23:17:46 UTC
Date: Fri, 20 Nov 2026 18:17:42 -0500
X-Received-Bytes: 2918