mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-08 15:34:09 +00:00
Fix SI (tm) action parsing.
This commit is contained in:
parent
a8562b7f34
commit
a038a08189
@ -312,6 +312,10 @@ local function is_int8(num)
|
|||||||
return -128 <= num and num < 128
|
return -128 <= num and num < 128
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function is_uint8(num)
|
||||||
|
return 0 <= num and num < 256
|
||||||
|
end
|
||||||
|
|
||||||
-- Split a memory operand of the form d(b) or d(x,b) into d, x and b.
|
-- Split a memory operand of the form d(b) or d(x,b) into d, x and b.
|
||||||
-- If x is not specified then it is 0.
|
-- If x is not specified then it is 0.
|
||||||
local function split_memop(arg)
|
local function split_memop(arg)
|
||||||
@ -510,13 +514,12 @@ end
|
|||||||
local function parse_imm8(imm)
|
local function parse_imm8(imm)
|
||||||
local imm_val = tonumber(imm)
|
local imm_val = tonumber(imm)
|
||||||
if imm_val then
|
if imm_val then
|
||||||
if not is_int8(imm_val) then
|
if not is_int8(imm_val) and not is_uint8(imm_val) then
|
||||||
werror("Immediate value out of range: ", imm_val)
|
werror("Immediate value out of range: ", imm_val)
|
||||||
end
|
end
|
||||||
else
|
return imm_val, nil
|
||||||
iact = function() waction("IMM8",nil,imm) end
|
|
||||||
end
|
end
|
||||||
return imm_val, iact
|
return 0, function() waction("IMM8",nil,imm) end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function parse_mask(mask)
|
local function parse_mask(mask)
|
||||||
|
Loading…
Reference in New Issue
Block a user