This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

S/390: Fix NREGS computation for access registers


Hello,

this fixes a thinko in computing NREGS for access registers;
GET_MODE_SIZE is counted in bytes, not bits.

Boostrapped/regtested on s390-ibm-linux and s390x-ibm-linux,
applied to mainline.

Bye,
Ulrich


ChangeLog:

	* config/s390/s390.h (HARD_REGNO_NREGS): Fix computation for
	access registers.
	(CLASS_MAX_NREGS): Likewise.

Index: gcc/config/s390/s390.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.h,v
retrieving revision 1.131
diff -c -p -r1.131 s390.h
*** gcc/config/s390/s390.h	30 Dec 2004 03:08:05 -0000	1.131
--- gcc/config/s390/s390.h	22 Jan 2005 19:42:55 -0000
*************** if (INTEGRAL_MODE_P (MODE) &&	        	 
*** 418,424 ****
     GENERAL_REGNO_P(REGNO)?                                      \
      ((GET_MODE_SIZE(MODE)+UNITS_PER_WORD-1) / UNITS_PER_WORD) : \
     ACCESS_REGNO_P(REGNO)?					\
!     ((GET_MODE_SIZE(MODE)+32-1) / 32) : 			\
     1)
  
  #define HARD_REGNO_MODE_OK(REGNO, MODE)                             \
--- 418,424 ----
     GENERAL_REGNO_P(REGNO)?                                      \
      ((GET_MODE_SIZE(MODE)+UNITS_PER_WORD-1) / UNITS_PER_WORD) : \
     ACCESS_REGNO_P(REGNO)?					\
!     ((GET_MODE_SIZE(MODE)+4-1) / 4) : 				\
     1)
  
  #define HARD_REGNO_MODE_OK(REGNO, MODE)                             \
*************** if (INTEGRAL_MODE_P (MODE) &&	        	 
*** 447,453 ****
       ((CLASS) == FP_REGS ? 						\
        (GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT ? 2 : 1) :  		\
        (CLASS) == ACCESS_REGS ?						\
!       (GET_MODE_SIZE (MODE) + 32 - 1) / 32 :				\
        (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
  
  /* If a 4-byte value is loaded into a FPR, it is placed into the
--- 447,453 ----
       ((CLASS) == FP_REGS ? 						\
        (GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT ? 2 : 1) :  		\
        (CLASS) == ACCESS_REGS ?						\
!       (GET_MODE_SIZE (MODE) + 4 - 1) / 4 :				\
        (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
  
  /* If a 4-byte value is loaded into a FPR, it is placed into the
-- 
  Dr. Ulrich Weigand
  Linux on zSeries Development
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]