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. |
BruceForstall
left a comment
There was a problem hiding this comment.
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.handinstrsarm64_sve.hfor SVE encodings. They are separate from existingemitfmtsarm64.handinstrsarm64.hbecause 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
instrDescto include the new size of_idInsand_idInsFmt. Here are the offsets before/after:Before:
After:
Nomenclature
sve_to differentiate them from regular instructions, e.g.INS_sve_movvs.INS_mov.SVE_to differentiate from existing instruction formats. e.g.IF_SVE_AB_3Avs.IF_DI_3A.SVE_WW_XY, whereWWis unique code likeAA,AB, etc.,Xrepresents number of registers the instruction operates on,Yrepresents unique codeA,Bdepending 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.handinstrsarm64_sve.h. The plan is to open source the tool and check it in https://github.com/dotnet/jitutils/.Contributes to #93095