Skip to content

Sync-20200731 #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/gcinfo/gcinfodumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ BOOL GcInfoDumper::ReportPointerRecord (
#elif defined(_TARGET_MIPS64_)
#undef REG
#define REG(reg, field) { FIELD_OFFSET(Mips64VolatileContextPointer, field) }
//REG(zero, R0),
REG(zero, R0),
REG(at, At),
REG(v0, V0),
REG(v1, V1),
Expand Down
2 changes: 2 additions & 0 deletions src/inc/regdisp.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ typedef struct _Arm64VolatileContextPointer
#if defined(_TARGET_MIPS64_)
typedef struct _Mips64VolatileContextPointer
{
PDWORD64 R0;
PDWORD64 At;
PDWORD64 V0;
PDWORD64 V1;
Expand Down Expand Up @@ -468,6 +469,7 @@ inline void FillRegDisplay(const PREGDISPLAY pRD, PT_CONTEXT pctx, PT_CONTEXT pC
pRD->volatileCurrContextPointers.X[i] = &pctx->X[i];
#elif defined(_TARGET_MIPS64_) // _TARGET_ARM64_
/* FIXME for MIPS */
pRD->volatileCurrContextPointers.R0 = &pctx->R0;
pRD->volatileCurrContextPointers.At = &pctx->At;
pRD->volatileCurrContextPointers.V0 = &pctx->V0;
pRD->volatileCurrContextPointers.V1 = &pctx->V1;
Expand Down
3 changes: 1 addition & 2 deletions src/jit/codegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -1490,8 +1490,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#ifdef _TARGET_ARM64_
void instGen_MemoryBarrier(insBarrier barrierType = INS_BARRIER_ISH);
#elif defined(_TARGET_MIPS64_)
////FIXME for MIPS.
void instGen_MemoryBarrier(insBarrier barrierType = INS_BARRIER_ISH);
void instGen_MemoryBarrier(insBarrier barrierType = INS_BARRIER_MB);
#else
void instGen_MemoryBarrier();
#endif
Expand Down
27 changes: 22 additions & 5 deletions src/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1872,18 +1872,25 @@ void CodeGen::genJumpToThrowHlpBlk(emitJumpKind jumpKind, SpecialCodeKind codeKi

BasicBlock* tgtBlk = nullptr;
emitJumpKind reverseJumpKind = emitter::emitReverseJumpKind(jumpKind);
#if defined(_TARGET_MIPS64_)
assert(reverseJumpKind == jumpKind);
tgtBlk = genCreateTempLabel();
#else
if (reverseJumpKind != jumpKind)
{
tgtBlk = genCreateTempLabel();
inst_JMP(reverseJumpKind, tgtBlk);
}
#endif

genEmitHelperCall(compiler->acdHelper(codeKind), 0, EA_UNKNOWN);//no branch-delay!

// Define the spot for the normal non-exception case to jump to.
if (tgtBlk != nullptr)
{
#ifndef _TARGET_MIPS64_
assert(reverseJumpKind != jumpKind);
#endif
genDefineTempLabel(tgtBlk);
}
}
Expand Down Expand Up @@ -7043,6 +7050,7 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg,
unsigned uCntBytes = untrLclHi - untrLclLo;
assert((uCntBytes % sizeof(int)) == 0); // The smallest stack slot is always 4 bytes.
unsigned uCntSlots = uCntBytes / REGSIZE_BYTES; // How many register sized stack slots we're going to use.
unsigned int padding = untrLclLo & 0x7;

// When uCntSlots is 9 or less, we will emit a sequence of sd instructions inline.
// When it is 10 or greater, we will emit a loop containing a sd instruction.
Expand All @@ -7062,6 +7070,7 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg,

// rAddr is not a live incoming argument reg
assert((genRegMask(rAddr) & intRegState.rsCalleeRegArgMaskLiveIn) == 0);
assert(untrLclLo%4 == 0);

if (emitter::emitIns_valid_imm_for_add(untrLclLo, EA_PTRSIZE))
{
Expand All @@ -7075,6 +7084,13 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg,
*pInitRegZeroed = false;
}

if (padding)
{
assert(padding == 4);
getEmitter()->emitIns_R_R_I(INS_sw, EA_4BYTE, REG_R0, rAddr, 0);
uCntBytes -= 4;
}

if (useLoop)
{
noway_assert(uCntSlots >= 2);
Expand All @@ -7088,17 +7104,18 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg,
while (uCntBytes >= REGSIZE_BYTES * 2)
{
/* FIXME for MIPS: can be optimize further */
getEmitter()->emitIns_R_R_I(INS_sd, EA_PTRSIZE, REG_R0, rAddr, 8);
getEmitter()->emitIns_R_R_I(INS_sd, EA_PTRSIZE, REG_R0, rAddr, 0);
getEmitter()->emitIns_R_R_I(INS_daddiu, EA_PTRSIZE, rAddr, rAddr, 2 * REGSIZE_BYTES);
getEmitter()->emitIns_R_R_I(INS_sd, EA_PTRSIZE, REG_R0, rAddr, 8 + padding);
getEmitter()->emitIns_R_R_I(INS_sd, EA_PTRSIZE, REG_R0, rAddr, 0 + padding);
getEmitter()->emitIns_R_R_I(INS_daddiu, EA_PTRSIZE, rAddr, rAddr, 2 * REGSIZE_BYTES + padding);
uCntBytes -= REGSIZE_BYTES * 2;
padding = 0;
}
}
else // useLoop is true
{
/* FIXME for MIPS: maybe optimize further */
getEmitter()->emitIns_R_R_I(INS_sd, EA_PTRSIZE, REG_R0, rAddr, 8);
getEmitter()->emitIns_R_R_I(INS_sd, EA_PTRSIZE, REG_R0, rAddr, 0);
getEmitter()->emitIns_R_R_I(INS_sd, EA_PTRSIZE, REG_R0, rAddr, 8 + padding);
getEmitter()->emitIns_R_R_I(INS_sd, EA_PTRSIZE, REG_R0, rAddr, 0 + padding);
getEmitter()->emitIns_R_R_I(INS_daddiu, EA_PTRSIZE, rCnt, rCnt, -1);
{
// bne rCnt, zero, -4 * 4
Expand Down
Loading