NIR instructions. Somewhat inspired by LLVM's instructions.
Types
Instr = object info*: PackedLineInfo
- Source Edit
Opcode = enum Nop, ImmediateVal, IntVal, StrVal, SymDef, SymUse, Typed, PragmaId, NilVal, Label, Goto, CheckedGoto, LoopLabel, GotoLoop, ModuleSymUse, ArrayConstr, ObjConstr, Ret, Yld, Select, SelectPair, SelectList, SelectValue, SelectRange, ForeignDecl, SummonGlobal, SummonThreadLocal, Summon, SummonResult, SummonParam, SummonConst, Kill, AddrOf, ArrayAt, DerefArrayAt, FieldAt, DerefFieldAt, Load, Store, Asgn, SetExc, TestExc, CheckedRange, CheckedIndex, Call, IndirectCall, CheckedCall, CheckedIndirectCall, CheckedAdd, CheckedSub, CheckedMul, CheckedDiv, CheckedMod, Add, Sub, Mul, Div, Mod, BitShl, BitShr, BitAnd, BitOr, BitXor, BitNot, BoolNot, Eq, Le, Lt, Cast, NumberConv, CheckedObjConv, ObjConv, TestOf, Emit, ProcDecl, ForeignProcDecl, PragmaPair
- Source Edit
Consts
InvalidPatchPos = -1
- Source Edit
ValueProducing = {ImmediateVal, IntVal, StrVal, SymUse, NilVal, ModuleSymUse, ArrayConstr, ObjConstr, CheckedAdd, CheckedSub, CheckedMul, CheckedDiv, CheckedMod, Add, Sub, Mul, Div, Mod, BitShl, BitShr, BitAnd, BitOr, BitXor, BitNot, BoolNot, Eq, Le, Lt, Cast, NumberConv, CheckedObjConv, ObjConv, AddrOf, Load, ArrayAt, DerefArrayAt, FieldAt, DerefFieldAt, TestOf}
- Source Edit
Procs
proc addImmediateVal(t: var Tree; info: PackedLineInfo; x: int) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc addImmediateVal(t: var Value; info: PackedLineInfo; x: int) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc addNewLabel(t: var Tree; labelGen: var int; info: PackedLineInfo; k: Opcode): LabelId {. ...raises: [], tags: [], forbids: [].}
- Source Edit
proc addNop(t: var Tree; info: PackedLineInfo) {.inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
proc addPragmaId(t: var Tree; info: PackedLineInfo; x: PragmaKey) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc escapeToNimLit(s: string; result: var string) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc extractTemp(v: Value): SymId {....raises: [], tags: [], forbids: [].}
- Source Edit
proc immediateVal(ins: Instr): int {.inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
proc localToValue(info: PackedLineInfo; s: SymId): Value {....raises: [], tags: [], forbids: [].}
- Source Edit
Templates
template buildTyped(tree: var Tree; info: PackedLineInfo; kind: Opcode; typ: TypeId; body: untyped)
- Source Edit
template buildTyped(tree: var Value; info: PackedLineInfo; kind: Opcode; typ: TypeId; body: untyped)
- Source Edit
template rawOperand(n: Instr): uint32
- Source Edit