[PATCH] rs6000/s390: Unify DFP switches to -mhard-dfp/-mno-hard-dfp

Andreas Krebbel Andreas.Krebbel@de.ibm.com
Mon Oct 29 14:43:00 GMT 2007


Hello,

the attached patch unifies the GCC switches used to enable the
hardware support for decimal floating point numbers on rs6000 and
s390.

The rs6000 switches change from -mdfp/-mno-dfp and the s390 switches
from -mhard-dfp/-msoft-dfp to -mhard-dfp/-mno-hard-dfp for both.

Tested on s390.  The tiny rs6000 part is untested but should be obvious.

OK for mainline?

Bye,

-Andreas-


2007-10-29  Andreas Krebbel  <krebbel1@de.ibm.com>

	* config/rs6000/rs6000.opt: Rename -mdfp option to -mhard-dfp.

	* config/s390/s390.c: (override_options): Replace -mhard-dfp/-msoft-dfp
	with -mhard-dfp/-mno-hard-dfp.
	* config/s390/s390.opt: Likewise.
	* config/s390/s390.h: Add MASK_HARD_DFP to the TARGET_DEFAULT
	definition.


Index: gcc/config/rs6000/rs6000.opt
===================================================================
*** gcc/config/rs6000/rs6000.opt.orig	2007-10-19 14:36:50.000000000 +0200
--- gcc/config/rs6000/rs6000.opt	2007-10-29 08:55:24.000000000 +0100
*************** maltivec
*** 75,81 ****
  Target Report Mask(ALTIVEC)
  Use AltiVec instructions
  
! mdfp
  Target Report Mask(DFP)
  Use decimal floating point instructions
  
--- 75,81 ----
  Target Report Mask(ALTIVEC)
  Use AltiVec instructions
  
! mhard-dfp
  Target Report Mask(DFP)
  Use decimal floating point instructions
  
Index: gcc/config/s390/s390.c
===================================================================
*** gcc/config/s390/s390.c.orig	2007-10-24 16:54:18.000000000 +0200
--- gcc/config/s390/s390.c	2007-10-29 14:14:24.000000000 +0100
*************** override_options (void)
*** 1448,1456 ****
    if (TARGET_64BIT && !TARGET_ZARCH)
      error ("64-bit ABI not supported in ESA/390 mode");
  
!   if (TARGET_HARD_DFP && (!TARGET_CPU_DFP || !TARGET_ZARCH))
      {
!       if (target_flags_explicit & MASK_SOFT_DFP)
  	{
  	  if (!TARGET_CPU_DFP)
  	    error ("Hardware decimal floating point instructions"
--- 1448,1456 ----
    if (TARGET_64BIT && !TARGET_ZARCH)
      error ("64-bit ABI not supported in ESA/390 mode");
  
!   if (TARGET_HARD_DFP && !TARGET_DFP)
      {
!       if (target_flags_explicit & MASK_HARD_DFP)
  	{
  	  if (!TARGET_CPU_DFP)
  	    error ("Hardware decimal floating point instructions"
*************** override_options (void)
*** 1460,1474 ****
  		   " not available in ESA/390 mode");
  	}
        else
! 	target_flags |= MASK_SOFT_DFP;
      }
  
    if ((target_flags_explicit & MASK_SOFT_FLOAT) && TARGET_SOFT_FLOAT)
      {
!       if ((target_flags_explicit & MASK_SOFT_DFP) && TARGET_HARD_DFP)
  	error ("-mhard-dfp can't be used in conjunction with -msoft-float");
  
!       target_flags |= MASK_SOFT_DFP;
      }
  
    /* Set processor cost function.  */
--- 1460,1474 ----
  		   " not available in ESA/390 mode");
  	}
        else
! 	target_flags &= ~MASK_HARD_DFP;
      }
  
    if ((target_flags_explicit & MASK_SOFT_FLOAT) && TARGET_SOFT_FLOAT)
      {
!       if ((target_flags_explicit & MASK_HARD_DFP) && TARGET_HARD_DFP)
  	error ("-mhard-dfp can't be used in conjunction with -msoft-float");
  
!       target_flags &= ~MASK_HARD_DFP;
      }
  
    /* Set processor cost function.  */
Index: gcc/config/s390/s390.opt
===================================================================
*** gcc/config/s390/s390.opt.orig	2007-08-28 08:51:34.000000000 +0200
--- gcc/config/s390/s390.opt	2007-10-29 09:39:32.000000000 +0100
*************** Target Report Mask(FUSED_MADD)
*** 47,54 ****
  Enable fused multiply/add instructions
  
  mhard-dfp
! Target Report RejectNegative InverseMask(SOFT_DFP, HARD_DFP)
! Enable hardware decimal floating point
  
  mhard-float
  Target Report RejectNegative InverseMask(SOFT_FLOAT, HARD_FLOAT)
--- 47,54 ----
  Enable fused multiply/add instructions
  
  mhard-dfp
! Target Report Mask(HARD_DFP)
! Enable decimal floating point hardware support
  
  mhard-float
  Target Report RejectNegative InverseMask(SOFT_FLOAT, HARD_FLOAT)
*************** msmall-exec
*** 70,79 ****
  Target Report Mask(SMALL_EXEC)
  Use bras for executable < 64k
  
- msoft-dfp
- Target Report RejectNegative Mask(SOFT_DFP)
- Disable hardware decimal floating point
- 
  msoft-float
  Target Report RejectNegative Mask(SOFT_FLOAT)
  Disable hardware floating point
--- 70,75 ----
Index: gcc/config/s390/s390.h
===================================================================
*** gcc/config/s390/s390.h.orig	2007-10-19 14:30:02.000000000 +0200
--- gcc/config/s390/s390.h	2007-10-29 13:57:18.000000000 +0100
*************** extern enum processor_flags s390_arch_fl
*** 103,109 ****
    while (0)
  
  #ifdef DEFAULT_TARGET_64BIT
! #define TARGET_DEFAULT             (MASK_64BIT | MASK_ZARCH)
  #else
  #define TARGET_DEFAULT             0
  #endif
--- 103,109 ----
    while (0)
  
  #ifdef DEFAULT_TARGET_64BIT
! #define TARGET_DEFAULT             (MASK_64BIT | MASK_ZARCH | MASK_HARD_DFP)
  #else
  #define TARGET_DEFAULT             0
  #endif



More information about the Gcc-patches mailing list