2014-10-05 00:05:18 +02:00
|
|
|
module Arm
|
|
|
|
|
|
|
|
class TransferImplementation
|
|
|
|
def run block
|
|
|
|
block.codes.dup.each do |code|
|
|
|
|
next unless code.is_a? Register::RegisterTransfer
|
2015-06-27 19:09:21 +02:00
|
|
|
# Register machine convention is from => to
|
|
|
|
# But arm has the receiver/result as the first
|
|
|
|
move = ArmMachine.mov( code.to , code.from)
|
2014-10-05 00:05:18 +02:00
|
|
|
block.replace(code , move )
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2015-06-01 07:40:17 +02:00
|
|
|
Virtual.machine.add_pass "Arm::TransferImplementation"
|
2014-10-05 00:05:18 +02:00
|
|
|
end
|