🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #779

Re: Large constants in RISC

#779
From: MitchAlsup
Date: Mon, 16 Nov 2026 18:50
33 lines
2096 bytes
EricP <ThatWouldBeTelling@thevillage.com> posted:

> On 2026-Nov-15 11:08, Anton Ertl wrote:
--------------
> If I was using the constant table approach I would:
> 
> - define for LD and ST instructions that if the base register was
>    the zero register (R0 or R31) then it means use the 64-bit RIP.

I used Rbase == R0 -> IP
 
> - add scaled index LD and ST instructions with the following format:
>    opcode 6b Rs1_base 5b Rs2_index 5b Rd/Rs3 5b data_type 3b scale 3b offset 5b
>    Data types are signed integer: B, H, W, L  float: S, D

I used Rindex == R0 -> no indexing
 
> This can access anywhere in 64b address space in 2 instructions:

I can access anywhere in 64-bit VAS in 1 instruction.

> - use a small RIPrel offset to load the 64b RIPrel offset from the table
> = use the scaled index LD/ST with scale = 0, index = offset, and base RIP
>    to address all of memory.
> 
> For RIP-relative 64b addressing:
> 
>    LD.L  r1 = [RIP + table_offset]
>    LD.dt r2 = [RIP + r1<<0]

     LDs   Rd,[Rbase,Rindex<<s,#table_offset]
 
Technical Details
Message-ID: <1794855044-5857@newsgrouper.org>
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!newsgrouper.org!.POSTED!not-for-mail
References: <11d76uq$11cdc$1@paganini.bofh.team> <11d9d0d$1rsce$1@dont-email.me> <11d9tq8$1b9c1$2@paganini.bofh.team> <11dabct$26fdl$1@dont-email.me> <11dahac$2t74$1@gal.iecc.com> <11dakku$29j9n$1@dont-email.me> <2026Nov15.170804@mips.complang.tuwien.ac.at> <JunKS.106396$Cm3.49782@fx47.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!newsgrouper.org!.POSTED!not-for-mail
From: MitchAlsup <user5857@newsgrouper.org.invalid>
Newsgroups: comp.arch
Subject: Re: Large constants in RISC
References: <11d76uq$11cdc$1@paganini.bofh.team>
  <11d9d0d$1rsce$1@dont-email.me> <11d9tq8$1b9c1$2@paganini.bofh.team>
  <11dabct$26fdl$1@dont-email.me> <11dahac$2t74$1@gal.iecc.com>
  <11dakku$29j9n$1@dont-email.me> <2026Nov15.170804@mips.complang.tuwien.ac.at> <JunKS.106396$Cm3.49782@fx47.iad>
Date: Mon, 16 Nov 2026 18:50:44 GMT
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Message-ID: <1794855044-5857@newsgrouper.org>
Injection-Info: newsgrouper.org; mail-complaints-to="newsgrouper@yahoo.com"; posting-account=user5857
Injection-Date: Mon, 16 Nov 2026 18:50:44 GMT
User-Agent: Newsgrouper/0.9.0