-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Implement CORINFO_FIELD_INTRINSIC_ZERO and _ISLITTLEENDIAN #116853
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
Implement CORINFO_FIELD_INTRINSIC_ZERO and _ISLITTLEENDIAN #116853
Conversation
These has shown up on the runtime startup path
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 implements two new CORINFO field intrinsics to support runtime startup behavior. Key updates include:
- Adding a switch-case in EmitStaticFieldAccess for CORINFO_FIELD_INTRINSIC_ZERO, which pushes a null reference.
- Adding logic for CORINFO_FIELD_INTRINSIC_ISLITTLEENDIAN to push a constant reflecting the system’s endianness.
Tagging subscribers to this area: @BrzVlad, @janvorli, @kg |
src/coreclr/interpreter/compiler.cpp
Outdated
#else | ||
m_pLastNewIns->data[0] = 1; | ||
#endif | ||
PushInterpType(InterpTypeI1, NULL); |
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.
Should it be extended to InterpTypeI4
on the eval stack even though it is a bool
?
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 is actually one thing I am not sure about, maybe @BrzVlad could provide a guidance here.
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.
We only support pushing I4,I8,R4,R8 or VT on the stack. When pushing on the stack from IL locals/args we will sign extend. In this particular example, whether you push InterpTypeI1
or InterpTypeI4
, you will still end up pushing an I4 var so there is not really a difference in practice. Overall I suggest pushing the I4 explicitly. In the future we will probably get rid of the StackType*
so we will have to push the actual type anyway.
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.
Thank you, I'll change it that way then.
Also add tests for the new intrinsic field accessors
These has shown up on the runtime startup path