rubyx/lib/arm/passes/get_implementation.rb
Torsten Ruger 97b4c469f8 fixing register order in some instructions
and their use
Arm is confusing as it has result as first arg
we use forward logic, i.e. from -> to
2015-06-27 20:09:21 +03:00

16 lines
443 B
Ruby

module Arm
class GetImplementation
def run block
block.codes.dup.each do |code|
next unless code.is_a? Register::GetSlot
# times 4 because arm works in bytes, but vm in words
# + 1 because of the type word
load = ArmMachine.ldr( code.register , code.array , 4 * (code.index + 1) )
block.replace(code , load )
end
end
end
Virtual.machine.add_pass "Arm::GetImplementation"
end