-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Adds ccmp
logic into emitter backend.
#112153
Conversation
1. Emitter unit testsThe left is output from 2. Intel SDE testingTest run with SDE: 3. SuperPMI resultsDiffs are based on 2,623,457 contexts (1,043,127 MinOpts, 1,580,330 FullOpts). MISSED contexts: 2,983 (0.11%) Base JIT options: JitBypassApxCheck=1 Diff JIT options: JitBypassApxCheck=1 No diffs found. DetailsContext information
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
c8459bb
to
3f154a9
Compare
I believe failures are related to #112163 |
@dotnet/jit-contrib could we get this looked at for a review to see if any changes are needed? |
CC @amanasifkhalid and @EgorBo for code review. |
Do you have any idea why it shows up to 0.36% TP regression? Presumably, it's supposed to be zero-diff change? |
The |
There are a few places where We could adjust it so it only triggers for TARGET_AMD64 and not TARGET_X86. It currently follows the same precedent as |
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.
It would be nice to reduce the TP impact if possible. If this doesn't apply to x86, definitely make SetDFVIfNeeded() ifdef'ed for AMD64 (maybe create an empty function for x86 so call sites don't change). The full TP impact is only on MinOpts, fwiw.
_idCustom2 = ((value >> 1) & 1); | ||
_idCustom3 = ((value >> 2) & 1); | ||
_idCustom4 = ((value >> 3) & 1); | ||
} |
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.
Consider adding:
assert(value == idGetEvexDFV());
src/coreclr/jit/codegenxarch.cpp
Outdated
emitter* theEmitter = GetEmitter(); | ||
genDefineTempLabel(genCreateTempLabel()); | ||
|
||
// #ifdef COMMENTOUT |
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.
remove
src/coreclr/jit/codegenxarch.cpp
Outdated
CORINFO_FIELD_HANDLE hnd = theEmitter->emitFltOrDblConst(1.0f, EA_4BYTE); | ||
theEmitter->emitIns_R_C(INS_ccmpe, EA_4BYTE, REG_RAX, hnd, 0, INS_OPTS_EVEX_dfv_cf); | ||
theEmitter->emitIns_R_C(INS_ccmpe, EA_4BYTE, REG_RAX, hnd, 4, INS_OPTS_EVEX_dfv_cf); | ||
// #endif |
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.
remove
3f154a9
to
f0e0b7e
Compare
f0e0b7e
to
2e9ecb6
Compare
FYI throughput impact removed on x86 https://dev.azure.com/dnceng-public/public/_build/results?buildId=953002&view=ms.vss-build-web.run-extensions-tab |
* main: (71 commits) Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250212.3 (dotnet#112626) JIT: Unify struct arg morphing (dotnet#112612) Enable `SA1015`: Closing generic bracket should not be followed by a space (dotnet#112597) Clean up normalizeLocale for mono browser target (dotnet#112575) SPMI: Ensure proper zero extension for isObjectImmutable and friends (dotnet#112617) Quote --version-scripts path (dotnet#112603) Remove incompatible API from PKCS netstandard2.0 lib [main] Update dependencies from dotnet/emsdk (dotnet#112393) Avoid `Unsafe.As` in `RangeCharSearchValues` (dotnet#112606) Fixed the issue of incorrect return value of PalVirtualAlloc (dotnet#112579) Fix size used for vectorization check in BitArray (dotnet#111558) (dotnet#111564) Fix build of windows arm64 crossdac (dotnet#112553) Simplify `ShuffleTakeIterator.GetCount` (dotnet#112593) Fix VS div-by-0 in DacEnumerableHashTable code (dotnet#112542) R2RDump: normalize GC info totalInterruptibleLength (dotnet#112003) Fix alignment padding and add test for saving managed resources (dotnet#110915) Adds `ccmp` logic into emitter backend. (dotnet#112153) Disable AVX10.2 by default (dotnet#112572) Outbox AesGcm in to Microsoft.Bcl.Cryptography Make test `IUnknown` conforming (dotnet#112566) ...
Overview
This PR adds APX new
ccmp
instruction to the X86 backend.Design
For reference, there is a unique extended evex encoding for
ccmp
:where
SC0
-SC3
encode the condition forccmp
to conditionally execute on (please see SDM Vol 1, Appendix B). If the status codes fail to satisfy the condition encoded bySC0
-SC3
, no compare will be performed, and theOF
,SF,
ZF, andCF
flags will be set to the default flag value (DFV) fieldsof
,sf
,zf
andcf
.Testing
Note: The testing plan for APX work has been discussed in #106557, please refer to that PR for details, only results and comments will be posted in this PR. Results