-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[clr-interp] Fix more IL_Conformance test issues #120993
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
base: main
Are you sure you want to change the base?
Conversation
- Compare operations between I4 and I need to work - Storing a floating point value in an array may need conversions - Storing an I4 into an I with stelem is a supported operation - LDLOCA is specified to return a byref, but the existing compilers treat it as a simple pointer, and we can trivially do it in the interpreter 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.
Pull Request Overview
This PR fixes several IL conformance test issues in the CoreCLR interpreter by adding implicit type conversions and fixing type handling in various operations.
Key Changes:
- Adds implicit conversions between I4 (int32) and I8 (nint) for comparison operations and array element storage on 64-bit platforms
- Adds implicit floating-point conversions (R4 ↔ R8) for array storage and return statements
- Changes LDLOCA to return InterpTypeI instead of InterpTypeByRef to match existing compiler behavior
Co-authored-by: Copilot <[email protected]>
RyuJIT does not treat LDLOCA as native pointers internally. They are byrefs until they get used in a context that requires a native pointer type (see impBashVarAddrsToI). I think treating them as native pointers unconditionally will run into other problems... For example, subtracting the address of a local from a byref should result in a native int, but if you treat the address of the local as a native int, then it will result in a byref. Something like: ref int GetY(ref S s) => ref s.Y;
void Problem()
{
S s = default;
GetY(ref s) - ref s; // should be a native int on the stack
} |
|
@jakobbotsch :( Now I have to do a bunch more work. Bummer. |
|
@jakobbotsch I'll tackle the I vs Byref thing in another PR. |
|
/azp run runtime-interpreter |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-interpreter |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-interpreter |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Uh oh!
There was an error while loading. Please reload this page.