mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-08 15:34:09 +00:00
Updated the memory parsing
It accepts 2 registers, without the displacement
This commit is contained in:
parent
86e5e57f4c
commit
6bbfa48b93
@ -324,6 +324,11 @@ local function split_memop(arg)
|
|||||||
if d then
|
if d then
|
||||||
return d, 0, parse_reg(b)
|
return d, 0, parse_reg(b)
|
||||||
end
|
end
|
||||||
|
-- Assuming the two registers are passed as "(r1,r2)", and displacement(d) is not specified
|
||||||
|
local x, b = string.match(arg,"%(%s*("..reg..")%s*,%s*("..reg..")%s*%)$")
|
||||||
|
if b then
|
||||||
|
return 0, parse_reg(x), parse_reg(b)
|
||||||
|
end
|
||||||
local reg, tailr = match(arg, "^([%w_:]+)%s*(.*)$")
|
local reg, tailr = match(arg, "^([%w_:]+)%s*(.*)$")
|
||||||
if reg then
|
if reg then
|
||||||
local r, tp = parse_reg(reg)
|
local r, tp = parse_reg(reg)
|
||||||
@ -332,7 +337,7 @@ local function split_memop(arg)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- TODO: handle values without registers?
|
-- TODO: handle values without registers?
|
||||||
-- TODO: handle registers without a displacement?
|
-- TODO: handle registers without a displacement? -- done, above ,needs to be tested
|
||||||
werror("bad memory operand: "..arg)
|
werror("bad memory operand: "..arg)
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user