[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 20:19:43 GMT 2022


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

--- Comment #18 from Andrey Miroshnikov <andrey at technepisteme.xyz> ---
(In reply to Luke Kenneth Casson Leighton from comment #14)
> no it does not.
> 
> > There is no explicit sign-extension in the pseudocode.
> 
> correct.  if the desired behaviour was to perform a signed 32bit add
> then not only would EXTS be used, the instruction would be called "shaddsw"
> (or sigh shaddws)

Then why did you give me an example with SIGNEXTEND and ZEROEXTEND, if they are
not relevant?
A lot of my confusion comes from the naming of these two instructions.

Is there a good reason as to why shadduw uses "uw" (Unsigned Word)?

Since both shadd and shadduw are unsigned, you're putting emphasis on the
shadduw being unsigned.
Of course shadduw also deals with a "word" so unsigned is probably necessary
here.

While shadd does not imply the operation deals with unsigned or signed
integers.

(In reply to Dmitry Selyutin from comment #17)
> Andrey handles this task, if I got it correctly. :-)

Doing ls004, though I did add the initial pseudocode as well.
If yours is working, where can I find it?
I guess you just stored "sm" first "shift <- sm" to ensure there wouldn't be
overflow problems?

(Our IRC chat on the overflow problem:
https://libre-soc.org/irclog/latest.log.html#t2022-11-01T19:36:54)

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


More information about the Libre-SOC-ISA mailing list