Skip to content
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

Add Arm64 encoding for IF_SVE_BL_1A #97223

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

a74nh
Copy link
Contributor

@a74nh a74nh commented Jan 19, 2024

These instructions use a pattern to specify which elements to count from a predicate. This is encoded as 5 bits in the instruction. I've added a new entry in instrdesc union (to prevent it increasing the size).

Imm encoding is a 4bit number representing 1 to 16, so 1 needs subtracting when encoding.

New clr test output (identical to capstone):

cntb x0, pow2
cntd lr, vl1, mul #16
cnth x12, vl7, mul #5
cntw x23, vl256, mul #7
cntb x21, mul4, mul #8
cntd x15, mul3, mul #10
cnth x5, all, mul #13

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Jan 19, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jan 19, 2024
@ghost
Copy link

ghost commented Jan 19, 2024

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

Issue Details

These instructions use a pattern to specify which elements to count from a predicate. This is encoded as 5 bits in the instruction. I've added a new entry in instrdesc union (to prevent it increasing the size).

New clr test output (identical to capstone):

cntb x0, pow2
cntd lr, vl1, mul #16
cnth x12, vl7, mul #5
cntw x23, vl256, mul #7
cntb x21, mul4, mul #8
cntd x15, mul3, mul #10
cnth x5, all, mul #13
Author: a74nh
Assignees: -
Labels:

area-CodeGen-coreclr, community-contribution

Milestone: -

@a74nh
Copy link
Contributor Author

a74nh commented Jan 19, 2024

@kunalspathak @dotnet/arm64-contrib

@a74nh a74nh marked this pull request as ready for review January 19, 2024 16:44
Copy link
Contributor

@TIHan TIHan left a comment

Choose a reason for hiding this comment

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

This looks good imo. I see why you have to introduce the new entry because you have to flow that info to the part of the actual encoding.

I'd wait for Kunal's review too before merging.

@kunalspathak kunalspathak added the arm-sve Work related to arm64 SVE/SVE2 support label Jan 22, 2024
Copy link
Member

@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.

A minor comment. Otherwise, LGTM

};

insSvePattern _idSvePattern;
Copy link
Member

Choose a reason for hiding this comment

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

this looks ok to me, but wondering why not just have something like this after the end of struct definition.

#ifdef TARGET_ARM64
  insSvePattern _idSvePattern;
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Happy to switch to that.

My reasoning was when you look at the whole file we have an #ifdef for each target. Many of them just have the same thing (_idReg3 and _idReg4). The nesting of the Arm32/Arm64 is a little messy to read and doesn't fit the rest of the file style. Splitting it made it simpler.

Copy link
Member

@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.

LGTM

@kunalspathak kunalspathak merged commit 55fbb23 into dotnet:main Jan 23, 2024
126 of 129 checks passed
@a74nh a74nh deleted the IF_SVE_BL_1A_github branch January 24, 2024 10:56
@github-actions github-actions bot locked and limited conversation to collaborators Feb 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI arm-sve Work related to arm64 SVE/SVE2 support 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.

3 participants