Skip to content

Arm64 SVE: re-enable use of predicate variants #116854

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

Closed
wants to merge 7 commits into from

Conversation

a74nh
Copy link
Contributor

@a74nh a74nh commented Jun 20, 2025

Fixes #101970

Predicate variants were implemented, and then turned off in #115566.

Adds a simple costing to fgMorphTryUseAllMaskVariant() and assumes nodes can always be converted to masks (using ConvertVectorToMask).

Fixes dotnet#101970

in dotnet#115566

Adds a simple costing to fgMorphTryUseAllMaskVariant() and assumes
nodes can always be converted to masks (using ConvertVectorToMask).
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jun 20, 2025
@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 Jun 20, 2025
Copy link
Contributor

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

@@ -1993,6 +1993,104 @@ SveMaskPattern EvaluateSimdMaskToPattern(var_types baseType, simdmask_t arg0)
}
}
}

template <typename TSimd, typename TBase>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same changes to this file also exist in #116852. I'll remove from one PR when the other is merged.

@a74nh a74nh marked this pull request as ready for review June 20, 2025 12:33
@a74nh a74nh marked this pull request as draft June 20, 2025 12:35
@a74nh a74nh marked this pull request as ready for review June 20, 2025 13:38
@a74nh
Copy link
Contributor Author

a74nh commented Jun 20, 2025

@kunalspathak

Copy link
Contributor

@kunalspathak kunalspathak left a comment

Choose a reason for hiding this comment

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

added some comments

// depending on if the corresponding input element
// has its least significant bit set

// For Arm64 we have count total bits to write, but they are sizeof(TBase)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These changes to EvaluateSimdCvtVectorToMask() fix the fuzzlyn errors in HEAD. In jitted code we use CMPNE against 0 to convert from vector to mask, therefore we need to match that here.

I've also made the same changes to the new function EvaluateSimdVectorToPattern()

@kunalspathak
Copy link
Contributor

/azp run Antigen,Fuzzlyn

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@kunalspathak
Copy link
Contributor

Looks like Antigen and Fuzzlyn are still not happy

@a74nh
Copy link
Contributor Author

a74nh commented Jun 24, 2025

Discussed offline: The fuzzlyn errors are mostly due to there being more opportunities for conversions between masks and vectors and there being issues in the way we handle that. We should pause this PR until we get that sorted out first.

a74nh added a commit to a74nh/runtime that referenced this pull request Jul 4, 2025
Fixes dotnet#101970

Predicate variants were implemented in dotnet#114438 and then turned off in dotnet#115566. The code was then removed in dotnet#117101 when the AMD64 version was moved to from morph to folding.

This is a simple rework of that code.
Replaces dotnet#116854
@a74nh
Copy link
Contributor Author

a74nh commented Jul 4, 2025

This needs a complete re-work given the recent changes everywhere. New PR raised as #117313

@a74nh a74nh closed this Jul 4, 2025
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.

ARM64-SVE: Use predicate versions of instructions
2 participants