[Libre-soc-isa] [Bug 937] instructions for bigint shift and prefix-code encode

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Tue Oct 25 16:26:47 BST 2022


https://bugs.libre-soc.org/show_bug.cgi?id=937

--- Comment #16 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
http://lists.libre-soc.org/pipermail/libre-soc-dev/2022-October/005411.html

the carry chaining version could be (there are a few alternative
definitions):
dsld RT, RA, RB, RC
v = RA
sh = RB % 64
v <<= sh
mask = (1 << sh) - 1
v |= RC & mask
RT = v & (2 ** 64 - 1)
RS = v >> 64

dsrd RT, RA, RB, RC
v = RA << 64
sh = RB % 64
v >>= sh
RS = v & (2 ** 64 - 1)
mask = ~((2 ** 64 - 1) >> sh)
v >>= 64
v |= RC & mask
RT = v

dsld
v <- [0]*XLEN || (RA)
sh <- (RB)[XLEN-6:XLEN-1]
v <<= sh
mask = (1 << sh) - 1
v <- v | (RC & mask) # 
RT = v[XLEN:XLEN*2-1]
RS = v[0:XLEN-1]

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Libre-SOC-ISA mailing list