Add volatile XLOADs.

This commit is contained in:
Mike Pall 2011-01-19 02:05:12 +01:00
parent 925050fe3f
commit 8407ac0eca
3 changed files with 7 additions and 3 deletions

View File

@ -234,7 +234,7 @@ local litname = {
t[mode] = s
return s
end}),
["XLOAD "] = { [0] = "", "R", "U", "RU", },
["XLOAD "] = { [0] = "", "R", "V", "RV", "U", "RU", "VU", "RVU", },
["CONV "] = setmetatable({}, { __index = function(t, mode)
local s = irtype[band(mode, 31)]
s = irtype[band(shr(mode, 5), 31)].."."..s

View File

@ -206,7 +206,8 @@ IRFLDEF(FLENUM)
/* XLOAD mode, stored in op2. */
#define IRXLOAD_READONLY 1 /* Load from read-only data. */
#define IRXLOAD_UNALIGNED 2 /* Unaligned load. */
#define IRXLOAD_VOLATILE 2 /* Load from volatile data. */
#define IRXLOAD_UNALIGNED 4 /* Unaligned load. */
/* CONV mode, stored in op2. */
#define IRCONV_SRCMASK 0x001f /* Source IRType. */

View File

@ -669,6 +669,8 @@ TRef LJ_FASTCALL lj_opt_fwd_xload(jit_State *J)
if ((fins->op2 & IRXLOAD_READONLY))
goto cselim;
if ((fins->op2 & IRXLOAD_VOLATILE))
goto doemit;
/* Search for conflicting stores. */
ref = J->chain[IR_XSTORE];
@ -721,7 +723,8 @@ cselim:
xr = IR(xref);
goto retry; /* Retry with the reassociated reference. */
}
return lj_ir_emit(J);
doemit:
return EMITFOLD;
}
/* XSTORE elimination. */