-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[release/8.0] JIT: Fixed containment of STOREIND of HW intrinsics ConvertTo*/Extract* #92513
Conversation
…operations for stores.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsBackport of #92396 to release/8.0 /cc @TIHan Customer ImpactTestingRiskIMPORTANT: If this backport is for a servicing release, please verify that:
|
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.
approved. we will take for consideration in 8.0.x
Approved by Tactics via email. |
Backport of #92396 to release/8.0
/cc @TIHan
Customer Impact
The customer has a custom-built software rasterizer and is using SSE2 hw-intrinsics to improve performance. In .NET 8, they were getting incorrect results compared to .NET 7 when using the
Sse2.ConvertToInt32
API.Specifically, when storing the result of
Sse2.ConvertToInt32
or vector indexing in memory, the JIT would in certain cases store either too many bytes or too few bytes when applying its containment optimization. The fix is to ensure the proper sizes and otherwise give up on containment..NET 7 (correct)
![image](https://private-user-images.githubusercontent.com/23627133/269335757-dbc45c07-79a0-4a7a-aba1-291d91c77b81.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4Mjg4OTIsIm5iZiI6MTczOTgyODU5MiwicGF0aCI6Ii8yMzYyNzEzMy8yNjkzMzU3NTctZGJjNDVjMDctNzlhMC00YTdhLWFiYTEtMjkxZDkxYzc3YjgxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE3VDIxNDMxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThmNDk5NWFmMTJmNDE1MTM0ZDUwM2Y1ZGUyYzNhMDQ0YTY2ZmIwNGZiOTljMzJlY2M2MjFiYjE1MDY2OGEzMmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.oLQfKi4c8NaB4G-MsmeQtSkXuXtQhu9KpXomkciFREQ)
.NET 8 (incorrect)
![image](https://private-user-images.githubusercontent.com/23627133/269335853-8c2425a4-e1f2-4fe5-885c-c485507b2e56.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4Mjg4OTIsIm5iZiI6MTczOTgyODU5MiwicGF0aCI6Ii8yMzYyNzEzMy8yNjkzMzU4NTMtOGMyNDI1YTQtZTFmMi00ZmU1LTg4NWMtYzQ4NTUwN2IyZTU2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE3VDIxNDMxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY2NTA2NTM0MGM0NGNhNWY1ZTU1YmE5NTI0YTkxM2FhMTVkNzM1ZjZhMmVhNTIwYjlhMzdhYjdkNzU1ZDE5NDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ZEmAVakNZ1q7vFDy9po2Kj9evUi9LRY4rD8o3kGdqUw)
This change will fix that.
Original issues: #92349, #92590
Testing
Added regression tests of the hw-intrinsics
Sse2.ConvertToInt32
andExtract
to ensure that this will not happen again.Risk
Very low risk. Only two lines were changed and will not regress performance.