Patchwork [committed,vms/ia64] Allow fused-madd operations

login
register
mail settings
Submitter Tristan Gingold
Date Oct. 21, 2010, 8:02 a.m.
Message ID <7665815D-4D9C-4D76-BD81-FFE3317F1B1C@adacore.com>
Download mbox | patch
Permalink /patch/68532/
State New
Headers show

Comments

Tristan Gingold - Oct. 21, 2010, 8:02 a.m.
Hi,

there are no reason not to allow fused madd by default on ia64/vms.

Committed on trunk.

Tristan.

2010-10-21  Tristan Gingold  <gingold@adacore.com>

	* config/ia64/vms64.h (TARGET_DEFAULT): Add MASK_FUSED_MADD.
	* config/ia64/vms.h (TARGET_DEFAULT): Ditto.
Richard Guenther - Oct. 21, 2010, 8:58 a.m.
On Thu, Oct 21, 2010 at 10:02 AM, Tristan Gingold <gingold@adacore.com> wrote:
> Hi,
>
> there are no reason not to allow fused madd by default on ia64/vms.

Will that enable FP contraction for a*b+c by default?  That would be wrong code
unless you document the implementation defined initial state of FP_CONTRACT
to on on ia64/vms.

Richard.

> Committed on trunk.
>
> Tristan.
>
> 2010-10-21  Tristan Gingold  <gingold@adacore.com>
>
>        * config/ia64/vms64.h (TARGET_DEFAULT): Add MASK_FUSED_MADD.
>        * config/ia64/vms.h (TARGET_DEFAULT): Ditto.
>
> Index: gcc/config/ia64/vms.h
> ===================================================================
> --- gcc/config/ia64/vms.h       (revision 165750)
> +++ gcc/config/ia64/vms.h       (working copy)
> @@ -45,7 +45,7 @@
>
>  /* Need .debug_line info generated from gcc and gas.  */
>  #undef TARGET_DEFAULT
> -#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_GNU_AS)
> +#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_GNU_AS | MASK_FUSED_MADD)
>
>  #define VMS_DEBUG_MAIN_POINTER "TRANSFER$BREAK$GO"
>
> Index: gcc/config/ia64/vms64.h
> ===================================================================
> --- gcc/config/ia64/vms64.h     (revision 165750)
> +++ gcc/config/ia64/vms64.h     (working copy)
> @@ -36,6 +36,6 @@
>  #define POINTER_SIZE 64
>
>  #undef TARGET_DEFAULT
> -#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_GNU_AS | MASK_MALLOC64)
> +#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_GNU_AS | MASK_FUSED_MADD | MASK_MALLOC64)
>
>  #include "config/vms/vms-crtl-64.h"
>
>
Tristan Gingold - Oct. 21, 2010, 9:09 a.m.
On Oct 21, 2010, at 10:58 AM, Richard Guenther wrote:

> On Thu, Oct 21, 2010 at 10:02 AM, Tristan Gingold <gingold@adacore.com> wrote:
>> Hi,
>> 
>> there are no reason not to allow fused madd by default on ia64/vms.
> 
> Will that enable FP contraction for a*b+c by default?

Yes.

>  That would be wrong code
> unless you document the implementation defined initial state of FP_CONTRACT
> to on on ia64/vms.

Well, this patch just align ia64/vms with other ia64 platforms (linux, hpux) which have this flag set by default.  So maybe we should simply document that all ia64 platform have FP_CONTRACT on by default ? (Steve CC:)

(We did that so that floating point code behave the same between the ia64 platforms).

Tristan.
Steve Ellcey - Oct. 21, 2010, 4:36 p.m.
On Thu, 2010-10-21 at 11:09 +0200, Tristan Gingold wrote:
> On Oct 21, 2010, at 10:58 AM, Richard Guenther wrote:
> 
> > On Thu, Oct 21, 2010 at 10:02 AM, Tristan Gingold <gingold@adacore.com> wrote:
> >> Hi,
> >> 
> >> there are no reason not to allow fused madd by default on ia64/vms.
> > 
> > Will that enable FP contraction for a*b+c by default?
> 
> Yes.
> 
> >  That would be wrong code
> > unless you document the implementation defined initial state of FP_CONTRACT
> > to on on ia64/vms.
> 
> Well, this patch just align ia64/vms with other ia64 platforms (linux, hpux) which have this flag set by default.
> So maybe we should simply document that all ia64 platform have FP_CONTRACT on by default ? (Steve CC:)
> 
> (We did that so that floating point code behave the same between the ia64 platforms).
> 
> Tristan.

I think the documentation for all the platforms that support FP
contractions (FUSED_MADD) is wrong.  In doc/implement-c.tex it says:

Expressions are currently only contracted if
@option{-funsafe-math-optimizations} or @option{-ffast-math} are used.
This is subject to change.

All the platforms that support FUSED_MADD (ia64, mips, rs6000, i386,
s390, xtensa) seem to have it on by default, so maybe we should change
the documentation to say that.

Steve Ellcey
sje@cup.hp.com

Patch

Index: gcc/config/ia64/vms.h
===================================================================
--- gcc/config/ia64/vms.h	(revision 165750)
+++ gcc/config/ia64/vms.h	(working copy)
@@ -45,7 +45,7 @@ 
 
 /* Need .debug_line info generated from gcc and gas.  */
 #undef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_GNU_AS)
+#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_GNU_AS | MASK_FUSED_MADD)
 
 #define VMS_DEBUG_MAIN_POINTER "TRANSFER$BREAK$GO"
 
Index: gcc/config/ia64/vms64.h
===================================================================
--- gcc/config/ia64/vms64.h	(revision 165750)
+++ gcc/config/ia64/vms64.h	(working copy)
@@ -36,6 +36,6 @@ 
 #define POINTER_SIZE 64
 
 #undef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_GNU_AS | MASK_MALLOC64)
+#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_GNU_AS | MASK_FUSED_MADD | MASK_MALLOC64)
 
 #include "config/vms/vms-crtl-64.h"