[interp] Treat 'unsigned' fp->int conversions like signed ones#119549
Merged
kg merged 1 commit intodotnet:mainfrom Sep 11, 2025
Merged
[interp] Treat 'unsigned' fp->int conversions like signed ones#119549kg merged 1 commit intodotnet:mainfrom
kg merged 1 commit intodotnet:mainfrom
Conversation
Contributor
|
Tagging subscribers to this area: @BrzVlad, @janvorli, @kg |
…ter, since that's what the JIT does
77c3a5e to
b20677a
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates the CoreCLR interpreter to align with JIT behavior for unsigned floating-point to integer conversions. The change addresses the ambiguity in the spec regarding .un conversion opcodes when used with floating-point operands by making the interpreter ignore the unsigned modifier, just as the JIT does.
- Replaces assert statements with actual conversion implementations for floating-point operands
- Adds platform-specific handling for native integer conversions using
TARGET_64BITpreprocessor directives - Includes detailed comments explaining the rationale for treating unsigned FP-to-int conversions like signed ones
davidwrighton
approved these changes
Sep 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We have some test cases that use
.unconversion opcodes to convert floats to ints. The spec doesn't say what this does, and it doesn't make much sense. What the JIT does is ignore the.unmodifier in this scenario, so this PR updates the interpreter to do the same thing.Depends on (contains) #119548 because that PR exposes this problem.
Fixes JIT\Regression\JitBlue\DevDiv_362706