Skip to content

Arm64-SVE: Support Vector<T> as element of an array - #133943

Open
snickolls-arm wants to merge 4 commits into
dotnet:mainfrom
snickolls-arm:vectort-in-array
Open

snickolls-arm wants to merge 4 commits into
dotnet:mainfrom
snickolls-arm:vectort-in-array

Conversation

@snickolls-arm

Copy link
Copy Markdown
Contributor

Convert GenTreeIndexAddr::gtElemSize from unsigned to ValueSize to allow reasoning on a runtime evaluated size.

When indexing Vector<T>[], scale the index by Sve.Count8BitElements at runtime before accessing.

Convert GenTreeIndexAddr::gtElemSize from `unsigned` to `ValueSize` to allow
reasoning on a runtime evaluated size.

When indexing `Vector<T>[]`, scale the index by `Sve.Count8BitElements` at runtime
before accessing.
@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 Sep 15, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Sep 15, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 8 pipeline(s).
8 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@SwapnilGaikwad

Copy link
Copy Markdown
Contributor

cc: @dotnet/arm64-contrib @SwapnilGaikwad @dhartglassMSFT

Comment thread src/coreclr/jit/morph.cpp Outdated
@snickolls-arm

Copy link
Copy Markdown
Contributor Author

The failures on x64 superpmi seem consistent, I will need to look into these. It's failing at codegen in ins_Copy.

@JulieLeeMSFT

Copy link
Copy Markdown
Member

@dhartglassMSFT PTAL.

@snickolls-arm

Copy link
Copy Markdown
Contributor Author

The failures on x64 superpmi seem consistent, I will need to look into these. It's failing at codegen in ins_Copy.

These seem to have been fixed by #135327

buildInternalIntRegisterDefForNode(tree);
if (!tree->AsIndexAddr()->Index()->TypeIs(TYP_I_IMPL) &&
!(isPow2(tree->AsIndexAddr()->gtElemSize) && (tree->AsIndexAddr()->gtElemSize <= 32768)))
!varTypeHasUnknownSize(tree->AsIndexAddr()->gtElemType) &&

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.

Do we still need to widen here if Index is not TYP_I_IMPL? Because the expansion in codegenarmarch.cpp uses 64b madd (or if we need some kind of zero extend along that path)

uint64_t data = *reinterpret_cast<uint64_t*>(&add);
unsigned hash = old;
hash = genTreeHashAdd(hash, (unsigned)data);
hash = genTreeHashAdd(hash, (unsigned)(data >> sizeof(unsigned)));

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.

Nit, think you meant (data >> (8 * sizeof(unsigned)))

}
else
{
*pInxVN = inxVN;

@dhartglassMSFT dhartglassMSFT Oct 15, 2026 •

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.

can constIndexOffset be non-zero here? If not, can you assert? (Think this code might need to take nonzero const index into account)

This branch has not been deployed

No deployments
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.

5 participants