From 07d618b91f50816f198abac7df116e83d47ca1be Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 4 Jul 2023 17:00:15 +0200 Subject: x86: re-work EVEX-z-without-masking check Rather than corrupting disassmbly altogether, flag EVEX.z set as bad when masking isn't in effect in the first place at the time the destination operand is actually processed. --- opcodes/i386-dis.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'opcodes') diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 15a0e1b..690e336 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -9905,9 +9905,15 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) oappend (&ins, "{"); oappend_register (&ins, reg_name); oappend (&ins, "}"); + + if (ins.vex.zeroing) + oappend (&ins, "{z}"); + } + else if (ins.vex.zeroing) + { + oappend (&ins, "{bad}"); + continue; } - if (ins.vex.zeroing) - oappend (&ins, "{z}"); /* S/G insns require a mask and don't allow zeroing-masking. */ @@ -9985,14 +9991,6 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) goto out; } - /* If EVEX.z is set, there must be an actual mask register in use. */ - if (ins.vex.zeroing && ins.vex.mask_register_specifier == 0) - { - i386_dis_printf (info, dis_style_text, "(bad)"); - ret = ins.end_codep - priv.the_buffer; - goto out; - } - switch (dp->prefix_requirement) { case PREFIX_DATA: -- cgit v1.1