diff options
author | Egor Chesakov <Egor.Chesakov@microsoft.com> | 2018-08-03 12:35:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-03 12:35:33 -0700 |
commit | f6e2b9c3b311f58497ccfc337e5925a95a2d008a (patch) | |
tree | 5c54edfe6ed76e63d21680b4bbcf5629ade90c5b /src/jit/emit.h | |
parent | d1c6a938e0f641f978fceb7834314ac6dba14adb (diff) | |
download | coreclr-f6e2b9c3b311f58497ccfc337e5925a95a2d008a.tar.gz coreclr-f6e2b9c3b311f58497ccfc337e5925a95a2d008a.tar.bz2 coreclr-f6e2b9c3b311f58497ccfc337e5925a95a2d008a.zip |
Handle MovRelocatableImmediate on ARM32 as a special case (IF_T2_N3) (#19013)
* Add IF_T2_N3 instruction form and make this a specific case of IF_T2_N when EA_IS_RELOC(attr) is true
* Move "movw/movt reg,relocatableImm" case to function emitIns_MovRelocatableImmediate
* Introduce new instruction descriptor instrDescReloc
* Delete unused CnsVal from ARM32 and ARM64 emitters
* Introduce target_ssize_t and use this type for non-relocatable constants
Diffstat (limited to 'src/jit/emit.h')
-rw-r--r-- | src/jit/emit.h | 54 |
1 files changed, 42 insertions, 12 deletions
diff --git a/src/jit/emit.h b/src/jit/emit.h index 03f4d42cf1..fcab878de3 100644 --- a/src/jit/emit.h +++ b/src/jit/emit.h @@ -1241,18 +1241,18 @@ protected: struct instrDescCns : instrDesc // large const { - ssize_t idcCnsVal; + target_ssize_t idcCnsVal; }; struct instrDescDsp : instrDesc // large displacement { - ssize_t iddDspVal; + target_ssize_t iddDspVal; }; struct instrDescCnsDsp : instrDesc // large cons + disp { - ssize_t iddcCnsVal; - int iddcDspVal; + target_ssize_t iddcCnsVal; + int iddcDspVal; }; #ifdef _TARGET_XARCH_ @@ -1301,6 +1301,17 @@ protected: #endif // MULTIREG_HAS_SECOND_GC_RET }; +#ifdef _TARGET_ARM_ + + struct instrDescReloc : instrDesc + { + BYTE* idrRelocVal; + }; + + BYTE* emitGetInsRelocValue(instrDesc* id); + +#endif // _TARGET_ARM_ + insUpdateModes emitInsUpdateMode(instruction ins); insFormat emitInsModeFormat(instruction ins, insFormat base); @@ -1326,7 +1337,7 @@ protected: #endif // _TARGET_XARCH_ - ssize_t emitGetInsSC(instrDesc* id); + target_ssize_t emitGetInsSC(instrDesc* id); unsigned emitInsCount; /************************************************************************/ @@ -1813,10 +1824,13 @@ private: instrDesc* emitNewInstrSmall(emitAttr attr); instrDesc* emitNewInstr(emitAttr attr = EA_4BYTE); - instrDesc* emitNewInstrSC(emitAttr attr, ssize_t cns); - instrDesc* emitNewInstrCns(emitAttr attr, ssize_t cns); - instrDesc* emitNewInstrDsp(emitAttr attr, ssize_t dsp); - instrDesc* emitNewInstrCnsDsp(emitAttr attr, ssize_t cns, int dsp); + instrDesc* emitNewInstrSC(emitAttr attr, target_ssize_t cns); + instrDesc* emitNewInstrCns(emitAttr attr, target_ssize_t cns); + instrDesc* emitNewInstrDsp(emitAttr attr, target_ssize_t dsp); + instrDesc* emitNewInstrCnsDsp(emitAttr attr, target_ssize_t cns, int dsp); +#ifdef _TARGET_ARM_ + instrDesc* emitNewInstrReloc(emitAttr attr, BYTE* addr); +#endif // _TARGET_ARM_ instrDescJmp* emitNewInstrJmp(); #if !defined(_TARGET_ARM64_) @@ -2287,7 +2301,7 @@ inline emitter::instrDescLbl* emitter::emitNewInstrLbl() } #endif // !_TARGET_ARM64_ -inline emitter::instrDesc* emitter::emitNewInstrDsp(emitAttr attr, ssize_t dsp) +inline emitter::instrDesc* emitter::emitNewInstrDsp(emitAttr attr, target_ssize_t dsp) { if (dsp == 0) { @@ -2322,7 +2336,7 @@ inline emitter::instrDesc* emitter::emitNewInstrDsp(emitAttr attr, ssize_t dsp) * Note that this very similar to emitter::emitNewInstrSC(), except it never * allocates a small descriptor. */ -inline emitter::instrDesc* emitter::emitNewInstrCns(emitAttr attr, ssize_t cns) +inline emitter::instrDesc* emitter::emitNewInstrCns(emitAttr attr, target_ssize_t cns) { if (instrDesc::fitsInSmallCns(cns)) { @@ -2385,7 +2399,7 @@ inline size_t emitter::emitGetInstrDescSize(const instrDesc* id) * emitNewInstrCns() always allocates at least sizeof(instrDesc). */ -inline emitter::instrDesc* emitter::emitNewInstrSC(emitAttr attr, ssize_t cns) +inline emitter::instrDesc* emitter::emitNewInstrSC(emitAttr attr, target_ssize_t cns) { instrDesc* id; @@ -2428,6 +2442,22 @@ inline size_t emitter::emitGetInstrDescSizeSC(const instrDesc* id) } } +#ifdef _TARGET_ARM_ + +inline emitter::instrDesc* emitter::emitNewInstrReloc(emitAttr attr, BYTE* addr) +{ + assert(EA_IS_RELOC(attr)); + + instrDescReloc* id = (instrDescReloc*)emitAllocInstr(sizeof(instrDescReloc), attr); + assert(id->idIsReloc()); + + id->idrRelocVal = addr; + + return id; +} + +#endif // _TARGET_ARM_ + #ifdef _TARGET_XARCH_ /***************************************************************************** |