Decouple SLOAD type and optional conversion.

This commit is contained in:
Mike Pall
2010-10-11 21:13:37 +02:00
parent cc62edebfd
commit b3cf2c70f4
5 changed files with 36 additions and 26 deletions

View File

@@ -213,11 +213,17 @@ local colorize, irtype
-- Lookup table to convert some literals into names.
local litname = {
["SLOAD "] = { [0] = "", "I", "R", "RI", "P", "PI", "PR", "PRI",
"T", "IT", "RT", "RIT", "PT", "PIT", "PRT", "PRIT",
"F", "IF", "RF", "RIF", "PF", "PIF", "PRF", "PRIF",
"TF", "ITF", "RTF", "RITF", "PTF", "PITF", "PRTF", "PRITF",
},
["SLOAD "] = setmetatable({}, { __index = function(t, mode)
local s = ""
if band(mode, 1) ~= 0 then s = s.."P" end
if band(mode, 2) ~= 0 then s = s.."F" end
if band(mode, 4) ~= 0 then s = s.."T" end
if band(mode, 8) ~= 0 then s = s.."C" end
if band(mode, 16) ~= 0 then s = s.."R" end
if band(mode, 32) ~= 0 then s = s.."I" end
t[mode] = s
return s
end}),
["XLOAD "] = { [0] = "", "R", "U", "RU", },
["TOINT "] = { [0] = "check", "index", "", },
["FLOAD "] = vmdef.irfield,