Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f9f2935
Implemented emitDispIns for riscv
Nov 24, 2023
c5f4314
Modified emitDispIns name
Nov 24, 2023
2e7104a
Fixed missed case
Nov 24, 2023
6e6441f
Added assert
Nov 24, 2023
b8767cb
Fixed todo
Nov 24, 2023
1873c0f
Added int to jitprintf
Nov 27, 2023
ce09c4a
Added prototype of the emit disp ins
Nov 29, 2023
376b79b
Fixes in emit dis ins name
Nov 29, 2023
e90d883
Reinforced types
Nov 29, 2023
79a1797
Removed useless ifdef statement from emit
Nov 29, 2023
99e20b2
Fixed bug in emit disp ins
Nov 29, 2023
f0d1dcb
Added release mode emit disp
Nov 29, 2023
cbf60b5
Formatted riscv64
Nov 29, 2023
64c7a12
[RISC-V] Added todo comment
Dec 1, 2023
a6fd653
[RISC-V] Applied format patch
Dec 1, 2023
30c80ae
[RISC-V] Undo the emit.cpp dispIns changes
Dec 1, 2023
61131a6
[RISC-V] Fixed formatting
Dec 1, 2023
91759cd
Removed dead code
Dec 1, 2023
6d8ca16
Merge branch 'riscv-jitdisasm' into riscv-labelgen
Dec 4, 2023
d5acb3d
Added emitDispInsDebugOnlyInfo
Dec 4, 2023
5357df6
Merge branch 'main' into riscv-labelgen
Dec 11, 2023
0e9c8c3
Added preliminary emitOutputInstrJump
Dec 12, 2023
9213d5c
Preliminary emitOutputInstrJump impl
Dec 12, 2023
798258d
TmpSave
Dec 12, 2023
9bf8da0
[RISC-V] Changes after review
Dec 13, 2023
722cb82
Merge branch 'riscv-jitdisasm' into riscv-labelgen
Dec 13, 2023
b19003c
Fixes after merge
Dec 13, 2023
ecebd5d
Fixed comment in emmit.h
Dec 13, 2023
d3c8039
Added label printing
Dec 13, 2023
b8893a0
Removed dead code
Dec 13, 2023
abeb1f3
Merge branch 'main' into riscv-labelgen
Dec 15, 2023
27dac36
Improved emitOutputInstrJumpSize
Dec 15, 2023
8059994
Fixed bugs
Dec 15, 2023
7e8076b
Fixed bug in emitOutputInstrJumpSize
Dec 15, 2023
50fe2d4
Added prelimary barch offset printing and reinforced some emitter met…
Dec 15, 2023
e844c41
Further reinforced disp functions
Dec 15, 2023
756a482
Splitted emitOutputInstrJumpSize
Dec 15, 2023
67f0f68
Formatted code
Dec 15, 2023
769deb7
Last fixes before pr
Dec 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/coreclr/jit/emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2953,7 +2953,7 @@ void* emitter::emitAddInlineLabel()
// emitPrintLabel: Print the assembly label for an insGroup. We could use emitter::emitLabelString()
// to be consistent, but that seems silly.
//
void emitter::emitPrintLabel(insGroup* ig)
void emitter::emitPrintLabel(const insGroup* ig) const
{
printf("G_M%03u_IG%02u", emitComp->compMethodID, ig->igNum);
}
Expand All @@ -2966,7 +2966,7 @@ void emitter::emitPrintLabel(insGroup* ig)
// Returns:
// String with insGroup label
//
const char* emitter::emitLabelString(insGroup* ig)
const char* emitter::emitLabelString(const insGroup* ig) const
{
const int TEMP_BUFFER_LEN = 40;
static unsigned curBuf = 0;
Expand Down Expand Up @@ -4328,7 +4328,7 @@ void emitter::emitDispJumpList()
// id - the pointer to the current instrDesc
// idSize - the size of the current instrDesc
//
void emitter::emitAdvanceInstrDesc(instrDesc** id, size_t idSize)
void emitter::emitAdvanceInstrDesc(instrDesc** id, size_t idSize) const
{
assert(idSize == emitSizeOfInsDsc(*id));
char* idData = reinterpret_cast<char*>(*id);
Expand All @@ -4346,7 +4346,7 @@ void emitter::emitAdvanceInstrDesc(instrDesc** id, size_t idSize)
// Returns:
// A pointer to the first instrDesc.
//
emitter::instrDesc* emitter::emitFirstInstrDesc(BYTE* idData)
emitter::instrDesc* emitter::emitFirstInstrDesc(BYTE* idData) const
{
return reinterpret_cast<instrDesc*>(idData + m_debugInfoSize);
}
Expand Down Expand Up @@ -7664,7 +7664,7 @@ unsigned emitter::emitEndCodeGen(Compiler* comp,
* instruction number for this instruction
*/

unsigned emitter::emitFindInsNum(insGroup* ig, instrDesc* idMatch)
unsigned emitter::emitFindInsNum(const insGroup* ig, const instrDesc* idMatch) const
{
instrDesc* id = emitFirstInstrDesc(ig->igData);

Expand Down Expand Up @@ -7700,7 +7700,7 @@ unsigned emitter::emitFindInsNum(insGroup* ig, instrDesc* idMatch)
* to find the true offset by looking for the instruction within the group.
*/

UNATIVE_OFFSET emitter::emitFindOffset(insGroup* ig, unsigned insNum)
UNATIVE_OFFSET emitter::emitFindOffset(const insGroup* ig, unsigned insNum) const
{
instrDesc* id = emitFirstInstrDesc(ig->igData);
UNATIVE_OFFSET of = 0;
Expand Down
16 changes: 8 additions & 8 deletions src/coreclr/jit/emit.h
Original file line number Diff line number Diff line change
Expand Up @@ -2202,8 +2202,8 @@ class emitter
/* Methods to record a code position and later convert to offset */
/************************************************************************/

unsigned emitFindInsNum(insGroup* ig, instrDesc* id);
UNATIVE_OFFSET emitFindOffset(insGroup* ig, unsigned insNum);
unsigned emitFindInsNum(const insGroup* ig, const instrDesc* id) const;
UNATIVE_OFFSET emitFindOffset(const insGroup* ig, unsigned insNum) const;

/************************************************************************/
/* Members and methods used to issue (encode) instructions. */
Expand All @@ -2222,7 +2222,7 @@ class emitter
UNATIVE_OFFSET emitTotalHotCodeSize;
UNATIVE_OFFSET emitTotalColdCodeSize;

UNATIVE_OFFSET emitCurCodeOffs(const BYTE* dst)
UNATIVE_OFFSET emitCurCodeOffs(const BYTE* dst) const
{
size_t distance;
if ((dst >= emitCodeBlock) && (dst <= (emitCodeBlock + emitTotalHotCodeSize)))
Expand All @@ -2241,7 +2241,7 @@ class emitter
return (UNATIVE_OFFSET)distance;
}

BYTE* emitOffsetToPtr(UNATIVE_OFFSET offset)
BYTE* emitOffsetToPtr(UNATIVE_OFFSET offset) const
{
if (offset < emitTotalHotCodeSize)
{
Expand Down Expand Up @@ -2297,8 +2297,8 @@ class emitter
unsigned int emitCounts_INS_OPTS_J;
#endif // TARGET_LOONGARCH64 || TARGET_RISCV64

instrDesc* emitFirstInstrDesc(BYTE* idData);
void emitAdvanceInstrDesc(instrDesc** id, size_t idSize);
instrDesc* emitFirstInstrDesc(BYTE* idData) const;
void emitAdvanceInstrDesc(instrDesc** id, size_t idSize) const;
size_t emitIssue1Instr(insGroup* ig, instrDesc* id, BYTE** dp);
size_t emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp);

Expand Down Expand Up @@ -2712,8 +2712,8 @@ class emitter
// continues to track GC info as if there was no label.
void* emitAddInlineLabel();

void emitPrintLabel(insGroup* ig);
const char* emitLabelString(insGroup* ig);
void emitPrintLabel(const insGroup* ig) const;
const char* emitLabelString(const insGroup* ig) const;

#if defined(TARGET_ARMARCH) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64)

Expand Down
Loading