@@ -3749,6 +3749,24 @@ void CodeGen::genCodeForJumpCompare(GenTreeOpCC* tree)
37493749 emit->emitLoadImmediate (EA_PTRSIZE, REG_RA, imm);
37503750 regs = (int )REG_RA << 5 ;
37513751 }
3752+ else
3753+ {
3754+ if (cmpSize == EA_4BYTE)
3755+ {
3756+ regNumber tmpRegOp1 = rsGetRsvdReg ();
3757+ assert (regOp1 != tmpRegOp1);
3758+ if (cond.IsUnsigned ())
3759+ {
3760+ emit->emitIns_R_R_I (INS_slli, EA_8BYTE, tmpRegOp1, regOp1, 32 );
3761+ emit->emitIns_R_R_I (INS_srli, EA_8BYTE, tmpRegOp1, tmpRegOp1, 32 );
3762+ }
3763+ else
3764+ {
3765+ emit->emitIns_R_R_I (INS_addiw, EA_8BYTE, tmpRegOp1, regOp1, 0 );
3766+ }
3767+ regOp1 = tmpRegOp1;
3768+ }
3769+ }
37523770
37533771 switch (cond.GetCode ())
37543772 {
@@ -5201,8 +5219,7 @@ void CodeGen::genPutArgSplit(GenTreePutArgSplit* treeNode)
52015219 }
52025220
52035221 // Pick a register to store intermediate values in for the to-stack
5204- // copy. It must not conflict with addrReg. We try to prefer an
5205- // argument register since those can always use thumb encoding.
5222+ // copy. It must not conflict with addrReg.
52065223 valueReg = treeNode->GetRegNumByIdx (0 );
52075224 if (valueReg == addrReg)
52085225 {
@@ -5212,7 +5229,6 @@ void CodeGen::genPutArgSplit(GenTreePutArgSplit* treeNode)
52125229 }
52135230 else
52145231 {
5215- // Prefer argument register that can always use thumb encoding.
52165232 valueReg = treeNode->GetRegNumByIdx (1 );
52175233 }
52185234 }
@@ -7192,7 +7208,7 @@ void CodeGen::genPushCalleeSavedRegisters(regNumber initReg, bool* pInitRegZeroe
71927208 }
71937209#endif
71947210
7195- // On LA we push the FP (frame-pointer) here along with all other callee saved registers
7211+ // On RISCV64 we push the FP (frame-pointer) here along with all other callee saved registers
71967212 if (isFramePointerUsed ())
71977213 {
71987214 rsPushRegs |= RBM_FPBASE;
@@ -7866,7 +7882,7 @@ void CodeGen::genFnPrologCalleeRegArgs()
78667882 // the struct is a split struct.
78677883 assert (varDsc->GetArgReg () == REG_ARG_LAST && varDsc->GetOtherArgReg () == REG_STK);
78687884
7869- // For the LA 's ABI, the split struct arg will be passed via `A7` and a stack slot on caller.
7885+ // For the RISCV64 's ABI, the split struct arg will be passed via `A7` and a stack slot on caller.
78707886 // But if the `A7` is stored on stack on the callee side, the whole split struct should be
78717887 // stored continuous on the stack on the callee side.
78727888 // So, after we save `A7` on the stack in prolog, it has to copy the stack slot of the split struct
0 commit comments