-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JIT] Add legacy extended EVEX encoding and EVEX.ND/NF feature to x64…
… emitter backend (#108796) * Ruihan: POC with REX2 Update comments. Merge the REX2 changes into the original legacy emit path bug fix: Set REX2.W with correct mask code. register encoding and prefix emitting logics. Add REX2 prefix emit logic bug fixes Add Stress mode for REX2 encoding and some bug fixes resolve comments: 1. add assertion check for UD opcodes. 2. add checks for EGPRs. Add REX2 to emitOutputAM, and let LEA to be REX2 compatible. Add REX2.X encoding for SIB byte But fixes: add REX2 prefix on the path in RI where MOV is specially handled. Enable REX2 encoding for `movups` fixed bugs in REX2 prefix emitting logic when working with map 1 instructions, and enabled REX2 for POPCNT legacy map index-er bug fixes some clean-up Adding initial APX unit testing path. Adding a coredistools dll that has LLVM APX disasm capability. It must be coppied into a CORE_ROOT manually. clean up work for REX2 narrow the REX2 scope to `sub` only some clean up based on the comments. bug fix resolve comment * resolve comments * refactor register encoding for REX2 * merge REX2 path to legacy path * Enable REX2 in more instructions. * Avoid repeatedly estimate the size of REX2 prefix * Enable REX2 encoding on RI and SV path - SV path is mostly for debugging purposes Added encoding unit tests for instructions with immediates * Add rex2 support to rotate and shift. * CR session. * Testing infra updates: assert REX2 is enabled. Code refactoring: AddX86PrefixIfNeeded. * revert rcl_N and rcr_N, tp and latency data for these instructions is missing in JIT, may indicate these instructions are not being used in JIT, drop them for now. * partially enable REX2 on emitOutputAM, case covered: R_AR and AR_R. * Adding unit tests. * push, pop, inc, dec, neg, not, xadd, shld, shrd, cmpxchg, setcc, bswap. * bug fix for bswap * bt * xchg, idiv * Make sure add REX2 prefix if register encoding for EGPRs are being called before adding any prefix. * Ensure code size is correctly computed in R_R_I path. * clean up * Change all AddSimdPrefix to AddX86Prefix Refactor REX2 encoding stress logics. * div, mulEAX * filter out test from REX2 encoding when using ACC form. (this will have side effect that the estimated code will go up and mismatch with actual code size.) * Make sure REX prefix will not be added when emitting with REX2. * resolve comments. * make sure the APX debug knob is only available under debug build. * clean up some out-dated code. * enable movsxd * Enable "Call" * Enable "JMP" * resolve merge errors * formatting * remote coredistools.dll for internal tests only * bug fix * SUB reg, reg, reg * enable NDD on genCodeForBinary * consolidate TakesLegacyPromotedEvexPrefix logics. * ensure register encoding is correct under legacy-promoted-evex encoding. * Make sure the overflow check is correctly emitted. * simplify the compiler setup logics. * emitInsNddBinary * make sure REX will not be added when EVEX presents. * resolve comment and clean up. * enable more NDD instructions. * bug fixes * enable imul * add emitter unit tests, and fix encoding error for CMOVcc * bug fixes: 1. make sure RWR_RRD_SHF has correct register update mode 2. make sure shift instructions will get correct opcode in RR path. * refactor emitInsBinary * clean up * clean up and refactor some code * make sure the code size estimation is correct for some apx promoted instructions. * add tuning knob to EVEX.ND feature. * flip the Evex.nd knob. * put NDD control knob to the correct place. * resolve merge errors * Make sure APX related knobs are defined properly across platforms * Add Evex.nf to instrDesc * {nf} add reg, reg * Enable EVEX.NF in more instructions * more instructions * comments. * lzcnt, tzcnt, popcnt * Exclude ACC form from EVEX promotion. * BMI instructions. * bug fixes * Tweak the code size calculation to make sure REX2 and APX-EVEX are properly handled. * bug fixes for stress mode * Add idEvexNoPromotion to emitter to exclude the APX-EVEX promotion from LOCK prefixd instructions. * resolve merge error * fix merge error * Revert "Add idEvexNoPromotion to emitter to exclude the APX-EVEX promotion from LOCK prefixd instructions." This reverts commit 1be4b12. * bug fix * introduce _no_evex suffix for some instructions for cases when LOCK will be prefixed. * resolve merge comflict * fix merge error. * fix comments and some checks. * formatting * remove unneeded env var. * Make sure the BMI instruction is properly hidden behind APX stress knob and will not be EVEX-encoded when JitStressEvexEncoding is set. * resolve merge error. * Resolve comments. * formatting. * Add rcr/rcl emitter unit tests for extended EVEX. * Resolve merge error. * formatting * resolve comments * formatting * use the right size for neg and not code gen.
- Loading branch information
1 parent
4e01649
commit f652094
Showing
10 changed files
with
1,614 additions
and
412 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.