public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] x86: tighten .insn SAE and broadcast checking
@ 2023-09-25 12:37 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2023-09-25 12:37 UTC (permalink / raw)
  To: Binutils; +Cc: H.J. Lu

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.
---
Arguably, until the AVX10 spec spells out how embedded rounding is to be
encoded for 256-bit operations, we may need to further insist on EVEX512
or EVEXLIG to be specified. In practice that would end up overly
limiting though, as can be observed when using .insn to encode APX insns
(where EVEX.brs is overloaded by EVEX.nd).

--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -11538,8 +11538,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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-25 12:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-25 12:37 [PATCH] x86: tighten .insn SAE and broadcast checking Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).