Skip to content
9 changes: 7 additions & 2 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1831,12 +1831,17 @@ void CodeGen::genEmitCallWithCurrentGC(EmitCallParams& params)
info.returnValueLoc.vlType = VLT_FPSTK;
info.returnValueLoc.vlFPstk.vlfReg = 0;
#else
info.returnValueLoc.storeVariableInRegisters(REG_FLOATRET, REG_NA);
// VLT_REG_FP uses a 0-based FP register index; the DBI adds the
// platform-specific XMM0/V0 base when converting to CorDebugRegister.
Comment thread
tommcdon marked this conversation as resolved.
Comment thread
tommcdon marked this conversation as resolved.
Comment thread
tommcdon marked this conversation as resolved.
info.returnValueLoc.vlType = VLT_REG_FP;
info.returnValueLoc.vlReg.vlrReg = (regNumber)(REG_FLOATRET - REG_FP_FIRST);
#endif
Comment thread
tommcdon marked this conversation as resolved.
}
else if (varTypeUsesFloatReg(call))
{
info.returnValueLoc.storeVariableInRegisters(REG_FLOATRET, REG_NA);
// VLT_REG_FP uses a 0-based FP register index.
info.returnValueLoc.vlType = VLT_REG_FP;
info.returnValueLoc.vlReg.vlrReg = (regNumber)(REG_FLOATRET - REG_FP_FIRST);
}
else
{
Expand Down
5 changes: 4 additions & 1 deletion src/coreclr/jit/ee_il_dll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,14 +894,17 @@ void Compiler::eeDispVar(ICorDebugInfo::NativeVarInfo* var)
{
case CodeGenInterface::VLT_REG:
case CodeGenInterface::VLT_REG_BYREF:
case CodeGenInterface::VLT_REG_FP:
printf("%s", getRegName(var->loc.vlReg.vlrReg));
if (var->loc.vlType == (ICorDebugInfo::VarLocType)CodeGenInterface::VLT_REG_BYREF)
{
printf(" byref");
}
break;

case CodeGenInterface::VLT_REG_FP:
printf("%s", getRegName((regNumber)(var->loc.vlReg.vlrReg + REG_FP_FIRST)));
break;

case CodeGenInterface::VLT_STK:
case CodeGenInterface::VLT_STK_BYREF:
if ((int)var->loc.vlStk.vlsBaseReg != (int)ICorDebugInfo::REGNUM_AMBIENT_SP)
Expand Down
18 changes: 9 additions & 9 deletions src/coreclr/jit/scopeinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ bool CodeGenInterface::siVarLoc::vlIsOnStack() const
//
void CodeGenInterface::siVarLoc::storeVariableInRegisters(regNumber reg, regNumber otherReg)
{
assert(genIsValidIntReg(reg));
assert(otherReg == REG_NA || genIsValidIntReg(otherReg));
Comment thread
tommcdon marked this conversation as resolved.

if (otherReg == REG_NA)
{
// Only one register is used
Expand Down Expand Up @@ -409,10 +412,10 @@ void CodeGenInterface::siVarLoc::siFillRegisterVarLoc(
#ifdef TARGET_64BIT
case TYP_FLOAT:
case TYP_DOUBLE:
// TODO-AMD64-Bug: ndp\clr\src\inc\corinfo.h has a definition of RegNum that only goes up to R15,
// so no XMM registers can get debug information.
// VLT_REG_FP uses a 0-based FP register index; the DBI adds the
// platform-specific XMM0/V0 base when converting to CorDebugRegister.
Comment thread
tommcdon marked this conversation as resolved.
this->vlType = VLT_REG_FP;
this->vlReg.vlrReg = varDsc->GetRegNum();
this->vlReg.vlrReg = (regNumber)(varDsc->GetRegNum() - REG_FP_FIRST);
Comment thread
tommcdon marked this conversation as resolved.
Comment thread
tommcdon marked this conversation as resolved.
Comment thread
tommcdon marked this conversation as resolved.
break;
Comment thread
tommcdon marked this conversation as resolved.

#else // !TARGET_64BIT
Expand Down Expand Up @@ -442,12 +445,9 @@ void CodeGenInterface::siVarLoc::siFillRegisterVarLoc(
{
this->vlType = VLT_REG_FP;

// TODO-AMD64-Bug: ndp\clr\src\inc\corinfo.h has a definition of RegNum that only goes up to R15,
// so no XMM registers can get debug information.
//
// Note: Need to initialize vlrReg field, otherwise during jit dump hitting an assert
// in eeDispVar() --> getRegName() that regNumber is valid.
this->vlReg.vlrReg = varDsc->GetRegNum();
// VLT_REG_FP uses a 0-based FP register index; the DBI adds the
// platform-specific XMM0/V0 base when converting to CorDebugRegister.
Comment thread
tommcdon marked this conversation as resolved.
this->vlReg.vlrReg = (regNumber)(varDsc->GetRegNum() - REG_FP_FIRST);
Comment thread
tommcdon marked this conversation as resolved.
break;
}
#endif // FEATURE_SIMD
Expand Down
Loading