-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Arm64: SVE/SVE2 encodings #94285
Arm64: SVE/SVE2 encodings #94285
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsSummaryAdd SVE/SVE2 encodings for all the possible instructions. Stats:
DesignI have added 2 new files Nomenclature
Arm64 Encoding generation toolAs mentioned in #93095, it is impossible to hand write each encoding by looking at the manual. Hence, I wrote a small tool that parses the manual available in xml format on Arm site and generate C++ code that is included in Contributes to #93095
|
@dotnet/jit-contrib |
On @BruceForstall 's suggestion, I just made a PR #94310 that changes the offsets of |
Am I right in thinking the overall size of a In #94310, instead of increasing the variables, what happens if you instead add padding? Eg:
etc for all the other fields. Thinking ahead, SME is going to add a similar slowdown. What about if SVE instruction enum started again from 0. The same with all the instruction formats. Treat it as a separate architecture. |
It was and is 16 bytes.
That will be lot of methods though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good to me. You can follow up with my comments/questions in a follow-up if desired.
* Add encodings for SVE * Adjust the offsets * jit format * fix the build for riscV64 * Address review feedback from Bruce * Rename files to remove _ * forgot to rename file names in other places Change-Id: I54932d16104a2582d9afc3fca6844183aa8c3536
Summary
Add SVE/SVE2 encodings for all the possible instructions.
Stats:
Design
I have added 2 new files
emitfmtsarm64_sve.h
andinstrsarm64_sve.h
for SVE encodings. They are separate from existingemitfmtsarm64.h
andinstrsarm64.h
because had we added SVE encodings in existing files that contains general/NEON instructions, it would impact JIT throughput heavily specially around the code to retrieve hex code for non-sve instructions. The instruction table preparation happens using existing machinery in a separate methodemitSveInsCode()
. The codegen, depending on the intrinsic, will callemitSveInsCode()
and thus without affecting the code path of non-sve instructions.I had to readjust the offsets of
instrDesc
to include the new size of_idIns
and_idInsFmt
. Here are the offsets before/after:Before:
After:
Nomenclature
sve_
to differentiate them from regular instructions, e.g.INS_sve_mov
vs.INS_mov
.SVE_
to differentiate from existing instruction formats. e.g.IF_SVE_AB_3A
vs.IF_DI_3A
.SVE_WW_XY
, whereWW
is unique code likeAA
,AB
, etc.,X
represents number of registers the instruction operates on,Y
represents unique codeA
,B
depending on if same instruction has different formats.Arm64 Encoding generation tool
As mentioned in #93095, it is impossible to hand write each encoding by looking at the manual. Hence, I wrote a small tool that parses the manual available in xml format on Arm site and generate C++ code that is included in
emitfmtsarm64_sve.h
andinstrsarm64_sve.h
. The plan is to open source the tool and check it in https://github.com/dotnet/jitutils/.Contributes to #93095