C-SKY: Delete LO_REGS and HI_REGS, use HILO_REGS instead.
authorGeng Qi <gengqi@linux.alibaba.com>
Mon, 24 May 2021 12:22:53 +0000 (20:22 +0800)
committerXianmiao Qu <xianmiao_qu@c-sky.com>
Tue, 25 May 2021 06:07:20 +0000 (14:07 +0800)
gcc/ChangeLog:

* config/csky/constraints.md ("l", "h"): Delete.
* config/csky/csky.h (reg_class, REG_CLASS_NAMES,
REG_CLASS_CONTENTS):  Delete LO_REGS and HI_REGS.
* config/csky/csky.c (regno_reg_classm,
csky_secondary_reload, csky_register_move_cost):
Use HILO_REGS instead of LO_REGS and HI_REGS.

gcc/config/csky/constraints.md
gcc/config/csky/csky.c
gcc/config/csky/csky.h

index 937cb81..c9bc9f2 100644 (file)
@@ -24,8 +24,6 @@
 (define_register_constraint "b" "LOW_REGS"  "r0 - r15")
 (define_register_constraint "c" "C_REGS" "C register")
 (define_register_constraint "y" "HILO_REGS" "HI and LO registers")
-(define_register_constraint "l" "LO_REGS" "LO register")
-(define_register_constraint "h" "HI_REGS" "HI register")
 (define_register_constraint "v" "V_REGS" "vector registers")
 (define_register_constraint "z" "SP_REGS" "SP register")
 
index 6e97994..b2160b9 100644 (file)
@@ -112,7 +112,7 @@ enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER] =
   /* Reserved.  */
   RESERVE_REGS,
   /* CC,HI,LO registers.  */
-  C_REGS,      HI_REGS,             LO_REGS,
+  C_REGS,      HILO_REGS,     HILO_REGS,
   /* Reserved.  */
   RESERVE_REGS, RESERVE_REGS, RESERVE_REGS, RESERVE_REGS,
   RESERVE_REGS, RESERVE_REGS, RESERVE_REGS, RESERVE_REGS,
@@ -2477,8 +2477,7 @@ csky_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x,
   /* We always require a general register when copying anything to
      HI/LO_REGNUM, except when copying an SImode value from HI/LO_REGNUM
      to a general register, or when copying from register 0.  */
-  if ((rclass == HILO_REGS || rclass == LO_REGS || rclass == HI_REGS)
-      && !CSKY_GENERAL_REGNO_P (regno))
+  if (rclass == HILO_REGS && !CSKY_GENERAL_REGNO_P (regno))
     return GENERAL_REGS;
 
   if (rclass == V_REGS && !CSKY_GENERAL_REGNO_P (regno))
@@ -6546,7 +6545,7 @@ csky_register_move_cost (machine_mode mode ATTRIBUTE_UNUSED,
    || (CLASS) == LOW_REGS)
 
 #define HILO_REG_CLASS_P(CLASS) \
-  ((CLASS) == HI_REGS || (CLASS) == LO_REGS || (CLASS) == HILO_REGS)
+  ((CLASS) == HILO_REGS)
 
 #define V_REG_CLASS_P(CLASS) \
   ((CLASS) == V_REGS)
index f535c42..1fd72d0 100644 (file)
@@ -685,8 +685,6 @@ enum reg_class
   LOW_REGS,
   GENERAL_REGS,
   C_REGS,
-  HI_REGS,
-  LO_REGS,
   HILO_REGS,
   V_REGS,
   OTHER_REGS,
@@ -706,8 +704,6 @@ enum reg_class
   "LOW_REGS",          \
   "GENERAL_REGS",      \
   "C_REGS",            \
-  "HI_REGS",           \
-  "LO_REGS",           \
   "HILO_REGS",         \
   "V_REGS",            \
   "OTHER_REGS",                \
@@ -731,10 +727,6 @@ enum reg_class
    0x00000000, 0x00000000, 0x00000000},                        /* GENERAL_REGS  */   \
   {0x00000000, 0x00000002, 0x00000000, 0x00000000,                           \
    0x00000000, 0x00000000, 0x00000000},                        /* C_REGS        */   \
-  {0x00000000, 0x00000004, 0x00000000, 0x00000000,                           \
-   0x00000000, 0x00000000, 0x00000000},                        /* HI_REG        */   \
-  {0x00000000, 0x00000008, 0x00000000, 0x00000000,                           \
-   0x00000000, 0x00000000, 0x00000000},                        /* LO_REG        */   \
   {0x00000000, 0x0000000c, 0x00000000, 0x00000000,                           \
    0x00000000, 0x00000000, 0x00000000},                        /* HILO_REGS     */   \
   {0x00000000, 0xFFF00000, 0x007FFF8F, 0x00000000,                           \