int iddcDspVal;
};
+#ifdef _TARGET_XARCH_
+
struct instrDescAmd : instrDesc // large addrmode disp
{
ssize_t idaAmdVal;
ssize_t idacAmdVal;
};
+#endif // _TARGET_XARCH_
+
struct instrDescCGCA : instrDesc // call with ...
{
VARSET_TP idcGCvars; // ... updated GC vars or
#endif // MULTIREG_HAS_SECOND_GC_RET
};
- struct instrDescArmFP : instrDesc
- {
- regNumber r1;
- regNumber r2;
- regNumber r3;
- };
-
insUpdateModes emitInsUpdateMode(instruction ins);
insFormat emitInsModeFormat(instruction ins, insFormat base);
size_t emitGetInstrDescSize(const instrDesc* id);
size_t emitGetInstrDescSizeSC(const instrDesc* id);
+#ifdef _TARGET_XARCH_
+
ssize_t emitGetInsCns(instrDesc* id);
ssize_t emitGetInsDsp(instrDesc* id);
ssize_t emitGetInsAmd(instrDesc* id);
- ssize_t emitGetInsCnsDsp(instrDesc* id, ssize_t* dspPtr);
- ssize_t emitGetInsSC(instrDesc* id);
+
ssize_t emitGetInsCIdisp(instrDesc* id);
unsigned emitGetInsCIargs(instrDesc* id);
// Return the argument count for a direct call "id".
int emitGetInsCDinfo(instrDesc* id);
+#endif // _TARGET_XARCH_
+
+ ssize_t emitGetInsSC(instrDesc* id);
unsigned emitInsCount;
/************************************************************************/
return (instrDescCnsDsp*)emitAllocInstr(sizeof(instrDescCnsDsp), attr);
}
+#ifdef _TARGET_XARCH_
+
instrDescAmd* emitAllocInstrAmd(emitAttr attr)
{
return (instrDescAmd*)emitAllocInstr(sizeof(instrDescAmd), attr);
return (instrDescCnsAmd*)emitAllocInstr(sizeof(instrDescCnsAmd), attr);
}
+#endif // _TARGET_XARCH_
+
instrDescCGCA* emitAllocInstrCGCA(emitAttr attr)
{
return (instrDescCGCA*)emitAllocInstr(sizeof(instrDescCGCA), attr);
}
}
+#ifdef _TARGET_XARCH_
+
/*****************************************************************************
*
* The following helpers should be used to access the various values that
return 0;
}
-inline ssize_t emitter::emitGetInsCnsDsp(instrDesc* id, ssize_t* dspPtr)
-{
- if (id->idIsLargeCns())
- {
- if (id->idIsLargeDsp())
- {
- *dspPtr = ((instrDescCnsDsp*)id)->iddcDspVal;
- return ((instrDescCnsDsp*)id)->iddcCnsVal;
- }
- else
- {
- *dspPtr = 0;
- return ((instrDescCns*)id)->idcCnsVal;
- }
- }
- else
- {
- if (id->idIsLargeDsp())
- {
- *dspPtr = ((instrDescDsp*)id)->iddDspVal;
- return id->idSmallCns();
- }
- else
- {
- *dspPtr = 0;
- return id->idSmallCns();
- }
- }
-}
-
/*****************************************************************************
*
* Get hold of the argument count for an indirect call.
}
}
+#endif // _TARGET_XARCH_
+
/*****************************************************************************
*
* Returns true if the given register contains a live GC ref.
#endif // FEATURE_ITINSTRUCTION
/*****************************************************************************
- *
- * Output a 32-bit nop instruction.
- */
-
-BYTE* emitter::emitOutputNOP(BYTE* dst, instruction ins, insFormat fmt)
-{
- code_t code = emitInsCode(ins, fmt);
-
- dst += emitOutput_Thumb2Instr(dst, code);
-
- return dst;
-}
-
-/*****************************************************************************
*
* Append the machine code corresponding to the given instruction descriptor
* to the code block at '*dp'; the base of the code block is 'bp', and 'ig'
} while (len < 8);
}
-/*****************************************************************************
- *
- * Display an reloc value
- * If we are formatting for an assembly listing don't print the hex value
- * since it will prevent us from doing assembly diffs
- */
-void emitter::emitDispReloc(int value, bool addComma)
-{
- if (emitComp->opts.disAsm)
- {
- printf("(reloc)");
- }
- else
- {
- printf("(reloc 0x%x)", dspPtr(value));
- }
-
- if (addComma)
- printf(", ");
-}
-
#define STRICT_ARM_ASM 0
/*****************************************************************************
printf(", ");
}
-void emitter::emitDispFloatReg(regNumber reg, emitAttr attr, bool addComma)
-{
-}
-
/*****************************************************************************
*
* Display an addressing operand [reg]
insSize emitInsSize(insFormat insFmt);
-BYTE* emitOutputAM(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc = NULL);
-BYTE* emitOutputSV(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc = NULL);
-BYTE* emitOutputCV(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc = NULL);
-
-BYTE* emitOutputR(BYTE* dst, instrDesc* id);
-BYTE* emitOutputRI(BYTE* dst, instrDesc* id);
-BYTE* emitOutputRR(BYTE* dst, instrDesc* id);
-BYTE* emitOutputIV(BYTE* dst, instrDesc* id);
#ifdef FEATURE_ITINSTRUCTION
BYTE* emitOutputIT(BYTE* dst, instruction ins, insFormat fmt, code_t condcode);
#endif // FEATURE_ITINSTRUCTION
-BYTE* emitOutputNOP(BYTE* dst, instruction ins, insFormat fmt);
BYTE* emitOutputLJ(insGroup* ig, BYTE* dst, instrDesc* id);
BYTE* emitOutputShortBranch(BYTE* dst, instruction ins, insFormat fmt, ssize_t distVal, instrDescJmp* id);
#ifdef DEBUG
-const char* emitFPregName(unsigned reg, bool varName = true);
-
void emitDispInst(instruction ins, insFlags flags);
-void emitDispReloc(int value, bool addComma);
void emitDispImm(int imm, bool addComma, bool alwaysHex = false);
void emitDispCond(int cond);
void emitDispShiftOpts(insOpts opt);
void emitDispRegmask(int imm, bool encodedPC_LR);
void emitDispRegRange(regNumber reg, int len, emitAttr attr);
void emitDispReg(regNumber reg, emitAttr attr, bool addComma);
-void emitDispFloatReg(regNumber reg, emitAttr attr, bool addComma);
void emitDispAddrR(regNumber reg, emitAttr attr);
void emitDispAddrRI(regNumber reg, int imm, emitAttr attr);
void emitDispAddrRR(regNumber reg1, regNumber reg2, emitAttr attr);
/************************************************************************/
private:
-instrDesc* emitNewInstrAmd(emitAttr attr, int dsp);
-instrDesc* emitNewInstrAmdCns(emitAttr attr, int dsp, int cns);
-
instrDesc* emitNewInstrCallDir(
int argCnt, VARSET_VALARG_TP GCvars, regMaskTP gcrefRegs, regMaskTP byrefRegs, emitAttr retSize);
instrDesc* emitNewInstrCallInd(
int argCnt, ssize_t disp, VARSET_VALARG_TP GCvars, regMaskTP gcrefRegs, regMaskTP byrefRegs, emitAttr retSize);
-void emitGetInsCns(instrDesc* id, CnsVal* cv);
-int emitGetInsAmdCns(instrDesc* id, CnsVal* cv);
-void emitGetInsDcmCns(instrDesc* id, CnsVal* cv);
-int emitGetInsAmdAny(instrDesc* id);
-
/************************************************************************/
/* Private helpers for instruction output */
/************************************************************************/
void emitInsLoadStoreOp(instruction ins, emitAttr attr, regNumber dataReg, GenTreeIndir* indir);
void emitInsLoadStoreOp(instruction ins, emitAttr attr, regNumber dataReg, GenTreeIndir* indir, int offset);
-/*****************************************************************************
-*
-* Convert between an index scale in bytes to a smaller encoding used for
-* storage in instruction descriptors.
-*/
-
-inline emitter::opSize emitEncodeScale(size_t scale)
-{
- assert(scale == 1 || scale == 2 || scale == 4 || scale == 8);
-
- return emitSizeEncode[scale - 1];
-}
-
-inline emitAttr emitDecodeScale(unsigned ensz)
-{
- assert(ensz < 4);
-
- return emitter::emitSizeDecode[ensz];
-}
-
static bool isModImmConst(int imm);
-
static int encodeModImmConst(int imm);
static int insUnscaleImm(int imm, emitAttr size);
void emitIns_C_R(instruction ins, emitAttr attr, CORINFO_FIELD_HANDLE fldHnd, regNumber reg, int offs);
-void emitIns_C_I(instruction ins, emitAttr attr, CORINFO_FIELD_HANDLE fdlHnd, ssize_t offs, ssize_t val);
+void emitIns_C_I(instruction ins, emitAttr attr, CORINFO_FIELD_HANDLE fdlHnd, int offs, ssize_t val);
void emitIns_R_L(instruction ins, emitAttr attr, BasicBlock* dst, regNumber reg);