fix all uses of operators now they are ssa

This commit is contained in:
2020-03-14 12:47:29 +02:00
parent 0cde7c1d0a
commit 4db71c1c03
13 changed files with 49 additions and 47 deletions

View File

@ -186,9 +186,11 @@ module Risc
# create operator instruction for self and add
# doesn't read quite as smoothly as one would like, but better than the compiler version
def op( operator , right)
# result, the third paraameter, may be nil, in which case a register will be generated
# (off coourse using the third parameter makes it look even worse TBC)
def op( operator , right , result = nil)
right = right.to_reg() if(right.is_a?(RegisterSlot))
ret = Risc.op( "operator #{operator}" , operator , self , right)
ret = Risc.op( "operator #{operator}" , operator , self , right , result)
compiler.add_code(ret) if compiler
ret
end