Skip to content

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

Merged
BruceForstall merged 2 commits into
dotnet:mainfrom
saucecontrol:float-cast
Feb 14, 2025
Merged

JIT: Fix illegal instruction encoding for float->float casts#112217
BruceForstall merged 2 commits into
dotnet:mainfrom
saucecontrol:float-cast

Conversation

@saucecontrol

@saucecontrolsaucecontrol commented Feb 6, 2025

Copy link
Copy Markdown
Member

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

@ghostghost 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-servicedotnet-policy-serviceBot added the community-contribution Indicates that the PR has been added by a community member label Feb 6, 2025
@saucecontrolsaucecontrol mentioned this pull request Feb 6, 2025
@saucecontrolsaucecontrol changed the title Fix illegal instruction encoding for floating->floating castsFix illegal instruction encoding for float->float castsFeb 6, 2025
@saucecontrolsaucecontrol changed the title Fix illegal instruction encoding for float->float castsJIT: Fix illegal instruction encoding for float->float castsFeb 6, 2025
@saucecontrol
saucecontrol marked this pull request as ready for review February 6, 2025 06:56
@EgorBo

Copy link
Copy Markdown
Member

/azp run runtime-coreclr jitstress-isas-avx512

@azure-pipelines

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

@EgorBo

Copy link
Copy Markdown
Member

/azp list

@azure-pipelines

This comment was marked as resolved.

Comment threadeng/pipelines/coreclr/jitstress-isas-avx512.yml
@BruceForstall
BruceForstall merged commit eb99e93 into dotnet:mainFeb 14, 2025
@saucecontrol
saucecontrol deleted the float-cast branch February 14, 2025 01:09
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Mar 17, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIcommunity-contributionIndicates 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

@saucecontrol@EgorBo@jkotas@tannergooding@BruceForstall