This fixes emitGetVexPrefixSize to support detecting 2-byte prefix support (#79478)
authorTanner Gooding <tagoo@outlook.com>
Wed, 14 Dec 2022 19:23:41 +0000 (11:23 -0800)
committerGitHub <noreply@github.com>
Wed, 14 Dec 2022 19:23:41 +0000 (11:23 -0800)
commit58e82be63f411b76cd391b2c3f4862686d95590f
tree844393ea82c08506f0af8235ec64486b3d40fc71
parent8e29ce70a41e1ffccc5f47d5d44ee36692098443
This fixes emitGetVexPrefixSize to support detecting 2-byte prefix support (#79478)

* Remove the dead emitOutputRexOrVexPrefixIfNeeded and rename emitOutputSimdPrefixIfNeeded to emitOutputRexOrSimdPrefixIfNeeded

* Remove the dead emitGetAdjustedSize and rename emitGetAdjustedSizeEvexAware to emitGetAdjustedSize

* Simplify the emitGetEvexPrefixSize and emitGetVexPrefixSize methods

* Create helper emitExtractVexPrefix and emitExtractEvexPrefix functions

* Update emitGetVexPrefixSize and emitGetEvexPrefixSize to take an instrDesc

* Update emitGetPrefixSize to take the instrDesc so the VEX prefix size can be computed correctly

* Update emitGetVexPrefixSize to support returning 2 or 3

* Ensure IF_RWR_CNS is handled in emitGetVexPrefixSize

* Don't try to estimate the 2-byte VEX prefix when optimizations are disabled

* Ensure we don't negatively impact estimated alignment sizes for debug code

* Just check MinOpts not OptimizationsDisabled

* Mark some of the modified methods as const to indicate they don't mutate the emitter

* Resolve the throughput issue by not getting optSize untill necessary

* Switch back to doing accurate vex prefix size estimation always

* Small cleanup to reduce regression
src/coreclr/jit/emitxarch.cpp
src/coreclr/jit/emitxarch.h