Skip to content
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

JIT: Fix illegal instruction encoding for float->float casts #112217

Merged
merged 2 commits into from
Feb 14, 2025

Conversation

saucecontrol
Copy link
Member

@saucecontrol saucecontrol commented Feb 6, 2025

Fixes #112163

This resolves the illegal instruction encoding by no longer pretending that movss and movsd are 'conversion' instructions, which have different encoding forms.

There's a minor codegen improvement (diffs) when a no-op cast has different source and target registers, where we now emit movaps instead of movss/movsd. Previously we would elide the cast only if source and target reg were the same.

-       vmovss   xmm1, xmm1, xmm2
+       vmovaps  xmm1, xmm2
        vbroadcastss xmm1, xmm1

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Feb 6, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Feb 6, 2025
@saucecontrol saucecontrol mentioned this pull request Feb 6, 2025
@saucecontrol saucecontrol changed the title Fix illegal instruction encoding for floating->floating casts Fix illegal instruction encoding for float->float casts Feb 6, 2025
@saucecontrol saucecontrol changed the title Fix illegal instruction encoding for float->float casts JIT: Fix illegal instruction encoding for float->float casts Feb 6, 2025
@saucecontrol saucecontrol marked this pull request as ready for review February 6, 2025 06:56
@EgorBo
Copy link
Member

EgorBo commented Feb 6, 2025

/azp run runtime-coreclr jitstress-isas-avx512

Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@EgorBo
Copy link
Member

EgorBo commented Feb 6, 2025

/azp list

This comment was marked as resolved.

@BruceForstall BruceForstall merged commit eb99e93 into dotnet:main Feb 14, 2025
119 checks passed
@saucecontrol saucecontrol deleted the float-cast branch February 14, 2025 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JIT: Illegal instruction at JitTest_chain_boxunbox_il.Test.Main() under DOTNET_JitStressRegs=0x2000
5 participants