Describe the bug
OldRod currently recompiles all REM, SHR, and DIV instructions to the CIL *_Un variants. This works well enough when Shr, Div, and Rem are virtualized since KoiVM doesn't emit any additional code for them. However, if Shr_Un, Div_Un, or Rem_Un are virtualized KoiVM emits a store to the FL register to set the UNSIGNED flag. When this occurs OldRod does not properly handle this flag and rather messy code is produced.
To Reproduce
Devirtualize the same sample file from issue #44.
Expected behavior
OldRod should recompile REM, SHR, and DIV instructions to the regular CIL variants (Rem, Shr, Div). If the UNSIGNED flag is set in FL register before the operation the instructions should be recompiled to the *_Un variants.
Describe the bug OldRod currently recompiles all
REM
,SHR
, andDIV
instructions to the CIL *_Un variants. This works well enough whenShr
,Div
, andRem
are virtualized since KoiVM doesn't emit any additional code for them. However, ifShr_Un
,Div_Un
, orRem_Un
are virtualized KoiVM emits a store to theFL
register to set theUNSIGNED
flag. When this occurs OldRod does not properly handle this flag and rather messy code is produced.To Reproduce Devirtualize the same sample file from issue #44.
Expected behavior OldRod should recompile
REM
,SHR
, andDIV
instructions to the regular CIL variants (Rem
,Shr
,Div
). If theUNSIGNED
flag is set inFL
register before the operation the instructions should be recompiled to the *_Un variants.Screenshots