Skip to content

Conversation

jakobbotsch
Copy link
Member

Fix #118974

@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 Aug 22, 2025
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@jakobbotsch jakobbotsch marked this pull request as ready for review August 26, 2025 10:06
@Copilot Copilot AI review requested due to automatic review settings August 26, 2025 10:06
Copy link
Contributor

@Copilot Copilot AI left a comment

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 fixes JIT compiler issue #118974 by updating SIMD GetElement and WithElement intrinsics to use native-sized indices for address calculations. The change ensures consistency across platforms and prevents potential issues with 32-bit indices on 64-bit systems.

Key changes:

  • Added normalization of indices to native size before address calculations
  • Introduced NormalizeIndexToNativeSized helper method for type conversion
  • Updated both x86/x64 and ARM architectures to use consistent index handling

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/coreclr/jit/lower.h Added declaration for NormalizeIndexToNativeSized helper method
src/coreclr/jit/lower.cpp Implemented NormalizeIndexToNativeSized method to convert indices to native size
src/coreclr/jit/lowerxarch.cpp Updated GetElement and WithElement lowering to normalize indices on x86/x64
src/coreclr/jit/lowerarmarch.cpp Updated GetElement lowering to normalize indices on ARM
src/coreclr/jit/hwintrinsiccodegenxarch.cpp Added assertions to verify indices are native-sized during code generation

@jakobbotsch jakobbotsch merged commit 5efdfd0 into dotnet:main Aug 26, 2025
109 of 112 checks passed
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.

Missing normalization in R2R'd codegen for Vector2.get_Item
2 participants