OSDN Git Service

PR target/37846
authorsje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 May 2009 23:51:22 +0000 (23:51 +0000)
committersje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 May 2009 23:51:22 +0000 (23:51 +0000)
* config/ia64/ia64.opt (mfused-madd): New.
* config/ia64/ia64.h (TARGET_DEFAULT): Set MASK_FUSED_MADD.
* config/ia64/hpux.h (TARGET_DEFAULT): Ditto.
* config/ia64/ia64.md (maddsf4, msubsf4, nmaddsf4,
madddf4, madddf4_trunc, msubdf4, msubdf4_trunc, nmadddf4,
nmadddf4_truncsf, maddxf4, maddxf4_truncsf, maddxf4_truncdf,
msubxf4, msubxf4_truncsf msubxf4_truncdf, nmaddxf4,
nmaddxf4_truncsf, nmaddxf4_truncdf): Check TARGET_FUSED_MADD.
* config/ia64/vect.md (addv2sf3, subv2sf3): Force fpma/fpms
instruction if !TARGET_FUSED_MADD.
(fpma, fpms): Remove colon from name.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147782 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/ia64/hpux.h
gcc/config/ia64/ia64.h
gcc/config/ia64/ia64.md
gcc/config/ia64/ia64.opt
gcc/config/ia64/vect.md

index 9a4f5a9..77cb400 100644 (file)
@@ -1,3 +1,18 @@
+2009-05-21  Steve Ellcey  <sje@cup.hp.com>
+
+       PR target/37846
+       * config/ia64/ia64.opt (mfused-madd): New.
+       * config/ia64/ia64.h (TARGET_DEFAULT): Set MASK_FUSED_MADD.
+       * config/ia64/hpux.h (TARGET_DEFAULT): Ditto.
+       * config/ia64/ia64.md (maddsf4, msubsf4, nmaddsf4,
+       madddf4, madddf4_trunc, msubdf4, msubdf4_trunc, nmadddf4,
+       nmadddf4_truncsf, maddxf4, maddxf4_truncsf, maddxf4_truncdf,
+       msubxf4, msubxf4_truncsf msubxf4_truncdf, nmaddxf4,
+       nmaddxf4_truncsf, nmaddxf4_truncdf): Check TARGET_FUSED_MADD.
+       * config/ia64/vect.md (addv2sf3, subv2sf3): Force fpma/fpms 
+       instruction if !TARGET_FUSED_MADD.
+       (fpma, fpms): Remove colon from name.
+
 2009-05-22  Richard Guenther  <rguenther@suse.de>
 
        * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Record
index f7918d2..e91d134 100644 (file)
@@ -106,7 +106,7 @@ do {                                                        \
 
 #undef TARGET_DEFAULT
 #define TARGET_DEFAULT \
-  (MASK_DWARF2_ASM | MASK_BIG_ENDIAN | MASK_ILP32)
+  (MASK_DWARF2_ASM | MASK_BIG_ENDIAN | MASK_ILP32 | MASK_FUSED_MADD)
 
 /* ??? Might not be needed anymore.  */
 #define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) ((MODE) == TFmode)
index 05957ea..ff02f75 100644 (file)
@@ -94,7 +94,7 @@ enum ia64_inline_type
 /* Default target_flags if no switches are specified  */
 
 #ifndef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_DWARF2_ASM)
+#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_FUSED_MADD)
 #endif
 
 #ifndef TARGET_CPU_DEFAULT
index 2919772..d20ae69 100644 (file)
        (plus:SF (mult:SF (match_operand:SF 1 "fr_reg_or_fp01_operand" "fG")
                          (match_operand:SF 2 "fr_reg_or_fp01_operand" "fG"))
                 (match_operand:SF 3 "fr_reg_or_fp01_operand" "fG")))]
-  ""
+  "TARGET_FUSED_MADD"
   "fma.s %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
        (minus:SF (mult:SF (match_operand:SF 1 "fr_reg_or_fp01_operand" "fG")
                           (match_operand:SF 2 "fr_reg_or_fp01_operand" "fG"))
                  (match_operand:SF 3 "fr_reg_or_fp01_operand" "fG")))]
-  ""
+  "TARGET_FUSED_MADD"
   "fms.s %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
        (minus:SF (match_operand:SF 3 "fr_reg_or_fp01_operand" "fG") 
                  (mult:SF (match_operand:SF 1 "fr_reg_or_fp01_operand" "fG")
                           (match_operand:SF 2 "fr_reg_or_fp01_operand" "fG"))))]
-  ""
+  "TARGET_FUSED_MADD"
   "fnma.s %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
        (plus:DF (mult:DF (match_operand:DF 1 "fr_reg_or_fp01_operand" "fG")
                          (match_operand:DF 2 "fr_reg_or_fp01_operand" "fG"))
                 (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG")))]
-  ""
+  "TARGET_FUSED_MADD"
   "fma.d %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
          (plus:DF (mult:DF (match_operand:DF 1 "fr_reg_or_fp01_operand" "fG")
                            (match_operand:DF 2 "fr_reg_or_fp01_operand" "fG"))
                   (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG"))))]
-  ""
+  "TARGET_FUSED_MADD"
   "fma.s %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
        (minus:DF (mult:DF (match_operand:DF 1 "fr_reg_or_fp01_operand" "fG")
                           (match_operand:DF 2 "fr_reg_or_fp01_operand" "fG"))
                  (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG")))]
-  ""
+  "TARGET_FUSED_MADD"
   "fms.d %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
          (minus:DF (mult:DF (match_operand:DF 1 "fr_reg_or_fp01_operand" "fG")
                             (match_operand:DF 2 "fr_reg_or_fp01_operand" "fG"))
                    (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG"))))]
-  ""
+  "TARGET_FUSED_MADD"
   "fms.s %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
        (minus:DF (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG")
                  (mult:DF (match_operand:DF 1 "fr_reg_or_fp01_operand" "fG")
                           (match_operand:DF 2 "fr_reg_or_fp01_operand" "fG"))))]
-  ""
+  "TARGET_FUSED_MADD"
   "fnma.d %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
        (minus:DF (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG")
                  (mult:DF (match_operand:DF 1 "fr_reg_or_fp01_operand" "fG")
                           (match_operand:DF 2 "fr_reg_or_fp01_operand" "fG")))))]
-  ""
+  "TARGET_FUSED_MADD"
   "fnma.s %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
        (plus:XF (mult:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG")
                          (match_operand:XF 2 "xfreg_or_fp01_operand" "fG"))
                 (match_operand:XF 3 "xfreg_or_fp01_operand" "fG")))]
-  ""
+  "TARGET_FUSED_MADD"
   "fma %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
          (plus:XF (mult:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG")
                            (match_operand:XF 2 "xfreg_or_fp01_operand" "fG"))
                   (match_operand:XF 3 "xfreg_or_fp01_operand" "fG"))))]
-  ""
+  "TARGET_FUSED_MADD"
   "fma.s %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
          (plus:XF (mult:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG")
                            (match_operand:XF 2 "xfreg_or_fp01_operand" "fG"))
                   (match_operand:XF 3 "xfreg_or_fp01_operand" "fG"))))]
-  ""
+  "TARGET_FUSED_MADD"
   "fma.d %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
        (minus:XF (mult:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG")
                           (match_operand:XF 2 "xfreg_or_fp01_operand" "fG"))
                  (match_operand:XF 3 "xfreg_or_fp01_operand" "fG")))]
-  ""
+  "TARGET_FUSED_MADD"
   "fms %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
          (minus:XF (mult:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG")
                             (match_operand:XF 2 "xfreg_or_fp01_operand" "fG"))
                    (match_operand:XF 3 "xfreg_or_fp01_operand" "fG"))))]
-  ""
+  "TARGET_FUSED_MADD"
   "fms.s %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
          (minus:XF (mult:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG")
                             (match_operand:XF 2 "xfreg_or_fp01_operand" "fG"))
                    (match_operand:XF 3 "xfreg_or_fp01_operand" "fG"))))]
-  ""
+  "TARGET_FUSED_MADD"
   "fms.d %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
                  (mult:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG")
                           (match_operand:XF 2 "xfreg_or_fp01_operand" "fG")
    )))]
-  ""
+  "TARGET_FUSED_MADD"
   "fnma %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
                    (mult:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG")
                             (match_operand:XF 2 "xfreg_or_fp01_operand" "fG")
    ))))]
-  ""
+  "TARGET_FUSED_MADD"
   "fnma.s %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
                    (mult:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG")
                             (match_operand:XF 2 "xfreg_or_fp01_operand" "fG")
    ))))]
-  ""
+  "TARGET_FUSED_MADD"
   "fnma.d %0 = %F1, %F2, %F3"
   [(set_attr "itanium_class" "fmac")])
 
index 7919858..27cd5b1 100644 (file)
@@ -178,4 +178,8 @@ msel-sched-dont-check-control-spec
 Target Report Var(mflag_sel_sched_dont_check_control_spec) Init(0)
 Don't generate checks for control speculation in selective scheduling
 
+mfused-madd
+Target Report Mask(FUSED_MADD)
+Enable fused multiply/add and multiply/subtract instructions
+
 ; This comment is to ensure we retain the blank line above.
index 994ec90..6b42c92 100644 (file)
 {
   rtvec v = gen_rtvec (2, CONST1_RTX (SFmode), CONST1_RTX (SFmode));
   operands[3] = force_reg (V2SFmode, gen_rtx_CONST_VECTOR (V2SFmode, v));
+  if (!TARGET_FUSED_MADD)
+    {
+      emit_insn (gen_fpma (operands[0], operands[1], operands[3], operands[2]));
+      DONE;
+    }
 })
 
 ;; The split condition here could be combine_completed, if we had such.
 {
   rtvec v = gen_rtvec (2, CONST1_RTX (SFmode), CONST1_RTX (SFmode));
   operands[3] = force_reg (V2SFmode, gen_rtx_CONST_VECTOR (V2SFmode, v));
+  if (!TARGET_FUSED_MADD)
+    {
+      emit_insn (gen_fpms (operands[0], operands[1], operands[3], operands[2]));
+      DONE;
+    }
 })
 
 ;; The split condition here could be combine_completed, if we had such.
   "fpmpy %0 = %1, %2"
   [(set_attr "itanium_class" "fmac")])
 
-(define_insn "*fpma"
+(define_insn "fpma"
   [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
        (plus:V2SF
          (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")
   "fpma %0 = %1, %2, %3"
   [(set_attr "itanium_class" "fmac")])
 
-(define_insn "*fpms"
+(define_insn "fpms"
   [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
        (minus:V2SF
          (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")