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]

Re: [PATCH #2], Fix _Complex when there are multiple FP types the same size


On Fri, Apr 29, 2016 at 04:51:27PM -0400, Michael Meissner wrote:
> 2016-04-29  Michael Meissner  <meissner@linux.vnet.ibm.com>
> 
> 	* config/rs6000/rs6000.c (rs6000_hard_regno_nregs_internal): Add
> 	support for __float128 complex datatypes.
> 	(rs6000_hard_regno_mode_ok): Likewise.
> 	(rs6000_setup_reg_addr_masks): Likewise.
> 	(rs6000_complex_function_value): Likewise.
> 	* config/rs6000/rs6000.h (FLOAT128_IEEE_P): Likewise.
> 	__float128 and __ibm128 complex.
> 	(FLOAT128_IBM_P): Likewise.
> 	(ALTIVEC_ARG_MAX_RETURN): Likewise.
> 	* doc/extend.texi (Additional Floating Types): Document that
> 	-mfloat128 must be used to enable __float128.  Document complex
> 	__float128 and __ibm128 support.
> 
> [gcc/testsuite]
> 2016-04-29  Michael Meissner  <meissner@linux.vnet.ibm.com>
> 
> 	* gcc.target/powerpc/float128-complex-1.c: New tests for complex
> 	__float128.
> 	* gcc.target/powerpc/float128-complex-2.c: Likewise.

The powerpc parts are okay for trunk.  Thank you!

A few trivialities you can maybe fix when you commit this:

> @@ -2700,7 +2703,16 @@ rs6000_setup_reg_addr_masks (void)
>    for (m = 0; m < NUM_MACHINE_MODES; ++m)
>      {
>        machine_mode m2 = (machine_mode)m;

There should be a space after the cast.  Pre-existing, I know.

> @@ -19190,6 +19223,25 @@ rs6000_preferred_reload_class (rtx x, en
>        return NO_REGS;
>      }
>  
> +  /* If we haven't picked a register class, and the type is a vector or
> +     floating point type, prefer to use the VSX, FPR, or Altivec register
> +     classes.  */
> +  if (rclass == NO_REGS)
> +    {
> +      if (TARGET_VSX && VECTOR_MEM_VSX_OR_P8_VECTOR_P (mode))
> +	return VSX_REGS;
> +
> +      if (TARGET_ALTIVEC && VECTOR_MEM_ALTIVEC_P (mode))
> +	return ALTIVEC_REGS;
> +
> +      if (DECIMAL_FLOAT_MODE_P (mode))
> +	return (TARGET_DFP) ? FLOAT_REGS : NO_REGS;

Superfluous parens.

> @@ -33964,8 +34016,14 @@ rs6000_complex_function_value (machine_m
>    machine_mode inner = GET_MODE_INNER (mode);
>    unsigned int inner_bytes = GET_MODE_UNIT_SIZE (mode);
>  
> -  if (FLOAT_MODE_P (mode) && TARGET_HARD_FLOAT && TARGET_FPRS)
> +  if (TARGET_FLOAT128
> +      && ((mode == KCmode)

Parens again.


Segher


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