move fits_u8 to integer constant (from numberic)

This commit is contained in:
Torsten Ruger
2014-09-17 16:23:29 +03:00
parent 95c7e44342
commit e7f7f9c319
6 changed files with 9 additions and 12 deletions

View File

@@ -35,7 +35,7 @@ module Arm
right = Virtual::IntegerConstant.new( r_pos - self.position - 8 )
end
if (right.is_a?(Virtual::IntegerConstant))
if (right.integer.fits_u8?)
if (right.fits_u8?)
return true
elsif (calculate_u8_with_rr(right))
return true
@@ -63,7 +63,7 @@ module Arm
rn = :pc
end
if (right.is_a?(Virtual::IntegerConstant))
if (right.integer.fits_u8?)
if (right.fits_u8?)
# no shifting needed
operand = right.integer
immediate = 1
@@ -75,7 +75,7 @@ module Arm
operand = right.integer / 256
immediate = 1
# raise "cannot fit numeric literal argument in operand #{right.inspect}"
raise "cannot fit numeric literal argument in operand #{right.inspect}"
end
elsif (right.is_a?(Symbol) or right.is_a?(Virtual::Integer))
operand = reg_code(right) #integer means the register the integer is in (otherwise constant)