mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-08 15:34:09 +00:00
Added support for I mode instructions
This commit is contained in:
parent
bc490013a3
commit
52ab0596da
@ -494,8 +494,20 @@ local function parse_imm16(imm)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function parse_mask(arg)
|
local function parse_imm8(imm)
|
||||||
local m3 = parse_number(arg)
|
local imm_val = tonumber(imm)
|
||||||
|
if imm_val then
|
||||||
|
if not is_int8(imm_val) then
|
||||||
|
werror("Immediate value out of range: ", imm_val)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
iact = function() waction("IMM8",nil,imm) end
|
||||||
|
end
|
||||||
|
return imm_val, iact
|
||||||
|
end
|
||||||
|
|
||||||
|
local function parse_mask(mask)
|
||||||
|
local m3 = parse_number(mask)
|
||||||
if ((m3 == 1) or (m3 == 0) or ( m3 >=3 and m3 <=7)) then
|
if ((m3 == 1) or (m3 == 0) or ( m3 >=3 and m3 <=7)) then
|
||||||
return m3
|
return m3
|
||||||
else
|
else
|
||||||
@ -503,8 +515,8 @@ local function parse_mask(arg)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function parse_mask2(arg)
|
local function parse_mask2(mask)
|
||||||
local m4 = parse_number(arg)
|
local m4 = parse_number(mask)
|
||||||
if ( m4 >=0 and m4 <=1) then
|
if ( m4 >=0 and m4 <=1) then
|
||||||
return m4
|
return m4
|
||||||
else
|
else
|
||||||
@ -1171,6 +1183,8 @@ map_op = {
|
|||||||
didbr_4 = "0000b3580000RRF-b",
|
didbr_4 = "0000b3580000RRF-b",
|
||||||
-- S mode instructions
|
-- S mode instructions
|
||||||
stfl_1 = "0000b2b10000sS",
|
stfl_1 = "0000b2b10000sS",
|
||||||
|
-- I- mdoe instructions
|
||||||
|
svc_1 = "000000000a00iI",
|
||||||
}
|
}
|
||||||
for cond,c in pairs(map_cond) do
|
for cond,c in pairs(map_cond) do
|
||||||
-- Extended mnemonics for branches.
|
-- Extended mnemonics for branches.
|
||||||
@ -1306,6 +1320,11 @@ local function parse_template(params, template, nparams, pos)
|
|||||||
op2 = op2 + shl(b,12) + d;
|
op2 = op2 + shl(b,12) + d;
|
||||||
wputhw(op2)
|
wputhw(op2)
|
||||||
if a then a() end
|
if a then a() end
|
||||||
|
elseif p =="iI" then
|
||||||
|
local imm_val, a = parse_imm8(params[1])
|
||||||
|
op2 = op2 + imm_val;
|
||||||
|
wputhw(op2);
|
||||||
|
if a then a() end
|
||||||
elseif p == "w" then
|
elseif p == "w" then
|
||||||
local mode, n, s = parse_label(params[1])
|
local mode, n, s = parse_label(params[1])
|
||||||
wputhw(op1)
|
wputhw(op1)
|
||||||
|
Loading…
Reference in New Issue
Block a user