mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 15:14:08 +00:00
PPC: Add better diagnostics to DynASM for reg/imm mismatches.
This commit is contained in:
parent
3d17f71968
commit
a36287b218
@ -849,7 +849,7 @@ end
|
|||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
|
||||||
local function parse_gpr(expr)
|
local function parse_gpr(expr)
|
||||||
local tname, ovreg = match(expr, "^([%w_]+):(r[0-9][0-9]?)$")
|
local tname, ovreg = match(expr, "^([%w_]+):(r[1-3]?[0-9])$")
|
||||||
local tp = map_type[tname or expr]
|
local tp = map_type[tname or expr]
|
||||||
if tp then
|
if tp then
|
||||||
local reg = ovreg or tp.reg
|
local reg = ovreg or tp.reg
|
||||||
@ -907,6 +907,9 @@ local function parse_imm(imm, bits, shift, scale, signed)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
werror("out of range immediate `"..imm.."'")
|
werror("out of range immediate `"..imm.."'")
|
||||||
|
elseif match(imm, "^r([1-3]?[0-9])$") or
|
||||||
|
match(imm, "^([%w_]+):(r[1-3]?[0-9])$") then
|
||||||
|
werror("expected immediate operand, got register")
|
||||||
else
|
else
|
||||||
waction("IMM", (signed and 32768 or 0)+scale*1024+bits*32+shift, imm)
|
waction("IMM", (signed and 32768 or 0)+scale*1024+bits*32+shift, imm)
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user