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]

choose_hard_reg_mode: add support for vectors


actually, while i'm at it... easier coded than explained...

turly, this is what you need.

bootstrapping on powerpc linux.  shouldn't be a problem since the
compiler doesn't use vectors :).  

assuming it passes, ok to install?

-- 
Aldy Hernandez			E-mail: aldyh@redhat.com
Professional Gypsy
Red Hat, Inc.

2001-11-21  Aldy Hernandez  <aldyh@redhat.com>

        * regclass.c (choose_hard_reg_mode): Handle vector arguments.

Index: regclass.c
===================================================================
RCS file: /cvs/uberbaum/gcc/regclass.c,v
retrieving revision 1.137
diff -c -p -r1.137 regclass.c
*** regclass.c	2001/10/18 21:34:14	1.137
--- regclass.c	2001/11/22 04:26:38
*************** choose_hard_reg_mode (regno, nregs)
*** 713,718 ****
--- 713,738 ----
    if (found_mode != VOIDmode)
      return found_mode;
  
+   for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT);
+        mode != VOIDmode;
+        mode = GET_MODE_WIDER_MODE (mode))
+     if (HARD_REGNO_NREGS (regno, mode) == nregs
+ 	&& HARD_REGNO_MODE_OK (regno, mode))
+       found_mode = mode;
+ 
+   if (found_mode != VOIDmode)
+     return found_mode;
+ 
+   for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT);
+        mode != VOIDmode;
+        mode = GET_MODE_WIDER_MODE (mode))
+     if (HARD_REGNO_NREGS (regno, mode) == nregs
+ 	&& HARD_REGNO_MODE_OK (regno, mode))
+       found_mode = mode;
+ 
+   if (found_mode != VOIDmode)
+     return found_mode;
+ 
    /* Iterate over all of the CCmodes.  */
    for (m = (unsigned int) CCmode; m < (unsigned int) NUM_MACHINE_MODES; ++m)
      {


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