Rename LIR opcodes in LIR.h (bug 557887, r=nnethercote+)

Mechanically renamed using rename_LIR.pl, backed out the alias patch hunks,
and updated the pointer-sized aliases to use the new opcodes instead of
PTR_SIZE macros using old opcodes.

--HG--
extra : convert_revision : 944433df375988c65313759440ed1de757ab4ea8
This commit is contained in:
Edwin Smith 2010-04-16 19:20:24 -04:00
Родитель 0c4a60c68a
Коммит a91f19d4db
1 изменённых файлов: 99 добавлений и 99 удалений

Просмотреть файл

@ -270,64 +270,64 @@ namespace nanojit
LIR_callh = LIR_hcalll, LIR_callh = LIR_hcalll,
#endif #endif
LIR_param = PTR_SIZE(LIR_iparam, LIR_qparam), LIR_param = LIR_paramp,
LIR_alloc = PTR_SIZE(LIR_ialloc, LIR_qalloc), LIR_alloc = LIR_allocp,
LIR_pret = PTR_SIZE(LIR_ret, LIR_qret), LIR_pret = LIR_retp,
LIR_plive = PTR_SIZE(LIR_live, LIR_qlive), LIR_plive = LIR_livep,
LIR_stpi = PTR_SIZE(LIR_sti, LIR_stqi), LIR_stpi = LIR_stp,
LIR_pcall = PTR_SIZE(LIR_icall, LIR_qcall), LIR_pcall = LIR_callp,
LIR_peq = PTR_SIZE(LIR_eq, LIR_qeq), LIR_peq = LIR_eqp,
LIR_plt = PTR_SIZE(LIR_lt, LIR_qlt), LIR_plt = LIR_ltp,
LIR_pgt = PTR_SIZE(LIR_gt, LIR_qgt), LIR_pgt = LIR_gtp,
LIR_ple = PTR_SIZE(LIR_le, LIR_qle), LIR_ple = LIR_lep,
LIR_pge = PTR_SIZE(LIR_ge, LIR_qge), LIR_pge = LIR_gep,
LIR_pult = PTR_SIZE(LIR_ult, LIR_qult), LIR_pult = LIR_ltup,
LIR_pugt = PTR_SIZE(LIR_ugt, LIR_qugt), LIR_pugt = LIR_gtup,
LIR_pule = PTR_SIZE(LIR_ule, LIR_qule), LIR_pule = LIR_leup,
LIR_puge = PTR_SIZE(LIR_uge, LIR_quge), LIR_puge = LIR_geup,
LIR_piadd = PTR_SIZE(LIR_add, LIR_qiadd), LIR_piadd = LIR_addp,
LIR_piand = PTR_SIZE(LIR_and, LIR_qiand), LIR_piand = LIR_andp,
LIR_pior = PTR_SIZE(LIR_or, LIR_qior), LIR_pior = LIR_orp,
LIR_pxor = PTR_SIZE(LIR_xor, LIR_qxor), LIR_pxor = LIR_xorp,
LIR_pilsh = PTR_SIZE(LIR_lsh, LIR_qilsh), LIR_pilsh = LIR_lshp,
LIR_pirsh = PTR_SIZE(LIR_rsh, LIR_qirsh), LIR_pirsh = LIR_rshp,
LIR_pursh = PTR_SIZE(LIR_ush, LIR_qursh), LIR_pursh = LIR_rshup,
LIR_pcmov = PTR_SIZE(LIR_cmov, LIR_qcmov) LIR_pcmov = LIR_cmovp,
}; };
// 32-bit integer comparisons must be contiguous, as must 64-bit integer // 32-bit integer comparisons must be contiguous, as must 64-bit integer
// comparisons and 64-bit float comparisons. // comparisons and 64-bit float comparisons.
NanoStaticAssert(LIR_eq + 1 == LIR_lt && NanoStaticAssert(LIR_eql + 1 == LIR_ltl &&
LIR_eq + 2 == LIR_gt && LIR_eql + 2 == LIR_gtl &&
LIR_eq + 3 == LIR_le && LIR_eql + 3 == LIR_lel &&
LIR_eq + 4 == LIR_ge && LIR_eql + 4 == LIR_gel &&
LIR_eq + 5 == LIR_ult && LIR_eql + 5 == LIR_ltul &&
LIR_eq + 6 == LIR_ugt && LIR_eql + 6 == LIR_gtul &&
LIR_eq + 7 == LIR_ule && LIR_eql + 7 == LIR_leul &&
LIR_eq + 8 == LIR_uge); LIR_eql + 8 == LIR_geul);
#ifdef NANOJIT_64BIT #ifdef NANOJIT_64BIT
NanoStaticAssert(LIR_qeq + 1 == LIR_qlt && NanoStaticAssert(LIR_eqq + 1 == LIR_ltq &&
LIR_qeq + 2 == LIR_qgt && LIR_eqq + 2 == LIR_gtq &&
LIR_qeq + 3 == LIR_qle && LIR_eqq + 3 == LIR_leq &&
LIR_qeq + 4 == LIR_qge && LIR_eqq + 4 == LIR_geq &&
LIR_qeq + 5 == LIR_qult && LIR_eqq + 5 == LIR_ltuq &&
LIR_qeq + 6 == LIR_qugt && LIR_eqq + 6 == LIR_gtuq &&
LIR_qeq + 7 == LIR_qule && LIR_eqq + 7 == LIR_leuq &&
LIR_qeq + 8 == LIR_quge); LIR_eqq + 8 == LIR_geuq);
#endif #endif
NanoStaticAssert(LIR_feq + 1 == LIR_flt && NanoStaticAssert(LIR_eqd + 1 == LIR_ltd &&
LIR_feq + 2 == LIR_fgt && LIR_eqd + 2 == LIR_gtd &&
LIR_feq + 3 == LIR_fle && LIR_eqd + 3 == LIR_led &&
LIR_feq + 4 == LIR_fge); LIR_eqd + 4 == LIR_ged);
// Various opcodes must be changeable to their opposite with op^1 // Various opcodes must be changeable to their opposite with op^1
// (although we use invertXyz() when possible, ie. outside static // (although we use invertXyz() when possible, ie. outside static
@ -336,20 +336,20 @@ namespace nanojit
NanoStaticAssert((LIR_xt^1) == LIR_xf && (LIR_xf^1) == LIR_xt); NanoStaticAssert((LIR_xt^1) == LIR_xf && (LIR_xf^1) == LIR_xt);
NanoStaticAssert((LIR_lt^1) == LIR_gt && (LIR_gt^1) == LIR_lt); NanoStaticAssert((LIR_ltl^1) == LIR_gtl && (LIR_gtl^1) == LIR_ltl);
NanoStaticAssert((LIR_le^1) == LIR_ge && (LIR_ge^1) == LIR_le); NanoStaticAssert((LIR_lel^1) == LIR_gel && (LIR_gel^1) == LIR_lel);
NanoStaticAssert((LIR_ult^1) == LIR_ugt && (LIR_ugt^1) == LIR_ult); NanoStaticAssert((LIR_ltul^1) == LIR_gtul && (LIR_gtul^1) == LIR_ltul);
NanoStaticAssert((LIR_ule^1) == LIR_uge && (LIR_uge^1) == LIR_ule); NanoStaticAssert((LIR_leul^1) == LIR_geul && (LIR_geul^1) == LIR_leul);
#ifdef NANOJIT_64BIT #ifdef NANOJIT_64BIT
NanoStaticAssert((LIR_qlt^1) == LIR_qgt && (LIR_qgt^1) == LIR_qlt); NanoStaticAssert((LIR_ltq^1) == LIR_gtq && (LIR_gtq^1) == LIR_ltq);
NanoStaticAssert((LIR_qle^1) == LIR_qge && (LIR_qge^1) == LIR_qle); NanoStaticAssert((LIR_leq^1) == LIR_geq && (LIR_geq^1) == LIR_leq);
NanoStaticAssert((LIR_qult^1) == LIR_qugt && (LIR_qugt^1) == LIR_qult); NanoStaticAssert((LIR_ltuq^1) == LIR_gtuq && (LIR_gtuq^1) == LIR_ltuq);
NanoStaticAssert((LIR_qule^1) == LIR_quge && (LIR_quge^1) == LIR_qule); NanoStaticAssert((LIR_leuq^1) == LIR_geuq && (LIR_geuq^1) == LIR_leuq);
#endif #endif
NanoStaticAssert((LIR_flt^1) == LIR_fgt && (LIR_fgt^1) == LIR_flt); NanoStaticAssert((LIR_ltd^1) == LIR_gtd && (LIR_gtd^1) == LIR_ltd);
NanoStaticAssert((LIR_fle^1) == LIR_fge && (LIR_fge^1) == LIR_fle); NanoStaticAssert((LIR_led^1) == LIR_ged && (LIR_ged^1) == LIR_led);
struct GuardRecord; struct GuardRecord;
@ -566,39 +566,39 @@ namespace nanojit
inline bool isRetOpcode(LOpcode op) { inline bool isRetOpcode(LOpcode op) {
return return
#if defined NANOJIT_64BIT #if defined NANOJIT_64BIT
op == LIR_qret || op == LIR_retq ||
#endif #endif
op == LIR_ret || op == LIR_fret; op == LIR_retl || op == LIR_retd;
} }
inline bool isCmovOpcode(LOpcode op) { inline bool isCmovOpcode(LOpcode op) {
return return
#if defined NANOJIT_64BIT #if defined NANOJIT_64BIT
op == LIR_qcmov || op == LIR_cmovq ||
#endif #endif
op == LIR_cmov; op == LIR_cmovl;
} }
inline bool isICmpOpcode(LOpcode op) { inline bool isICmpOpcode(LOpcode op) {
return LIR_eq <= op && op <= LIR_uge; return LIR_eql <= op && op <= LIR_geul;
} }
inline bool isSICmpOpcode(LOpcode op) { inline bool isSICmpOpcode(LOpcode op) {
return LIR_eq <= op && op <= LIR_ge; return LIR_eql <= op && op <= LIR_gel;
} }
inline bool isUICmpOpcode(LOpcode op) { inline bool isUICmpOpcode(LOpcode op) {
return LIR_eq == op || (LIR_ult <= op && op <= LIR_uge); return LIR_eql == op || (LIR_ltul <= op && op <= LIR_geul);
} }
#ifdef NANOJIT_64BIT #ifdef NANOJIT_64BIT
inline bool isQCmpOpcode(LOpcode op) { inline bool isQCmpOpcode(LOpcode op) {
return LIR_qeq <= op && op <= LIR_quge; return LIR_eqq <= op && op <= LIR_geuq;
} }
inline bool isSQCmpOpcode(LOpcode op) { inline bool isSQCmpOpcode(LOpcode op) {
return LIR_qeq <= op && op <= LIR_qge; return LIR_eqq <= op && op <= LIR_geq;
} }
inline bool isUQCmpOpcode(LOpcode op) { inline bool isUQCmpOpcode(LOpcode op) {
return LIR_qeq == op || (LIR_qult <= op && op <= LIR_quge); return LIR_eqq == op || (LIR_ltuq <= op && op <= LIR_geuq);
} }
#endif #endif
inline bool isFCmpOpcode(LOpcode op) { inline bool isFCmpOpcode(LOpcode op) {
return LIR_feq <= op && op <= LIR_fge; return LIR_eqd <= op && op <= LIR_ged;
} }
inline LOpcode invertCondJmpOpcode(LOpcode op) { inline LOpcode invertCondJmpOpcode(LOpcode op) {
@ -625,14 +625,14 @@ namespace nanojit
} }
inline LOpcode getCallOpcode(const CallInfo* ci) { inline LOpcode getCallOpcode(const CallInfo* ci) {
LOpcode op = LIR_pcall; LOpcode op = LIR_callp;
switch (ci->returnType()) { switch (ci->returnType()) {
case ARGTYPE_V: op = LIR_pcall; break; case ARGTYPE_V: op = LIR_callp; break;
case ARGTYPE_I: case ARGTYPE_I:
case ARGTYPE_U: op = LIR_icall; break; case ARGTYPE_U: op = LIR_calll; break;
case ARGTYPE_F: op = LIR_fcall; break; case ARGTYPE_F: op = LIR_calld; break;
#ifdef NANOJIT_64BIT #ifdef NANOJIT_64BIT
case ARGTYPE_Q: op = LIR_qcall; break; case ARGTYPE_Q: op = LIR_callq; break;
#endif #endif
default: NanoAssert(0); break; default: NanoAssert(0); break;
} }
@ -922,7 +922,7 @@ namespace nanojit
inline uint64_t imm64() const; inline uint64_t imm64() const;
inline double imm64f() const; inline double imm64f() const;
// For LIR_alloc. // For LIR_allocp.
inline int32_t size() const; inline int32_t size() const;
inline void setSize(int32_t nbytes); inline void setSize(int32_t nbytes);
@ -1000,11 +1000,11 @@ namespace nanojit
return isRetOpcode(opcode()); return isRetOpcode(opcode());
} }
bool isLive() const { bool isLive() const {
return isop(LIR_live) || return isop(LIR_livel) ||
#if defined NANOJIT_64BIT #if defined NANOJIT_64BIT
isop(LIR_qlive) || isop(LIR_liveq) ||
#endif #endif
isop(LIR_flive); isop(LIR_lived);
} }
bool isCmp() const { bool isCmp() const {
LOpcode op = opcode(); LOpcode op = opcode();
@ -1015,11 +1015,11 @@ namespace nanojit
isFCmpOpcode(op); isFCmpOpcode(op);
} }
bool isCall() const { bool isCall() const {
return isop(LIR_icall) || return isop(LIR_calll) ||
#if defined NANOJIT_64BIT #if defined NANOJIT_64BIT
isop(LIR_qcall) || isop(LIR_callq) ||
#endif #endif
isop(LIR_fcall); isop(LIR_calld);
} }
bool isCmov() const { bool isCmov() const {
return isCmovOpcode(opcode()); return isCmovOpcode(opcode());
@ -1033,11 +1033,11 @@ namespace nanojit
bool isGuard() const { bool isGuard() const {
return isop(LIR_x) || isop(LIR_xf) || isop(LIR_xt) || return isop(LIR_x) || isop(LIR_xf) || isop(LIR_xt) ||
isop(LIR_xbarrier) || isop(LIR_xtbl) || isop(LIR_xbarrier) || isop(LIR_xtbl) ||
isop(LIR_addxov) || isop(LIR_subxov) || isop(LIR_mulxov); isop(LIR_addxovl) || isop(LIR_subxovl) || isop(LIR_mulxovl);
} }
// True if the instruction is a 32-bit integer immediate. // True if the instruction is a 32-bit integer immediate.
bool isconst() const { bool isconst() const {
return isop(LIR_int); return isop(LIR_imml);
} }
// True if the instruction is a 32-bit integer immediate and // True if the instruction is a 32-bit integer immediate and
// has the value 'val' when treated as a 32-bit signed integer. // has the value 'val' when treated as a 32-bit signed integer.
@ -1047,7 +1047,7 @@ namespace nanojit
#ifdef NANOJIT_64BIT #ifdef NANOJIT_64BIT
// True if the instruction is a 64-bit integer immediate. // True if the instruction is a 64-bit integer immediate.
bool isconstq() const { bool isconstq() const {
return isop(LIR_quad); return isop(LIR_immq);
} }
#endif #endif
// True if the instruction is a pointer-sized integer immediate. // True if the instruction is a pointer-sized integer immediate.
@ -1061,7 +1061,7 @@ namespace nanojit
} }
// True if the instruction is a 64-bit float immediate. // True if the instruction is a 64-bit float immediate.
bool isconstf() const { bool isconstf() const {
return isop(LIR_float); return isop(LIR_immd);
} }
// True if the instruction is a 64-bit integer or float immediate. // True if the instruction is a 64-bit integer or float immediate.
bool isconstqf() const { bool isconstqf() const {
@ -1155,7 +1155,7 @@ namespace nanojit
LIns* getLIns() { return &ins; }; LIns* getLIns() { return &ins; };
}; };
// 1-operand form. Used for LIR_ret, unary arithmetic/logic ops, etc. // 1-operand form. Used for LIR_retl, unary arithmetic/logic ops, etc.
class LInsOp1 class LInsOp1
{ {
private: private:
@ -1225,7 +1225,7 @@ namespace nanojit
LIns* getLIns() { return &ins; }; LIns* getLIns() { return &ins; };
}; };
// Used for LIR_sti and LIR_stqi. // Used for LIR_stl and LIR_stq.
class LInsSti class LInsSti
{ {
private: private:
@ -1277,7 +1277,7 @@ namespace nanojit
LIns* getLIns() { return &ins; }; LIns* getLIns() { return &ins; };
}; };
// Used for LIR_iparam, LIR_qparam. // Used for LIR_paramp.
class LInsP class LInsP
{ {
private: private:
@ -1292,7 +1292,7 @@ namespace nanojit
LIns* getLIns() { return &ins; }; LIns* getLIns() { return &ins; };
}; };
// Used for LIR_int and LIR_alloc. // Used for LIR_imml and LIR_allocp.
class LInsI class LInsI
{ {
private: private:
@ -1306,7 +1306,7 @@ namespace nanojit
LIns* getLIns() { return &ins; }; LIns* getLIns() { return &ins; };
}; };
// Used for LIR_quad and LIR_float. // Used for LIR_immq and LIR_immd.
class LInsN64 class LInsN64
{ {
private: private:
@ -1428,7 +1428,7 @@ namespace nanojit
void LIns::initLInsP(int32_t arg, int32_t kind) { void LIns::initLInsP(int32_t arg, int32_t kind) {
clearReg(); clearReg();
clearArIndex(); clearArIndex();
lastWord.opcode = LIR_param; lastWord.opcode = LIR_paramp;
NanoAssert(isU8(arg) && isU8(kind)); NanoAssert(isU8(arg) && isU8(kind));
toLInsP()->arg = arg; toLInsP()->arg = arg;
toLInsP()->kind = kind; toLInsP()->kind = kind;
@ -1506,9 +1506,9 @@ namespace nanojit
case LIR_xbarrier: case LIR_xbarrier:
return (GuardRecord*)oprnd2(); return (GuardRecord*)oprnd2();
case LIR_addxov: case LIR_addxovl:
case LIR_subxov: case LIR_subxovl:
case LIR_mulxov: case LIR_mulxovl:
return (GuardRecord*)oprnd3(); return (GuardRecord*)oprnd3();
default: default:
@ -1540,8 +1540,8 @@ namespace nanojit
return toLInsSk()->prevLIns; return toLInsSk()->prevLIns;
} }
inline uint8_t LIns::paramArg() const { NanoAssert(isop(LIR_param)); return toLInsP()->arg; } inline uint8_t LIns::paramArg() const { NanoAssert(isop(LIR_paramp)); return toLInsP()->arg; }
inline uint8_t LIns::paramKind() const { NanoAssert(isop(LIR_param)); return toLInsP()->kind; } inline uint8_t LIns::paramKind() const { NanoAssert(isop(LIR_paramp)); return toLInsP()->kind; }
inline int32_t LIns::imm32() const { NanoAssert(isconst()); return toLInsI()->imm32; } inline int32_t LIns::imm32() const { NanoAssert(isconst()); return toLInsI()->imm32; }
@ -1562,12 +1562,12 @@ namespace nanojit
} }
int32_t LIns::size() const { int32_t LIns::size() const {
NanoAssert(isop(LIR_alloc)); NanoAssert(isop(LIR_allocp));
return toLInsI()->imm32 << 2; return toLInsI()->imm32 << 2;
} }
void LIns::setSize(int32_t nbytes) { void LIns::setSize(int32_t nbytes) {
NanoAssert(isop(LIR_alloc)); NanoAssert(isop(LIR_allocp));
NanoAssert(nbytes > 0); NanoAssert(nbytes > 0);
toLInsI()->imm32 = (nbytes+3)>>2; // # of required 32bit words toLInsI()->imm32 = (nbytes+3)>>2; // # of required 32bit words
} }
@ -1674,12 +1674,12 @@ namespace nanojit
// Inserts an integer comparison to 0 // Inserts an integer comparison to 0
LIns* ins_eq0(LIns* oprnd1) { LIns* ins_eq0(LIns* oprnd1) {
return ins2i(LIR_eq, oprnd1, 0); return ins2i(LIR_eql, oprnd1, 0);
} }
// Inserts a pointer comparison to 0 // Inserts a pointer comparison to 0
LIns* ins_peq0(LIns* oprnd1) { LIns* ins_peq0(LIns* oprnd1) {
return ins2(LIR_peq, oprnd1, insImmWord(0)); return ins2(LIR_eqp, oprnd1, insImmWord(0));
} }
// Inserts a binary operation where the second operand is an // Inserts a binary operation where the second operand is an
@ -1690,7 +1690,7 @@ namespace nanojit
#if NJ_SOFTFLOAT_SUPPORTED #if NJ_SOFTFLOAT_SUPPORTED
LIns* qjoin(LInsp lo, LInsp hi) { LIns* qjoin(LInsp lo, LInsp hi) {
return ins2(LIR_qjoin, lo, hi); return ins2(LIR_ll2d, lo, hi);
} }
#endif #endif
LIns* insImmPtr(const void *ptr) { LIns* insImmPtr(const void *ptr) {
@ -1712,7 +1712,7 @@ namespace nanojit
// Sign-extend integers to native integers. On 32-bit this is a no-op. // Sign-extend integers to native integers. On 32-bit this is a no-op.
LIns* ins_i2p(LIns* intIns) { LIns* ins_i2p(LIns* intIns) {
#ifdef NANOJIT_64BIT #ifdef NANOJIT_64BIT
return ins1(LIR_i2q, intIns); return ins1(LIR_l2q, intIns);
#else #else
return intIns; return intIns;
#endif #endif
@ -1721,13 +1721,13 @@ namespace nanojit
// Zero-extend integers to native integers. On 32-bit this is a no-op. // Zero-extend integers to native integers. On 32-bit this is a no-op.
LIns* ins_u2p(LIns* uintIns) { LIns* ins_u2p(LIns* uintIns) {
#ifdef NANOJIT_64BIT #ifdef NANOJIT_64BIT
return ins1(LIR_u2q, uintIns); return ins1(LIR_ul2uq, uintIns);
#else #else
return uintIns; return uintIns;
#endif #endif
} }
// Chooses LIR_sti or LIR_stqi based on size of value. // Chooses LIR_stl or LIR_stq based on size of value.
LIns* insStorei(LIns* value, LIns* base, int32_t d, AccSet accSet); LIns* insStorei(LIns* value, LIns* base, int32_t d, AccSet accSet);
}; };