Skip to content

Conversation

@tannergooding
Copy link
Member

This resolves #106610

As per the discussion on the issue, the behavior of the CPU converting an sNaN into a qNaN is within spec and the expected behavior on most platforms, particularly when dealing with scalars. However, this is not the behavior encountered when dealing with SIMD vectors on most platforms.

This fix ensures that constant folding will produce the same result as the underlying instruction by performing the bitwise operation directly on the integral bits, rather than first extracting it to the base type (float or double).

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Aug 20, 2024
@tannergooding
Copy link
Member Author

CC. @dotnet/jit-contrib, @AndyAyersMS

This should be ready for review and resolves #106610. It will need backport for .NET 9 RC2

@tannergooding
Copy link
Member Author

(Pushed a commit to the wrong branch by accident, reverted back to the approved commit)

@tannergooding tannergooding merged commit 00f6847 into dotnet:main Aug 22, 2024
@tannergooding tannergooding deleted the fix-106610 branch August 22, 2024 18:49
@tannergooding
Copy link
Member Author

/backport to release/9.0

@github-actions
Copy link
Contributor

Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/10513909881

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JIT: Bad codegen with Avx512DQ.VL.Range

2 participants