Skip to content

Ensure that op_Equality/Inequality can actually import as expected#130086

Merged
tannergooding merged 1 commit into
dotnet:mainfrom
tannergooding:simd-fixes
Jul 1, 2026
Merged

Ensure that op_Equality/Inequality can actually import as expected#130086
tannergooding merged 1 commit into
dotnet:mainfrom
tannergooding:simd-fixes

Conversation

@tannergooding

@tannergooding tannergooding commented Jul 1, 2026

Copy link
Copy Markdown
Member

The lack of the flag was blocking correct handling of op_Equality and op_Inequality for certain generic contexts (typically involving ISimdVector) as it would attempt to resolve using the wrong class handle.

This resolves #93174

Copilot AI review requested due to automatic review settings July 1, 2026 15:48
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the JIT hardware-intrinsic metadata so the Vector* op_Equality / op_Inequality intrinsics derive their SIMD base type from the first argument (instead of falling back to return type / owning type), which is required for correct import/lowering of these boolean-returning SIMD operators.

Changes:

  • Add HW_Flag_BaseTypeFromFirstArg to Vector128/256/512.op_Equality and Vector128/256/512.op_Inequality on xarch.
  • Add HW_Flag_BaseTypeFromFirstArg to Vector64/128.op_Equality and Vector64/128.op_Inequality on arm64.
Show a summary per file
File Description
src/coreclr/jit/hwintrinsiclistxarch.h Marks Vector128/256/512 equality/inequality operators as base-type-from-arg so import/lowering has the correct SIMD base type.
src/coreclr/jit/hwintrinsiclistarm64.h Marks Vector64/128 equality/inequality operators as base-type-from-arg so import/lowering has the correct SIMD base type.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@EgorBo

EgorBo commented Jul 1, 2026

Copy link
Copy Markdown
Member

Probably closes #93174

@tannergooding tannergooding enabled auto-merge (squash) July 1, 2026 19:27
@tannergooding

Copy link
Copy Markdown
Member Author

windows arm64

Overall (-13,900 bytes)
MinOpts (-24 bytes)
FullOpts (-13,876 bytes)

windows x64

Overall (-74,512 bytes)
MinOpts (-176 bytes)
FullOpts (-74,336 bytes)

With throughput improvements up to -0.17%.


We get some really big diffs like

-1,024 (-73.14%) : 39499.dasm - System.Globalization.Ordinal:EqualsIgnoreCase_VectorSystem.Runtime.Intrinsics.Vector128`1[ushort]:bool (Tier1)

Where the improvement is because the API no longer hits an unrolled loop and just emits the 1-2 instructions as expected

@tannergooding

Copy link
Copy Markdown
Member Author

/ba-g unrelated timeouts

@tannergooding tannergooding merged commit 76bc71f into dotnet:main Jul 1, 2026
138 of 143 checks passed
@tannergooding tannergooding deleted the simd-fixes branch July 1, 2026 20:47
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ISimdVector issue (GVM resolution doesn't report [Intrinsic]?)

3 participants