reinserted arm for now, until dependecy is cleaned up. fixed tests

This commit is contained in:
Torsten Ruger
2014-08-30 19:40:37 +03:00
parent eb85bdd494
commit ccb5b37a3c
20 changed files with 1068 additions and 8 deletions

View File

@ -111,7 +111,7 @@ module Register
def initialize result , left , right , options = {}
@result = result
@left = left
@right = right.is_a?(Fixnum) ? IntegerConstant.new(right) : right
@right = right.is_a?(Fixnum) ? Virtual::IntegerConstant.new(right) : right
super(options)
end
attr_accessor :result , :left , :right
@ -149,7 +149,7 @@ module Register
class MoveInstruction < Instruction
def initialize to , from , options = {}
@to = to
@from = from.is_a?(Fixnum) ? IntegerConstant.new(from) : from
@from = from.is_a?(Fixnum) ? Virtual::IntegerConstant.new(from) : from
raise "move must have from set #{inspect}" unless from
super(options)
end

View File

@ -111,7 +111,7 @@ module Register
options = {} if options == nil
options.merge defaults
options[:opcode] = inst
first = Register::Integer.new(first) if first.is_a? Symbol
first = Register::RegisterReference.new(first) if first.is_a? Symbol
clazz.new(first , options)
end
end
@ -122,8 +122,8 @@ module Register
create_method(inst) do |left ,right , options = nil|
options = {} if options == nil
options.merge defaults
left = Register::Integer.new(left) if left.is_a? Symbol
right = Register::Integer.new(right) if right.is_a? Symbol
left = Register::RegisterReference.new(left) if left.is_a? Symbol
right = Register::RegisterReference.new(right) if right.is_a? Symbol
options[:opcode] = inst
clazz.new(left , right ,options)
end
@ -136,9 +136,9 @@ module Register
options = {} if options == nil
options.merge defaults
options[:opcode] = inst
result = Register::Integer.new(result) if result.is_a? Symbol
left = Register::Integer.new(left) if left.is_a? Symbol
right = Register::Integer.new(right) if right.is_a? Symbol
result = Register::RegisterReference.new(result) if result.is_a? Symbol
left = Register::RegisterReference.new(left) if left.is_a? Symbol
right = Register::RegisterReference.new(right) if right.is_a? Symbol
clazz.new(result, left , right ,options)
end
end