]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
xtensa: Use HARD_REG_SET instead of bare integer
authorTakayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>
Tue, 4 Jul 2023 00:57:03 +0000 (09:57 +0900)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 4 Jul 2023 15:38:17 +0000 (08:38 -0700)
gcc/ChangeLog:

* config/xtensa/xtensa.cc (machine_function, xtensa_expand_prologue):
Change to use HARD_REG_BIT and its macros.
* config/xtensa/xtensa.md
(peephole2: regmove elimination during DFmode input reload):
Likewise.

gcc/config/xtensa/xtensa.cc
gcc/config/xtensa/xtensa.md

index 3298d53493c035c7b85bd68ad85348cea5023503..992e80d824db5c22b9e114f2fd7470fb9b8bd9c0 100644 (file)
@@ -107,7 +107,7 @@ struct GTY(()) machine_function
   bool epilogue_done;
   bool inhibit_logues_a1_adjusts;
   rtx last_logues_a9_content;
-  HOST_WIDE_INT eliminated_callee_saved_bmp;
+  HARD_REG_SET eliminated_callee_saved;
 };
 
 static void xtensa_option_override (void);
@@ -3586,7 +3586,8 @@ xtensa_expand_prologue (void)
                df_insn_rescan (insnS);
                SET_SRC (PATTERN (insnR)) = copy_rtx (mem);
                df_insn_rescan (insnR);
-               cfun->machine->eliminated_callee_saved_bmp |= 1 << regno;
+               SET_HARD_REG_BIT (cfun->machine->eliminated_callee_saved,
+                                 regno);
              }
            else
              {
@@ -3690,8 +3691,8 @@ xtensa_expand_epilogue (bool sibcall_p)
       for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno)
        if (xtensa_call_save_reg(regno))
          {
-           if (! (cfun->machine->eliminated_callee_saved_bmp
-                  & (1 << regno)))
+           if (! TEST_HARD_REG_BIT (cfun->machine->eliminated_callee_saved,
+                                    regno))
              {
                rtx x = gen_rtx_PLUS (Pmode,
                                      stack_pointer_rtx, GEN_INT (offset));
index 664424f123920dc06c831c2a4ff0c4b9f69a3e12..5386e45b51da394ea4dbd594f59be312a2a17778 100644 (file)
    (set (match_dup 3)
        (match_dup 7))]
 {
-  uint32_t check = 0;
+  HARD_REG_SET regs;
   int i;
+  CLEAR_HARD_REG_SET (regs);
   for (i = 0; i <= 3; ++i)
-    {
-      uint32_t mask = (uint32_t)1 << REGNO (operands[i]);
-      if (check & mask)
-       FAIL;
-      check |= mask;
-    }
+    if (TEST_HARD_REG_BIT (regs, REGNO (operands[i])))
+      FAIL;
+    else
+      SET_HARD_REG_BIT (regs, REGNO (operands[i]));
   operands[6] = gen_rtx_MEM (SFmode, XEXP (operands[6], 0));
   operands[7] = gen_rtx_MEM (SFmode, XEXP (operands[7], 0));
 })