Suggestions-and-Issues icon indicating copy to clipboard operation
Suggestions-and-Issues copied to clipboard

[Bug]: [ALPHA] LSR fails for negative numbers <64bit in ISA spec

Open altrag opened this issue 11 months ago • 0 comments

Discord Thread

https://discord.com/channels/828292123936948244/1329700176453173310

What happened?

If we use the definition:

lsr %a:S16(immediate), %b(immediate)
%c:S16 = %a >> %b
cccccccc cccccccc

and the instruction lsr -1, 1, it produces the error "Value 9223372036854775807 outside of range for this 16-bit operand".
If we instead use %c:S64, the error changes slightly to "Value 9223372036854775807 outside of range for this 16-bit sign-extended field". If we additionally extend the output pattern to a full 64 c's then it works, but of course that's not always what we want! The correct output is 32767.

Version

0.1353 Beta

What OSes are you seeing the problem on?

Windows

Relevant debug.log output, search next to the exectuable


altrag avatar Jan 17 '25 06:01 altrag