increase binary_code size to 32

save a few jump, adds some size to binary
16 just seemed kind of small
This commit is contained in:
2019-08-22 12:26:40 +03:00
parent 064bb2f90f
commit 5dc8c046e7
27 changed files with 318 additions and 311 deletions

View File

@ -13,32 +13,32 @@ module Risc
#show_main_ticks # get output of what is
check_main_chain [LoadConstant, SlotToReg, RegToSlot, LoadConstant, SlotToReg,
SlotToReg, SlotToReg, SlotToReg, OperatorInstruction, IsZero, # 10
SlotToReg, SlotToReg, SlotToReg, Branch, LoadConstant,
RegToSlot, LoadConstant, LoadConstant, SlotToReg, SlotToReg, # 20
LoadConstant, OperatorInstruction, IsZero, SlotToReg, OperatorInstruction,
IsZero, SlotToReg, Branch, Branch, LoadConstant, # 30
SlotToReg, SlotToReg, SlotToReg, LoadConstant, RegToSlot,
LoadConstant, LoadConstant, SlotToReg, SlotToReg, LoadConstant, # 20
OperatorInstruction, IsZero, SlotToReg, OperatorInstruction, IsZero,
SlotToReg, Branch, Branch, LoadConstant, OperatorInstruction, # 40
IsZero, SlotToReg, OperatorInstruction, IsZero, SlotToReg,
Branch, Branch, LoadConstant, OperatorInstruction, IsZero, # 50
SlotToReg, Branch, LoadConstant, OperatorInstruction, IsZero, # 30
SlotToReg, OperatorInstruction, IsZero, SlotToReg, Branch,
Branch, LoadConstant, OperatorInstruction, IsZero, SlotToReg, # 60
OperatorInstruction, IsZero, SlotToReg, Branch, Branch,
LoadConstant, OperatorInstruction, IsZero, SlotToReg, OperatorInstruction, # 70
IsZero, RegToSlot, LoadConstant, SlotToReg, LoadConstant,
Branch, SlotToReg, SlotToReg, RegToSlot, RegToSlot, # 80
LoadConstant, OperatorInstruction, IsZero, SlotToReg, OperatorInstruction, # 40
IsZero, SlotToReg, Branch, LoadConstant, OperatorInstruction,
IsZero, SlotToReg, OperatorInstruction, IsZero, SlotToReg, # 50
Branch, LoadConstant, OperatorInstruction, IsZero, SlotToReg,
OperatorInstruction, IsZero, SlotToReg, Branch, LoadConstant, # 60
OperatorInstruction, IsZero, SlotToReg, OperatorInstruction, IsZero,
RegToSlot, LoadConstant, SlotToReg, LoadConstant, SlotToReg, # 70
SlotToReg, RegToSlot, RegToSlot, RegToSlot, RegToSlot,
SlotToReg, SlotToReg, SlotToReg, RegToSlot, LoadConstant, # 80
SlotToReg, RegToSlot, SlotToReg, LoadConstant, SlotToReg,
DynamicJump, LoadConstant, SlotToReg, LoadConstant, OperatorInstruction, # 90
IsNotZero, SlotToReg, RegToSlot, SlotToReg, SlotToReg,
LoadData, OperatorInstruction, Branch, RegToSlot, RegToSlot, # 100
SlotToReg, SlotToReg, RegToSlot, LoadConstant, SlotToReg,
RegToSlot, RegToSlot, SlotToReg, SlotToReg, SlotToReg, # 110
FunctionReturn, SlotToReg, RegToSlot, Branch, Branch,
SlotToReg, SlotToReg, RegToSlot, LoadConstant, SlotToReg, # 120
RegToSlot, RegToSlot, SlotToReg, SlotToReg, SlotToReg,
RegToSlot, LoadConstant, SlotToReg, RegToSlot, Branch, # 90
SlotToReg, LoadConstant, SlotToReg, DynamicJump, LoadConstant,
SlotToReg, LoadConstant, OperatorInstruction, IsNotZero, SlotToReg, # 100
RegToSlot, SlotToReg, Branch, SlotToReg, LoadData,
OperatorInstruction, RegToSlot, RegToSlot, SlotToReg, SlotToReg, # 110
RegToSlot, LoadConstant, SlotToReg, RegToSlot, RegToSlot,
SlotToReg, Branch, SlotToReg, SlotToReg, FunctionReturn, # 120
SlotToReg, RegToSlot, Branch, SlotToReg, SlotToReg,
RegToSlot, LoadConstant, SlotToReg, RegToSlot, Branch, # 130
RegToSlot, SlotToReg, SlotToReg, SlotToReg, FunctionReturn,
Transfer, SlotToReg, SlotToReg, Syscall, NilClass, ]# 140
FunctionReturn, Transfer, SlotToReg, SlotToReg, Syscall, # 130
NilClass, ]
assert_equal ::Integer , get_return.class
assert_equal 1 , get_return
end
@ -55,17 +55,17 @@ module Risc
end
def test_dyn
cal = main_ticks(94)
cal = main_ticks(86)
assert_equal DynamicJump , cal.class
end
def test_return
ret = main_ticks(135)
ret = main_ticks(126)
assert_equal FunctionReturn , ret.class
link = @interpreter.get_register( ret.register )
assert_equal ::Integer , link.class
end
def test_sys
sys = main_ticks(139)
sys = main_ticks(130)
assert_equal Syscall , sys.class
end
end