From 2ca2de7f0ec03a388ec86728847949ed495bdbf4 Mon Sep 17 00:00:00 2001 From: Mike Pall <mike> Date: Tue, 28 Dec 2010 22:05:40 +0100 Subject: Refactoring of conversion ops, part 1: add IR_CONV. --- lib/dump.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/dump.lua') diff --git a/lib/dump.lua b/lib/dump.lua index 08df4e3f..34365360 100644 --- a/lib/dump.lua +++ b/lib/dump.lua @@ -236,6 +236,15 @@ local litname = { return s end}), ["XLOAD "] = { [0] = "", "R", "U", "RU", }, + ["CONV "] = setmetatable({}, { __index = function(t, mode) + local s = irtype[band(mode, 31)] + if band(mode, 0x100) ~= 0 then s = s.." trunc" + elseif band(mode, 0x200) ~= 0 then s = s.." sext" end + local c = shr(mode, 10) + if c == 2 then s = s.." index" elseif c == 3 then s = s.." check" end + t[mode] = s + return s + end}), ["TOINT "] = tointname, ["TOI64 "] = tointname, ["FLOAD "] = vmdef.irfield, -- cgit v1.2.3-55-g6feb