parseBiggestFloat is now builtin
This commit is contained in:
parent
396b5619fc
commit
a7911addf7
10 changed files with 309 additions and 95 deletions
|
|
@ -16,7 +16,7 @@ import ast except getstr
|
|||
|
||||
import
|
||||
strutils, astalgo, msgs, vmdef, vmgen, nimsets, types, passes, unsigned,
|
||||
parser, vmdeps, idents, trees, renderer, options, transf
|
||||
parser, vmdeps, idents, trees, renderer, options, transf, parseutils
|
||||
|
||||
from semfold import leValueConv, ordinalValToString
|
||||
from evaltempl import evalTemplate
|
||||
|
|
@ -776,6 +776,18 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
|||
createStr regs[ra]
|
||||
regs[ra].node.strVal = substr(regs[rb].node.strVal,
|
||||
regs[rc].intVal.int, regs[rd].intVal.int)
|
||||
of opcParseFloat:
|
||||
decodeBC(rkInt)
|
||||
inc pc
|
||||
assert c.code[pc].opcode == opcParseFloat
|
||||
let rd = c.code[pc].regA
|
||||
var rcAddr = addr(regs[rc])
|
||||
if rcAddr.kind == rkRegisterAddr: rcAddr = rcAddr.regAddr
|
||||
elif regs[rc].kind != rkFloat:
|
||||
myreset(regs[rc])
|
||||
regs[rc].kind = rkFloat
|
||||
regs[ra].intVal = parseBiggestFloat(regs[rb].node.strVal,
|
||||
rcAddr.floatVal, regs[rd].intVal.int)
|
||||
of opcRangeChck:
|
||||
let rb = instr.regB
|
||||
let rc = instr.regC
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue