disp8: Fix issue #185 - EVEX compressed shift for MOVDDUP tuple type

MOVDDUP tuple type uses a compression shift for the disp8 addressing
scheme. The shift depends on the vector lenght and is defined as 8 for
128 bits, 32 for 256 bits and 64 for 512 bits.

Current implementation doesn't work for the 128 bit vector case since
the expression used evaluates to 16 instead of 8. Fix it with a special
if check before the current expression is returned.

Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
This commit is contained in:
Maciej Wieczor-Retman 2026-01-27 22:16:14 +01:00
parent 3f188d7222
commit 89682def9b

View file

@ -73,6 +73,12 @@ static inline unsigned int get_disp8_shift(const insn *ins)
/* MOVDDUP */
case DUP:
/*
* 128-bit vector case doesn't follow the same formula as 256- and
* 512-bit vectors.
*/
if (!vectlen)
return 3;
return vectlen + 4;
default: