This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Committed] S/390: Use macros for the FPR register numbers in the backend
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Date: Mon, 8 Jul 2013 13:03:38 +0200
- Subject: Re: [Committed] S/390: Use macros for the FPR register numbers in the backend
Hello!
> the attached patch adds F0_REGNUM ... F15_REGNUM and uses these
> throughout the s390.c file. The FPR numbering in the s390 backend is
> not obvious and this hopefully makes it easier to get right for me.
Index: gcc/config/s390/s390.h
===================================================================
*** gcc/config/s390/s390.h.orig
--- gcc/config/s390/s390.h
*************** enum reg_class
*** 477,482 ****
--- 477,499 ----
{ 0xffffffff, 0x0000003f }, /* ALL_REGS */ \
}
+ #define F0_REGNUM 16
+ #define F1_REGNUM 20
+ #define F2_REGNUM 17
+ #define F3_REGNUM 21
+ #define F4_REGNUM 18
+ #define F5_REGNUM 22
+ #define F6_REGNUM 19
+ #define F7_REGNUM 23
+ #define F8_REGNUM 24
+ #define F9_REGNUM 25
+ #define F10_REGNUM 26
+ #define F11_REGNUM 27
+ #define F12_REGNUM 28
+ #define F13_REGNUM 29
+ #define F14_REGNUM 30
+ #define F15_REGNUM 31
You can add these as define_constant in s390.md (see for example
i386.md). There is already definition of FPR0_REGNUM and FPR2_REGNUM,
which is now incostistent (18) with your new definitions (17).
Uros.