public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] i386: Add LEGACY_INDEX_REG register class.
@ 2023-11-05 20:02 Uros Bizjak
  0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2023-11-05 20:02 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 372 bytes --]

Also rename LEGACY_REGS to LEGACY_GENERAL_REGS.

gcc/ChangeLog:

    * config/i386/i386.h (enum reg_class): Add LEGACY_INDEX_REGS.
    Rename LEGACY_REGS to LEGACY_GENERAL_REGS.
    (REG_CLASS_NAMES): Ditto.
    (REG_CLASS_CONTENTS): Ditto.
    * config/i386/constraints.md ("R"): Update for rename.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 3080 bytes --]

diff --git a/gcc/config/i386/constraints.md b/gcc/config/i386/constraints.md
index dc91bd94b27..f6275740eb2 100644
--- a/gcc/config/i386/constraints.md
+++ b/gcc/config/i386/constraints.md
@@ -23,7 +23,7 @@
 
 ;; Integer register constraints.
 ;; It is not necessary to define 'r' here.
-(define_register_constraint "R" "LEGACY_REGS"
+(define_register_constraint "R" "LEGACY_GENERAL_REGS"
  "Legacy register---the eight integer registers available on all
   i386 processors (@code{a}, @code{b}, @code{c}, @code{d},
   @code{si}, @code{di}, @code{bp}, @code{sp}).")
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index a56367a947b..3367197a633 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -1307,12 +1307,16 @@ enum reg_class
   Q_REGS,			/* %eax %ebx %ecx %edx */
   NON_Q_REGS,			/* %esi %edi %ebp %esp */
   TLS_GOTBASE_REGS,		/* %ebx %ecx %edx %esi %edi %ebp */
-  INDEX_REGS,			/* %eax %ebx %ecx %edx %esi %edi %ebp */
-  LEGACY_REGS,			/* %eax %ebx %ecx %edx %esi %edi %ebp %esp */
+  LEGACY_GENERAL_REGS,		/* %eax %ebx %ecx %edx %esi %edi %ebp %esp */
+  LEGACY_INDEX_REGS,		/* %eax %ebx %ecx %edx %esi %edi %ebp */
   GENERAL_REGS,			/* %eax %ebx %ecx %edx %esi %edi %ebp %esp
 				   %r8 %r9 %r10 %r11 %r12 %r13 %r14 %r15
 				   %r16 %r17 %r18 %r19 %r20 %r21 %r22 %r23
 				   %r24 %r25 %r26 %r27 %r28 %r29 %r30 %r31 */
+  INDEX_REGS,			/* %eax %ebx %ecx %edx %esi %edi %ebp
+				   %r8 %r9 %r10 %r11 %r12 %r13 %r14 %r15
+				   %r16 %r17 %r18 %r19 %r20 %r21 %r22 %r23
+				   %r24 %r25 %r26 %r27 %r28 %r29 %r30 %r31 */
   GENERAL_GPR16,		/* %eax %ebx %ecx %edx %esi %edi %ebp %esp
 				   %r8 %r9 %r10 %r11 %r12 %r13 %r14 %r15 */
   INDEX_GPR16,			/* %eax %ebx %ecx %edx %esi %edi %ebp
@@ -1376,9 +1380,10 @@ enum reg_class
    "CLOBBERED_REGS",			\
    "Q_REGS", "NON_Q_REGS",		\
    "TLS_GOTBASE_REGS",			\
-   "INDEX_REGS",			\
-   "LEGACY_REGS",			\
+   "LEGACY_GENERAL_REGS",		\
+   "LEGACY_INDEX_REGS",			\
    "GENERAL_REGS",			\
+   "INDEX_REGS",			\
    "GENERAL_GPR16",			\
    "INDEX_GPR16",			\
    "FP_TOP_REG", "FP_SECOND_REG",	\
@@ -1416,11 +1421,12 @@ enum reg_class
       { 0x0f,        0x0,   0x0 },	/* Q_REGS */			\
    { 0x900f0,        0x0,   0x0 },	/* NON_Q_REGS */		\
       { 0x7e,      0xff0,   0x0 },	/* TLS_GOTBASE_REGS */		\
-      { 0x7f,      0xff0,   0xffff000 },	/* INDEX_REGS */		\
-   { 0x900ff,        0x0,   0x0 },	/* LEGACY_REGS */		\
-   { 0x900ff,      0xff0,   0xffff000 },	/* GENERAL_REGS */		\
+   { 0x900ff,        0x0,   0x0 },	/* LEGACY_GENERAL_REGS */	\
+      { 0x7f,        0x0,   0x0 },	/* LEGACY_INDEX_REGS */		\
+   { 0x900ff,      0xff0,   0xffff000 }, /* GENERAL_REGS */		\
+      { 0x7f,      0xff0,   0xffff000 }, /* INDEX_REGS */		\
    { 0x900ff,      0xff0,   0x0 },	/* GENERAL_GPR16 */		\
-   { 0x0007f,      0xff0,   0x0 },	/* INDEX_GPR16 */		\
+      { 0x7f,      0xff0,   0x0 },	/* INDEX_GPR16 */		\
      { 0x100,        0x0,   0x0 },	/* FP_TOP_REG */		\
      { 0x200,        0x0,   0x0 },	/* FP_SECOND_REG */		\
     { 0xff00,        0x0,   0x0 },	/* FLOAT_REGS */		\

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-05 20:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-05 20:02 [committed] i386: Add LEGACY_INDEX_REG register class Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).