mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-27 02:46:29 +00:00
Fix vm signed xor (#10519)
* fix #10482 * undo changes * fix for bitwise not * remove dead opcode
This commit is contained in:
committed by
Andreas Rumpf
parent
1d5437e9d2
commit
b80dbdb77d
@@ -1009,7 +1009,7 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest; m: TMagic) =
|
||||
of mLtPtr, mLtU, mLtU64: genBinaryABC(c, n, dest, opcLtu)
|
||||
of mEqProc, mEqRef, mEqUntracedRef:
|
||||
genBinaryABC(c, n, dest, opcEqRef)
|
||||
of mXor: genBinaryABCnarrowU(c, n, dest, opcXor)
|
||||
of mXor: genBinaryABC(c, n, dest, opcXor)
|
||||
of mNot: genUnaryABC(c, n, dest, opcNot)
|
||||
of mUnaryMinusI, mUnaryMinusI64:
|
||||
genUnaryABC(c, n, dest, opcUnaryMinusInt)
|
||||
@@ -1018,7 +1018,10 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest; m: TMagic) =
|
||||
of mUnaryPlusI, mUnaryPlusF64: gen(c, n.sons[1], dest)
|
||||
of mBitnotI:
|
||||
genUnaryABC(c, n, dest, opcBitnotInt)
|
||||
genNarrowU(c, n, dest)
|
||||
#genNarrowU modified, do not narrow signed types
|
||||
let t = skipTypes(n.typ, abstractVar-{tyTypeDesc})
|
||||
if t.kind in {tyUInt8..tyUInt32} or (t.kind == tyUInt and t.size < 8):
|
||||
c.gABC(n, opcNarrowU, dest, TRegister(t.size*8))
|
||||
of mToFloat, mToBiggestFloat, mToInt,
|
||||
mToBiggestInt, mCharToStr, mBoolToStr, mIntToStr, mInt64ToStr,
|
||||
mFloatToStr, mCStrToStr, mStrToStr, mEnumToStr:
|
||||
|
||||
Reference in New Issue
Block a user