@@ -1872,18 +1872,25 @@ void CodeGen::genJumpToThrowHlpBlk(emitJumpKind jumpKind, SpecialCodeKind codeKi
1872
1872
1873
1873
BasicBlock* tgtBlk = nullptr;
1874
1874
emitJumpKind reverseJumpKind = emitter::emitReverseJumpKind(jumpKind);
1875
+ #if defined(_TARGET_MIPS64_)
1876
+ assert(reverseJumpKind == jumpKind);
1877
+ tgtBlk = genCreateTempLabel();
1878
+ #else
1875
1879
if (reverseJumpKind != jumpKind)
1876
1880
{
1877
1881
tgtBlk = genCreateTempLabel();
1878
1882
inst_JMP(reverseJumpKind, tgtBlk);
1879
1883
}
1884
+ #endif
1880
1885
1881
1886
genEmitHelperCall(compiler->acdHelper(codeKind), 0, EA_UNKNOWN);//no branch-delay!
1882
1887
1883
1888
// Define the spot for the normal non-exception case to jump to.
1884
1889
if (tgtBlk != nullptr)
1885
1890
{
1891
+ #ifndef _TARGET_MIPS64_
1886
1892
assert(reverseJumpKind != jumpKind);
1893
+ #endif
1887
1894
genDefineTempLabel(tgtBlk);
1888
1895
}
1889
1896
}
@@ -7043,6 +7050,7 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg,
7043
7050
unsigned uCntBytes = untrLclHi - untrLclLo;
7044
7051
assert((uCntBytes % sizeof(int)) == 0); // The smallest stack slot is always 4 bytes.
7045
7052
unsigned uCntSlots = uCntBytes / REGSIZE_BYTES; // How many register sized stack slots we're going to use.
7053
+ unsigned int padding = untrLclLo & 0x7;
7046
7054
7047
7055
// When uCntSlots is 9 or less, we will emit a sequence of sd instructions inline.
7048
7056
// When it is 10 or greater, we will emit a loop containing a sd instruction.
@@ -7062,6 +7070,7 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg,
7062
7070
7063
7071
// rAddr is not a live incoming argument reg
7064
7072
assert((genRegMask(rAddr) & intRegState.rsCalleeRegArgMaskLiveIn) == 0);
7073
+ assert(untrLclLo%4 == 0);
7065
7074
7066
7075
if (emitter::emitIns_valid_imm_for_add(untrLclLo, EA_PTRSIZE))
7067
7076
{
@@ -7075,6 +7084,13 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg,
7075
7084
*pInitRegZeroed = false;
7076
7085
}
7077
7086
7087
+ if (padding)
7088
+ {
7089
+ assert(padding == 4);
7090
+ getEmitter()->emitIns_R_R_I(INS_sw, EA_4BYTE, REG_R0, rAddr, 0);
7091
+ uCntBytes -= 4;
7092
+ }
7093
+
7078
7094
if (useLoop)
7079
7095
{
7080
7096
noway_assert(uCntSlots >= 2);
@@ -7088,17 +7104,18 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg,
7088
7104
while (uCntBytes >= REGSIZE_BYTES * 2)
7089
7105
{
7090
7106
/* FIXME for MIPS: can be optimize further */
7091
- getEmitter()->emitIns_R_R_I(INS_sd, EA_PTRSIZE, REG_R0, rAddr, 8);
7092
- getEmitter()->emitIns_R_R_I(INS_sd, EA_PTRSIZE, REG_R0, rAddr, 0);
7093
- getEmitter()->emitIns_R_R_I(INS_daddiu, EA_PTRSIZE, rAddr, rAddr, 2 * REGSIZE_BYTES);
7107
+ getEmitter()->emitIns_R_R_I(INS_sd, EA_PTRSIZE, REG_R0, rAddr, 8 + padding );
7108
+ getEmitter()->emitIns_R_R_I(INS_sd, EA_PTRSIZE, REG_R0, rAddr, 0 + padding );
7109
+ getEmitter()->emitIns_R_R_I(INS_daddiu, EA_PTRSIZE, rAddr, rAddr, 2 * REGSIZE_BYTES + padding );
7094
7110
uCntBytes -= REGSIZE_BYTES * 2;
7111
+ padding = 0;
7095
7112
}
7096
7113
}
7097
7114
else // useLoop is true
7098
7115
{
7099
7116
/* FIXME for MIPS: maybe optimize further */
7100
- getEmitter()->emitIns_R_R_I(INS_sd, EA_PTRSIZE, REG_R0, rAddr, 8);
7101
- getEmitter()->emitIns_R_R_I(INS_sd, EA_PTRSIZE, REG_R0, rAddr, 0);
7117
+ getEmitter()->emitIns_R_R_I(INS_sd, EA_PTRSIZE, REG_R0, rAddr, 8 + padding );
7118
+ getEmitter()->emitIns_R_R_I(INS_sd, EA_PTRSIZE, REG_R0, rAddr, 0 + padding );
7102
7119
getEmitter()->emitIns_R_R_I(INS_daddiu, EA_PTRSIZE, rCnt, rCnt, -1);
7103
7120
{
7104
7121
// bne rCnt, zero, -4 * 4
0 commit comments