-
Notifications
You must be signed in to change notification settings - Fork 5.1k
JIT: Stop reporting FP locals as being on the x87 stack for 32-bit platforms #98580
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
Conversation
…atforms We never store any locals on the x87 stack and haven't for a while. Also, the handling kicks in for arm32 as well which does not make sense.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsWe never store any locals on the x87 stack and haven't for a while. Also, the handling kicks in for arm32 as well which does not make sense. cc @dotnet/jit-contrib @filipnavara
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
case TYP_FLOAT: | ||
case TYP_DOUBLE: | ||
if (isFloatRegType(type)) | ||
{ | ||
this->vlType = VLT_FPSTK; | ||
this->vlFPstk.vlfReg = varDsc->GetRegNum(); | ||
} | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm, this isn't necessary for ABI purposes right? Floating-point args still get returned in ST(0)
for Windows (and I think Unix as well).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe so, since this handling is around locals.
// 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is still true (though RegNum is no longer is corinfo.h, apparently).
See CodeGen::checkICodeDebugInfo()
. We set vlrReg
and assume that our register number values are the same as the RegNum values. RegNum
doesn't define the FP registers, but we still set it. Seems odd. I presume the debugger ignores it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well the comment might be true, but I think the real problem is that the current RegNumber
is actually GeneralPurposeRegNumber
, and the value stored in vlReg.vlrReg
for VLT_REG_FP
is some FloatingPointRegNumber
enum that doesn't exist (i.e. xmm0 gets index 0). The debugger handles it here for x64:
runtime/src/coreclr/debug/di/rsthread.cpp
Lines 8405 to 8411 in efe8b87
#if defined(TARGET_64BIT) || defined(TARGET_ARM) | |
case ICorDebugInfo::VLT_REG_FP: | |
#if defined(TARGET_ARM) // @ARMTODO | |
hr = E_NOTIMPL; | |
#elif defined(TARGET_AMD64) | |
hr = m_nativeFrame->GetLocalFloatingPointValue(pNativeVarInfo->loc.vlReg.vlrReg + REGISTER_AMD64_XMM0, | |
type, ppValue); |
I think I'll need to add some similar handling for x86 and run the debugger tests as part of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be checked in the managed ObjWriter too since it expects the JIT register number (ie. not zero based).
Diff results for #98580Throughput diffsThroughput diffs for linux/arm64 ran on windows/x64MinOpts (-0.01% to +0.01%)
Throughput diffs for osx/arm64 ran on windows/x64MinOpts (-0.01% to +0.00%)
Throughput diffs for windows/arm64 ran on windows/x64MinOpts (-0.01% to +0.00%)
Details here |
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
We never store any locals on the x87 stack and haven't for a while. Also, the handling kicks in for arm32 as well which does not make sense.
cc @dotnet/jit-contrib @filipnavara