97b4c469f8
and their use Arm is confusing as it has result as first arg we use forward logic, i.e. from -> to
16 lines
436 B
Ruby
16 lines
436 B
Ruby
module Arm
|
|
|
|
class TransferImplementation
|
|
def run block
|
|
block.codes.dup.each do |code|
|
|
next unless code.is_a? Register::RegisterTransfer
|
|
# Register machine convention is from => to
|
|
# But arm has the receiver/result as the first
|
|
move = ArmMachine.mov( code.to , code.from)
|
|
block.replace(code , move )
|
|
end
|
|
end
|
|
end
|
|
Virtual.machine.add_pass "Arm::TransferImplementation"
|
|
end
|