[Libre-soc-bugs] [Bug 730] adapt ALU test cases to include expected results

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Thu Nov 25 08:31:22 GMT 2021


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

--- Comment #55 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
 240             if imm < 0:
 241                 e.intregs[3] = (imm + 2**48)<<16
 242             else:
 243                 e.intregs[3] = imm << 16

can i believe be just:

                 e.intregs[3] = (imm << 16) & ((1<<64)-1)

although this may need checking.  again, this relies on
-ve numbers becoming +ve when &ed.

-1 & 0b11 ==> 0b11 (i.e. not -0b11)

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


More information about the libre-soc-bugs mailing list