Vm bitops fixes (#10520)

This commit is contained in:
Arne Döring 2019-02-05 09:31:37 +01:00 • committed by Andreas Rumpf
commit 824f39b32e
5 changed files with 47 additions and 62 deletions

View file

@ -1264,6 +1264,11 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
of opcNarrowU:
decodeB(rkInt)
regs[ra].intVal = regs[ra].intVal and ((1'i64 shl rb)-1)
of opcSignExtend:
# like opcNarrowS, but no out of range possible
decodeB(rkInt)
let imm = 64 - rb
regs[ra].intVal = ashr(regs[ra].intVal shl imm, imm)
of opcIsNil:
decodeB(rkInt)
let node = regs[rb].node