[Libre-soc-isa] [Bug 960] OPF ISA External RFC ls003 - maddedu and divmod2du

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sun Nov 13 05:10:36 GMT 2022


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

--- Comment #7 from Jacob Lifshay <programmerjake at gmail.com> ---
if ls003 isn't submitted yet, we should add maddedus (unsigned bigint * signed
word).
https://bugs.libre-soc.org/show_bug.cgi?id=817#c56
and also potentially both muledsbu (signed bigint * unsigned word) and muledsbs
(signed bigint * signed word) if it can be made to work with signed bigints --
i have an idea for that...more about that below:

i was thinking about what I said in
https://bugs.libre-soc.org/show_bug.cgi?id=817#c57 and think I have a solution
-- basically corrections could be applied to RC to account for the previous
multiplication being signed when it shouldn't -- not just adding RC, hence not
naming madd*.
 if encoding space is an issue, imho Rc should be removed from dsld/dsrd as
that is imho much less useful.

all 4 sign combinations of mule/madde are needed because only the msb word in a
signed bigint is signed, lower words are always unsigned.

signed a * signed b:
                       a
  lsb        word 0    word 1    word 2   msb
  word 0     u*u       u*u       s*u          sv.muledsbu
b word 1     u*u       u*u       s*u          sv.muledsbu
  word 2     u*s       u*s       s*s          sv.muledsbs
  msb

unsigned a * signed b:
                       a
  lsb        word 0    word 1    word 2   msb
  word 0     u*u       u*u       u*u          sv.maddedu
b word 1     u*u       u*u       u*u          sv.maddedu
  word 2     u*s       u*s       u*s          sv.maddedus
  msb

unsigned a * unsigned b:
                       a
  lsb        word 0    word 1    word 2   msb
  word 0     u*u       u*u       u*u          sv.maddedu
b word 1     u*u       u*u       u*u          sv.maddedu
  word 2     u*u       u*u       u*u          sv.maddedu
  msb

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


More information about the Libre-SOC-ISA mailing list