-
Notifications
You must be signed in to change notification settings - Fork 154
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
Incorrect UBIT handling for VSIB instructions #338
Comments
Hi, According to Intel's APX public specification, instructions with As shown below, the X4 (or U) bit is not used in the VSIB memory address calculation: In XED, the ILD scanner applies the same reinterpretation when APX is enabled, consistent with the spec: Lines 1392 to 1398 in b86dd50
|
Hi @marjevan , thanks a lot for clarifying! Our UBIT check was too strict for "legacy" EVEX instructions and did not consider the |
Hi @marjevan , short follow up question, if you don't mind. Is there a specific reason for using a For example: {
ICLASS: TILELOADD
CPL: 3
CATEGORY: AMX_TILE
EXTENSION: APXEVEX
ISA_SET: APX_F_AMX
EXCEPTIONS: AMX-E3-EVEX
REAL_OPCODE: Y
ATTRIBUTES: DISP8_NO_SCALE NOTSX SPECIAL_AGEN_REQUIRED
PATTERN: EVV 0x4B VF2 V0F38 MOD[mm] MOD!=3 REG[rrr] RM[0b100] MODRM() BCRC=0 UBIT=1 W0 VL128 mode64 NOEVSR ZEROING=0 MASK=0
OPERANDS: REG0=TMM_R3():w:tv:u32 MEM0:r:ptr:u32
IFORM: TILELOADD_TMMu32_MEMu32_APX
} This is currently unclear for me as these instructions are only available if APX is enabled anyways, which means that the relaxed UBIT handling always applies (all These are as well the only APX definitions that do not use the The SDM as well defines them using the EEVEX fields, e.g.:
|
Hi, In theory, some new EVEX instructions might be valid on non-APX systems and would require a UBIT constraint, but this doesn't apply to the APX-promoted instructions (as above). We may consider removing the UBIT constraint leftovers for APX-promoted instructions in the future as a refinement - though this wouldn’t impact decoding functionality and would primarily serve as an internal enhancement. As for the NF pattern constraint, adding it would require an additional restriction on the lower 2 bits of the EVEX.mask field. We aim to keep the instruction pattern as compact as possible to decrease the number of keys calculated for the instruction hash tables, as this can influence performance. |
Hi @marjevan, thanks again for the fast reply!
👍 Yes, this was the intention of my question here.
Understood the performance concern, but why would this restriction be required for just the In all other places you handle this by adding the
to:
This uses the same amount of restrictions ( Or is there a special detail to the |
The release updates XED according to Intel's latest ISA publications, as detailed in ISE054, ISE055 and AVX10.2-rev2.0. This version includes support for: - Intel Diamond Rapids (DMR) chip - Diamond Rapids AMX instructions - MOVRS and AVX10-MOVRS instructions - SM4 EVEX instructions - MSR-IMM instructions (including APX-promoted variants) - Encoding updates for various AVX10.2 instructions - Other updates across XED chip definitions General - Shared Library Build for Python: Introduces a unique XED shared library build, exposing all XED APIs via a shared library object. This enables the library to be loaded in Python environments, allowing interaction with XED using Python APIs. See the [examples in pyext/README.md](pyext/examples/README.md) for more details. (Closes intelxed#302) - Disassembler Enhancements: Adds support for emitting CS/DS ignored branch hint prefixes, configurable through the `xed_format_options_t` structure. - Updates minimum Python requirement from 3.8 to 3.9. - Improves Internal ISA definition APX files (See intelxed#338) Fixes - Resolves C11 build warnings with GCC (Fixes intelxed#332) - Improves length and error reporting for illegal instructions caused by a zeroed EVEX map (Resolves intelxed#334) Co-authored-by: Arjevani, Maor <[email protected]>
Hi there,
while running some tests in Zydis, we found a few instructions that do decode in Zydis, but not in XED. After looking at it in detail, I think this might be a bug in XED.
For example:
62 EA F9 01 93 04 11
(XED:vgatherqpd xmm16, k1, qword ptr [r17+xmm18*1]
)62 62 FD 06 A0 A4 A4 3E 25 62 62
(XED:vpscatterdq qword ptr ss:[rsp+xmm20*4+0x6262253E] {k6}, xmm28
)All of these instructions have
EVEX.U
set to0
which is not allowed for "legacy EVEX" instructions, but XED still decodes them.It even seems that you even added
UBIT=1
to the patterns of these instructions, but it seems to be ignored when decoding:We have not checked further to see if only VSIB instructions are affected or if this behavior applies to other "legacy evex" instructions as well.
cc @mappzor
The text was updated successfully, but these errors were encountered: