https://gcc.gnu.org/g:c35018532a0a902f5373dec89edde2358ba07563

commit r16-2303-gc35018532a0a902f5373dec89edde2358ba07563
Author: Uros Bizjak <ubiz...@gmail.com>
Date:   Wed Jul 16 20:11:10 2025 +0200

    i386: Use various predicates instead of open coding them
    
    No functional changes.
    
    gcc/ChangeLog:
    
            * config/i386/i386-expand.cc (ix86_expand_move):
            Use MEM_P predicate instead of open coding it.
            (ix86_erase_embedded_rounding):
            Use NONJUMP_INSN_P predicate instead of open coding it.
            * config/i386/i386-features.cc (convertible_comparison_p):
            Use REG_P predicate instead of open coding it.
            * config/i386/i386.cc (ix86_rtx_costs):
            Use SUBREG_P predicate instead of open coding it.

Diff:
---
 gcc/config/i386/i386-expand.cc   | 4 ++--
 gcc/config/i386/i386-features.cc | 2 +-
 gcc/config/i386/i386.cc          | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
index 8bacd296fa4d..743ca2fb8e27 100644
--- a/gcc/config/i386/i386-expand.cc
+++ b/gcc/config/i386/i386-expand.cc
@@ -487,7 +487,7 @@ ix86_expand_move (machine_mode mode, rtx operands[])
                op1 = machopic_legitimize_pic_address (op1, mode,
                                                       tmp == op1 ? 0 : tmp);
            }
-         if (op0 != op1 && GET_CODE (op0) != MEM)
+         if (op0 != op1 && !MEM_P (op0))
            {
              rtx insn = gen_rtx_SET (op0, op1);
              emit_insn (insn);
@@ -12612,7 +12612,7 @@ ix86_expand_args_builtin (const struct 
builtin_description *d,
 static rtx
 ix86_erase_embedded_rounding (rtx pat)
 {
-  if (GET_CODE (pat) == INSN)
+  if (NONJUMP_INSN_P (pat))
     pat = PATTERN (pat);
 
   gcc_assert (GET_CODE (pat) == SET);
diff --git a/gcc/config/i386/i386-features.cc b/gcc/config/i386/i386-features.cc
index bab191b196fa..c131577805fa 100644
--- a/gcc/config/i386/i386-features.cc
+++ b/gcc/config/i386/i386-features.cc
@@ -2141,7 +2141,7 @@ convertible_comparison_p (rtx_insn *insn, enum 
machine_mode mode)
 
   gcc_assert (GET_CODE (src) == COMPARE);
 
-  if (GET_CODE (dst) != REG
+  if (!REG_P (dst)
       || REGNO (dst) != FLAGS_REG
       || GET_MODE (dst) != CCZmode)
     return false;
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index 11a724a0bd7a..d45ffb1892f0 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -23086,7 +23086,7 @@ ix86_rtx_costs (rtx x, machine_mode mode, int 
outer_code_i, int opno,
          /* Make (subreg:V4SI (not:V16QI (reg:V16QI ..)) 0)
             cost the same as register.
             This is used by avx_cmp<mode>3_ltint_not.  */
-         if (GET_CODE (unsop0) == SUBREG)
+         if (SUBREG_P (unsop0))
            unsop0 = XEXP (unsop0, 0);
          if (GET_CODE (unsop0) == NOT)
            unsop0 = XEXP (unsop0, 0);

Reply via email to