x86: tighten .insn SAE and broadcast checking
authorJan Beulich <jbeulich@suse.com>
Wed, 27 Sep 2023 08:54:23 +0000 (10:54 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 27 Sep 2023 08:54:23 +0000 (10:54 +0200)
SAE / embedded rounding are invalid when there's the memory operand, as
the bit encoding this specifies broadcast in that case.

Broadcast needs to be specified on the memory operand.

gas/config/tc-i386.c

index aec4f211faada4344687e7c77c153326399d3432..5df9fde2b29337f10f5be849ec76432bf28b9dce 100644 (file)
@@ -11546,8 +11546,9 @@ s_insn (int dummy ATTRIBUTE_UNUSED)
          ? i.broadcast.type || i.broadcast.bytes
            || i.rounding.type != rc_none
            || i.mask.reg
-         : (i.broadcast.type || i.broadcast.bytes)
-           && i.rounding.type != rc_none))
+         : (i.mem_operands && i.rounding.type != rc_none)
+           || ((i.broadcast.type || i.broadcast.bytes)
+               && !(i.flags[i.broadcast.operand] & Operand_Mem))))
     {
       as_bad (_("conflicting .insn operands"));
       goto done;