]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386: Use various predicates instead of open coding them
authorUros Bizjak <ubizjak@gmail.com>
Wed, 16 Jul 2025 18:11:10 +0000 (20:11 +0200)
committerUros Bizjak <ubizjak@gmail.com>
Wed, 16 Jul 2025 18:19:09 +0000 (20:19 +0200)
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.

gcc/config/i386/i386-expand.cc
gcc/config/i386/i386-features.cc
gcc/config/i386/i386.cc

index 8bacd296fa4d37ebacadf62d26f3492c9b43cea0..743ca2fb8e274732f048226afe02ac5f6852c399 100644 (file)
@@ -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);
index bab191b196fab740b682097808a5421bf26efd64..c131577805faa9608d817e3aab7747299c1c18b7 100644 (file)
@@ -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;
index 11a724a0bd7ad42a685edb1914e48d396885a1a7..d45ffb1892f0fb592a2a05cd4f7b1b78c93022c2 100644 (file)
@@ -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);