[Libre-soc-isa] [Bug 968] document shift-and-add instruction

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Tue Nov 1 18:27:22 GMT 2022


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

--- Comment #10 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Andrey Miroshnikov from comment #9)

> The pseudocode of shadd doesn't indicate that it is **signed**, 

64-bit on both operands, it makes no difference whatsoever.

> therefore why have shadduw?

compare:

   ADD( RA, SIGNEXTEND( LOWERHALF(RB) )

with:

   ADD( RA, ZEROEXTEND( LOWERHALF(RB) )

then set RB=0x0000_0000_8000_0000 and compare the two.

> Second line of shadduw pseudocode:
> n <- (RB)[XLEN/2:XLEN-1]  # btw we agreed on not using XLEN in RFCs for now?

in RFCs markdown pseudocode yes
in markdown pseudocode used by ISACaller *no*.

> With XLEN=64, this would be (RB)[32:63], or the lower half (MSB ordering?).

yep.

> Why ignore bits (RB)[0:31]?

because it is more compact when doing address offsets.  takes up less
space.  RA base 64 bit, offsets into data structure need only be 32bit.

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


More information about the Libre-SOC-ISA mailing list