fix all positioned uses as helper (not included anymore)

This commit is contained in:
Torsten Ruger
2017-01-01 21:52:55 +02:00
parent cd474f66f6
commit 0397d4064d
4 changed files with 22 additions and 21 deletions

View File

@ -48,7 +48,7 @@ module Arm
# relative addressing for jumps/calls
# but because of the arm "theoretical" 3- stage pipeline,
# we have to subtract 2 words (fetch/decode)
arg = @first.position - self.position - 8
arg = Positioned.position(@first) - Positioned.position(self) - 8
when Parfait::TypedMethod
# But, for methods, this happens to be the size of the object header,
# so there it balances out, but not blocks

View File

@ -91,7 +91,7 @@ module Arm
(@left.is_a?(Symbol) and !Register::RegisterValue.look_like_reg(@left)))
# do pc relative addressing with the difference to the instuction
# 8 is for the funny pipeline adjustment (ie pointing to fetch and not execute)
right = @left.position - self.position - 8
right = Positioned.position(@left) - Positioned.position(self) - 8
if( (right < 0) && ((opcode == :add) || (opcode == :sub)) )
right *= -1 # this works as we never issue sub only add
set_opcode :sub # so (as we can't change the sign permanently) we can change the opcode