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]

[PATCH] Don't use fprs when soft-float is present


Hi,

the attached patch avoids saving fprs for stdargs when -msoft-float was set.

On s390 the only user of -msoft-float should be the linux kernel which can save
some stack space using it.

Bootstrapped and regtested on s390 and s390x. I would like to have tested it by
building a kernel, but PR 15740 still circumvents that :(

OK?

Bye,

Andreas

2004-10-08  Andreas Krebbel  <krebbel1@de.ibm.com>

 * config/s390/s390.c (s390_register_info): Don't save fprs for 
 -msoft-float.
 (s390_conditional_register_usage): Make fprs 'fixed' for -msoft-float.


Index: config/s390/s390.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.c,v
retrieving revision 1.173
diff -p -c -r1.173 s390.c
*** config/s390/s390.c 25 Aug 2004 09:52:23 -0000 1.173
--- config/s390/s390.c 27 Aug 2004 13:41:40 -0000
*************** s390_register_info (int base_used, int r
*** 5899,5906 ****
          cfun_frame_layout.last_save_gpr = 6;
  
        /* Mark f0, f2 for 31 bit and f0-f4 for 64 bit to be saved.  */
!       for (i = 0; i < (TARGET_64BIT ? 4 : 2); i++)
!  cfun_set_fpr_bit (i);
      }
  
    if (!TARGET_64BIT)
--- 5899,5907 ----
          cfun_frame_layout.last_save_gpr = 6;
  
        /* Mark f0, f2 for 31 bit and f0-f4 for 64 bit to be saved.  */
!       if (TARGET_HARD_FLOAT)
!  for (i = 0; i < (TARGET_64BIT ? 4 : 2); i++)
!    cfun_set_fpr_bit (i);
      }
  
    if (!TARGET_64BIT)
*************** s390_conditional_register_usage (void)
*** 8016,8021 ****
--- 8017,8028 ----
        for (i = 18; i < 20; i++)
   call_used_regs[i] = call_really_used_regs[i] = 0;
      }
+ 
+   if (TARGET_SOFT_FLOAT)
+     {
+       for (i = 16; i < 32; i++)
+  call_used_regs[i] = fixed_regs[i] = 1;
+     }
  }


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