https://gcc.gnu.org/g:1fbce3252bc00b1678cdf62b8798a94962e99f76

commit r15-2689-g1fbce3252bc00b1678cdf62b8798a94962e99f76
Author: Lingling Kong <lingling.k...@intel.com>
Date:   Fri Aug 2 16:52:33 2024 +0800

    i386: Fix comment/naming for APX NDD constraints
    
    gcc/ChangeLog:
    
            * config/i386/constraints.md: Fixed the comment/naming for je/jM/jO.
            * config/i386/predicates.md (apx_ndd_memory_operand): Renamed and
            fixed the comment.
            (apx_evex_memory_operand): New name.
            (apx_ndd_add_memory_operand): Ditto.
            (apx_evex_add_memory_operand): Ditto.

Diff:
---
 gcc/config/i386/constraints.md | 13 +++++++------
 gcc/config/i386/predicates.md  | 22 ++++++++++++----------
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/gcc/config/i386/constraints.md b/gcc/config/i386/constraints.md
index 18389c478002..91a63089a967 100644
--- a/gcc/config/i386/constraints.md
+++ b/gcc/config/i386/constraints.md
@@ -463,14 +463,15 @@
  "TARGET_APX_EGPR && !TARGET_AVX ? GENERAL_GPR16 : GENERAL_REGS")
 
 (define_memory_constraint "je"
-  "@internal Memory operand for APX NDD ADD."
-  (match_operand 0 "apx_ndd_add_memory_operand"))
+  "@internal Memory operand for APX EVEX-encoded ADD (i.e. APX NDD/NF)."
+  (match_operand 0 "apx_evex_add_memory_operand"))
 
 (define_memory_constraint "jM"
-  "@internal Memory operand, with APX NDD check."
-  (match_operand 0 "apx_ndd_memory_operand"))
+  "@internal Memory operand, with APX EVEX-encoded (i.e. APX NDD/NF) check."
+  (match_operand 0 "apx_evex_memory_operand"))
 
 (define_memory_constraint "jO"
-  "@internal Offsettable memory operand, with APX NDD check."
-  (and (match_operand 0 "apx_ndd_memory_operand")
+  "@internal Offsettable memory operand, with APX EVEX-encoded
+   (i.e. APX NDD/NF) check."
+  (and (match_operand 0 "apx_evex_memory_operand")
           (match_test "offsettable_nonstrict_memref_p (op)")))
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index 680594871de0..ab6a2e14d355 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -2265,10 +2265,10 @@
 })
 
 ;; Return true if OP is a memory operand that can be also used in APX
-;; NDD patterns with immediate operand.  With non-default address space,
-;; segment register or address size prefix, APX NDD instruction length
-;; can exceed the 15 byte size limit.
-(define_predicate "apx_ndd_memory_operand"
+;; EVEX-encoded patterns (i.e. APX NDD/NF) with immediate operand.  With
+;; non-default address space, segment register or address size prefix,
+;; APX EVEX-encoded instruction length can exceed the 15 byte size limit.
+(define_predicate "apx_evex_memory_operand"
   (match_operand 0 "memory_operand")
 {
   /* OK if immediate operand size < 4 bytes.  */
@@ -2312,19 +2312,21 @@
   return true;
 })
 
-;; Return true if OP is a memory operand which can be used in APX NDD
-;; ADD with register source operand.  UNSPEC_GOTNTPOFF memory operand
-;; is allowed with APX NDD ADD only if R_X86_64_CODE_6_GOTTPOFF works.
-(define_predicate "apx_ndd_add_memory_operand"
+;; Return true if OP is a memory operand which can be used in APX EVEX-encoded
+;; ADD patterns (i.e. APX NDD/NF) for with register source operand.
+;; UNSPEC_GOTNTPOFF memory operand is allowed with APX EVEX-encoded ADD only if
+;; R_X86_64_CODE_6_GOTTPOFF works.
+(define_predicate "apx_evex_add_memory_operand"
   (match_operand 0 "memory_operand")
 {
-  /* OK if "add %reg1, name@gottpoff(%rip), %reg2" is supported.  */
+  /* OK if "add %reg1, name@gottpoff(%rip), %reg2" or
+   "{nf} add name@gottpoff(%rip), %reg1" are supported.  */
   if (HAVE_AS_R_X86_64_CODE_6_GOTTPOFF)
     return true;
 
   op = XEXP (op, 0);
 
-  /* Disallow APX NDD ADD with UNSPEC_GOTNTPOFF.  */
+  /* Disallow APX EVEX-encoded ADD with UNSPEC_GOTNTPOFF.  */
   if (GET_CODE (op) == CONST
       && GET_CODE (XEXP (op, 0)) == UNSPEC
       && XINT (XEXP (op, 0), 1) == UNSPEC_GOTNTPOFF)

Reply via email to