]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arch: Use VIRTUAL_REGISTER_P predicate.
authorUros Bizjak <ubizjak@gmail.com>
Thu, 20 Apr 2023 15:00:24 +0000 (17:00 +0200)
committerUros Bizjak <ubizjak@gmail.com>
Thu, 20 Apr 2023 15:00:24 +0000 (17:00 +0200)
gcc/ChangeLog:

* config/arm/arm.cc (thumb1_legitimate_address_p):
Use VIRTUAL_REGISTER_P predicate.
(arm_eliminable_register): Ditto.
* config/avr/avr.md (push<mode>_1): Ditto.
* config/bfin/predicates.md (register_no_elim_operand): Ditto.
* config/h8300/predicates.md (register_no_sp_elim_operand): Ditto.
* config/i386/predicates.md (register_no_elim_operand): Ditto.
* config/iq2000/predicates.md (call_insn_operand): Ditto.
* config/microblaze/microblaze.h (CALL_INSN_OP): Ditto.

gcc/config/arm/arm.cc
gcc/config/avr/avr.md
gcc/config/bfin/predicates.md
gcc/config/h8300/predicates.md
gcc/config/i386/predicates.md
gcc/config/iq2000/predicates.md
gcc/config/microblaze/microblaze.h

index bf7ff9a97048c62a360e04945c97b6a4d71cbb03..1164119a3009a9f0ce8984d30dd493e0bcedf334 100644 (file)
@@ -9105,9 +9105,7 @@ thumb1_legitimate_address_p (machine_mode mode, rtx x, int strict_p)
       else if (REG_P (XEXP (x, 0))
               && (REGNO (XEXP (x, 0)) == FRAME_POINTER_REGNUM
                   || REGNO (XEXP (x, 0)) == ARG_POINTER_REGNUM
-                  || (REGNO (XEXP (x, 0)) >= FIRST_VIRTUAL_REGISTER
-                      && REGNO (XEXP (x, 0))
-                         <= LAST_VIRTUAL_POINTER_REGISTER))
+                  || VIRTUAL_REGISTER_P (XEXP (x, 0)))
               && GET_MODE_SIZE (mode) >= 4
               && CONST_INT_P (XEXP (x, 1))
               && (INTVAL (XEXP (x, 1)) & 3) == 0)
@@ -13905,8 +13903,7 @@ arm_eliminable_register (rtx x)
 {
   return REG_P (x) && (REGNO (x) == FRAME_POINTER_REGNUM
                       || REGNO (x) == ARG_POINTER_REGNUM
-                      || (REGNO (x) >= FIRST_VIRTUAL_REGISTER
-                          && REGNO (x) <= LAST_VIRTUAL_REGISTER));
+                      || VIRTUAL_REGISTER_P (x));
 }
 
 /* Return GENERAL_REGS if a scratch register required to reload x to/from
index e581e959e5747c812d9eb348407b4b6ac1223743..43b75046384f4d99471b6547d2ec5e7e4dd4aeca 100644 (file)
         operands[0] = copy_to_mode_reg (<MODE>mode, operands[0]);
       }
     else if (REG_P (operands[0])
-             && IN_RANGE (REGNO (operands[0]), FIRST_VIRTUAL_REGISTER,
-                          LAST_VIRTUAL_REGISTER))
+             && VIRTUAL_REGISTER_P (operands[0]))
       {
         // Byte-wise pushing of virtual regs might result in something like
         //
index 09ec5a4bd86c7e777ef652c00c5fba212b3091db..632634eb0f79c4d38637da7bc5169b0af1e88200 100644 (file)
 (define_predicate "symbol_ref_operand"
   (match_code "symbol_ref"))
 
-;; True for any non-virtual or eliminable register.  Used in places where
+;; True for any non-virtual and non-eliminable register.  Used in places where
 ;; instantiation of such a register may cause the pattern to not be recognized.
 (define_predicate "register_no_elim_operand"
   (match_operand 0 "register_operand")
     op = SUBREG_REG (op);
   return !(op == arg_pointer_rtx
           || op == frame_pointer_rtx
-          || (REGNO (op) >= FIRST_PSEUDO_REGISTER
-              && REGNO (op) <= LAST_VIRTUAL_REGISTER));
+          || VIRTUAL_REGISTER_P (op));
 })
 
 ;; Test for an operator valid in a BImode conditional branch
index 02da8aa413a5c97163fb4ccccbf2b1f3d2aaefc4..486c4d7ce66bc9af8a697b1e0c2fc3eaf61a8a29 100644 (file)
   return !(op == stack_pointer_rtx
           || op == arg_pointer_rtx
           || op == frame_pointer_rtx
-          || IN_RANGE (REGNO (op),
-                       FIRST_PSEUDO_REGISTER, LAST_VIRTUAL_REGISTER));
+          || VIRTUAL_REGISTER_P (op));
 })
 
 ;; Return nonzero if X is a constant whose absolute value is greater
index 3f934277a57124e757c05b109998eae2181fe8b2..e752e20dc73db7bda9e40b719238bf3bc77c520a 100644 (file)
   return register_no_elim_operand (op, mode);
 })
 
-;; True for any non-virtual or eliminable register.  Used in places where
+;; True for any non-virtual and non-eliminable register.  Used in places where
 ;; instantiation of such a register may cause the pattern to not be recognized.
 (define_predicate "register_no_elim_operand"
   (match_operand 0 "register_operand")
 
   return !(op == arg_pointer_rtx
           || op == frame_pointer_rtx
-          || IN_RANGE (REGNO (op),
-                       FIRST_PSEUDO_REGISTER, LAST_VIRTUAL_REGISTER));
+          || VIRTUAL_REGISTER_P (op));
 })
 
 ;; Similarly, but include the stack pointer.  This is used to prevent esp
index 4adc108df46c0cc34e634bd2bcfb8915a73dd1cf..1330f7d613c6636ed5f580a34a1db40b94b7657d 100644 (file)
 {
   return (CONSTANT_ADDRESS_P (op)
          || (GET_CODE (op) == REG && op != arg_pointer_rtx
-             && ! (REGNO (op) >= FIRST_PSEUDO_REGISTER
-                   && REGNO (op) <= LAST_VIRTUAL_REGISTER)));
+             && ! VIRTUAL_REGISTER_P (op)));
 })
 
 ;; Return nonzero if OP is valid as a source operand for a move
index 0398902362b4da186f9b487712ebf3ca00f03a98..8a0e1a76adf200f2c3d3cc28700762efab2b523f 100644 (file)
@@ -372,9 +372,8 @@ extern enum reg_class microblaze_regno_to_class[];
    since they may change into reg + const, which the patterns
    can't handle yet.  */
 #define CALL_INSN_OP(X) (CONSTANT_ADDRESS_P (X) \
-                         || (GET_CODE (X) == REG && X != arg_pointer_rtx\
-                             && ! (REGNO (X) >= FIRST_PSEUDO_REGISTER  \
-                             && REGNO (X) <= LAST_VIRTUAL_REGISTER)))
+                        || (GET_CODE (X) == REG && X != arg_pointer_rtx \
+                            && ! VIRTUAL_REGISTER_P (X)))
 
 /* True if VALUE is a signed 16-bit number.  */
 #define SMALL_OPERAND(VALUE)                                           \