diff options
author | Araq <rumpf_a@web.de> | 2013-10-29 16:47:40 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-10-29 16:47:40 +0100 |
commit | be452636239d1508b867e2b0624f3f07f7867e0b (patch) | |
tree | e68bdc303f724de66b7c73aa84ebb7c3aadd9f1e /compiler/vmdef.nim | |
parent | b4e25a6372ffed291ccbba6874723baa55fa0bf9 (diff) | |
download | Nim-be452636239d1508b867e2b0624f3f07f7867e0b.tar.gz |
jump optimizer works
Diffstat (limited to 'compiler/vmdef.nim')
-rw-r--r-- | compiler/vmdef.nim | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/vmdef.nim b/compiler/vmdef.nim index f91b8a821..16ba1ed8e 100644 --- a/compiler/vmdef.nim +++ b/compiler/vmdef.nim @@ -201,3 +201,5 @@ template regA*(x: TInstr): TRegister {.immediate.} = TRegister(x.uint32 shr 8'u3 template regB*(x: TInstr): TRegister {.immediate.} = TRegister(x.uint32 shr 16'u32 and 0xff'u32) template regC*(x: TInstr): TRegister {.immediate.} = TRegister(x.uint32 shr 24'u32) template regBx*(x: TInstr): int {.immediate.} = (x.uint32 shr 16'u32).int + +template jmpDiff*(x: TInstr): int {.immediate.} = regBx(x) - wordExcess |