[binutils-gdb] x86: tighten .insn SAE and broadcast checking

Jan Beulich jbeulich@sourceware.org
Wed Sep 27 08:54:54 GMT 2023


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f586e3409b752748bf213520c2dbb0b44e0005d8

commit f586e3409b752748bf213520c2dbb0b44e0005d8
Author: Jan Beulich <jbeulich@suse.com>
Date:   Wed Sep 27 10:54:23 2023 +0200

    x86: tighten .insn SAE and broadcast checking
    
    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.

Diff:
---
 gas/config/tc-i386.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index aec4f211faa..5df9fde2b29 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -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;


More information about the Binutils-cvs mailing list