From 2db223a16d1559c152170fe2a602c827a5a95fb3 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 16 Dec 2023 15:24:26 -0800 Subject: fix incorrect register selection for `vpbroadcastm{b2q,w2d}` with `rex.b` set --- src/shared/evex.in | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/shared/evex.in b/src/shared/evex.in index 58ec14a..a43a97e 100644 --- a/src/shared/evex.in +++ b/src/shared/evex.in @@ -2872,6 +2872,8 @@ pub(crate) fn read_evex_operands< if mem_oper == OperandSpec::RegMMM { instruction.mem_size = 0; instruction.regs[1].bank = RegisterBank::K; + // only 8 mask registers, `xed` suggests that any invalid bits are masked out??? + instruction.regs[1].num &= 0b111; } else { return Err(DecodeError::InvalidOperand); } @@ -2897,6 +2899,8 @@ pub(crate) fn read_evex_operands< if mem_oper == OperandSpec::RegMMM { instruction.mem_size = 0; instruction.regs[1].bank = RegisterBank::K; + // only 8 mask registers, `xed` suggests that any invalid bits are masked out??? + instruction.regs[1].num &= 0b111; } else { return Err(DecodeError::InvalidOperand); } -- cgit v1.1