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, MIPS] Minor cleanup in mips.md


This is a minor cleanup patch for MIPS.  A number of floating point madd type
instructions set the accum_in attribute.  But this attribute is only used
for integer madd instructions, so this patch removes it from the floating
point madd instructions where it is not needed or used.

The 'accum_in' attribute is only checked from mips_linked_madd_p in mips.c.
This in turn is used by the 24k, 4130, 5500, and 74k instruction schedulers
and by mips_macc_chains_reorder.  The instruction schedulers only use it
for scheduling integer multiply and multiply-add instructions and
mips_macc_chains_reorder is only looking at it for instructions where
the may_clobber_hilo attribute is also true.  may_clobber_hilo is only set
for integer multiply and multiply-add instructions.

Removing this from the floating point madd instructions should have no effect
on GCC.

I tested the change with mips-mti-linux-gnu to make sure everything built 
and ran the GCC testsuite with the 74k scheduler to verify that there were
no regressions but this change would have no affect on any MIPS target.

OK for checkin?

Steve Ellcey
sellcey@imgtec.com



2015-04-23  Steve Ellcey  <sellcey@imgtec.com>

	* config/mips/mips.md: (*madd4<mode>) Remove accum_in attribute.
	(*madd3<mode>): Ditto.
	(*msub4<mode>): Ditto.
	(*msub3<mode>): Ditto.
	(*nmadd4<mode>): Ditto.
	(*nmadd3<mode>): Ditto.
	(*nmadd4<mode>_fastmath): Ditto.
	(*nmadd3<mode>_fastmath): Ditto.
	(*nmsub4<mode>): Ditto.
	(*nmsub3<mode>): Ditto.
	(*nmsub4<mode>_fastmath): Ditto.
	(*nmsub3<mode>_fastmath): Ditto.


diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 3672c0b..ed4c0ba 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -2478,7 +2478,6 @@
   "ISA_HAS_FP_MADD4_MSUB4 && TARGET_FUSED_MADD"
   "madd.<fmt>\t%0,%3,%1,%2"
   [(set_attr "type" "fmadd")
-   (set_attr "accum_in"	"3")
    (set_attr "mode" "<UNITMODE>")])
 
 (define_insn "fma<mode>4"
@@ -2499,7 +2498,6 @@
   "ISA_HAS_FP_MADD3_MSUB3 && TARGET_FUSED_MADD"
   "madd.<fmt>\t%0,%1,%2"
   [(set_attr "type" "fmadd")
-   (set_attr "accum_in"	"3")
    (set_attr "mode" "<UNITMODE>")])
 
 (define_insn "*msub4<mode>"
@@ -2510,7 +2508,6 @@
   "ISA_HAS_FP_MADD4_MSUB4 && TARGET_FUSED_MADD"
   "msub.<fmt>\t%0,%3,%1,%2"
   [(set_attr "type" "fmadd")
-   (set_attr "accum_in"	"3")
    (set_attr "mode" "<UNITMODE>")])
 
 (define_insn "*msub3<mode>"
@@ -2521,7 +2518,6 @@
   "ISA_HAS_FP_MADD3_MSUB3 && TARGET_FUSED_MADD"
   "msub.<fmt>\t%0,%1,%2"
   [(set_attr "type" "fmadd")
-   (set_attr "accum_in"	"3")
    (set_attr "mode" "<UNITMODE>")])
 
 (define_insn "*nmadd4<mode>"
@@ -2536,7 +2532,6 @@
    && !HONOR_NANS (<MODE>mode)"
   "nmadd.<fmt>\t%0,%3,%1,%2"
   [(set_attr "type" "fmadd")
-   (set_attr "accum_in"	"3")
    (set_attr "mode" "<UNITMODE>")])
 
 (define_insn "*nmadd3<mode>"
@@ -2551,7 +2546,6 @@
    && !HONOR_NANS (<MODE>mode)"
   "nmadd.<fmt>\t%0,%1,%2"
   [(set_attr "type" "fmadd")
-   (set_attr "accum_in"	"3")
    (set_attr "mode" "<UNITMODE>")])
 
 (define_insn "*nmadd4<mode>_fastmath"
@@ -2566,7 +2560,6 @@
    && !HONOR_NANS (<MODE>mode)"
   "nmadd.<fmt>\t%0,%3,%1,%2"
   [(set_attr "type" "fmadd")
-   (set_attr "accum_in"	"3")
    (set_attr "mode" "<UNITMODE>")])
 
 (define_insn "*nmadd3<mode>_fastmath"
@@ -2581,7 +2574,6 @@
    && !HONOR_NANS (<MODE>mode)"
   "nmadd.<fmt>\t%0,%1,%2"
   [(set_attr "type" "fmadd")
-   (set_attr "accum_in"	"3")
    (set_attr "mode" "<UNITMODE>")])
 
 (define_insn "*nmsub4<mode>"
@@ -2596,7 +2588,6 @@
    && !HONOR_NANS (<MODE>mode)"
   "nmsub.<fmt>\t%0,%1,%2,%3"
   [(set_attr "type" "fmadd")
-   (set_attr "accum_in"	"1")
    (set_attr "mode" "<UNITMODE>")])
 
 (define_insn "*nmsub3<mode>"
@@ -2611,7 +2602,6 @@
    && !HONOR_NANS (<MODE>mode)"
   "nmsub.<fmt>\t%0,%1,%2"
   [(set_attr "type" "fmadd")
-   (set_attr "accum_in"	"1")
    (set_attr "mode" "<UNITMODE>")])
 
 (define_insn "*nmsub4<mode>_fastmath"
@@ -2626,7 +2616,6 @@
    && !HONOR_NANS (<MODE>mode)"
   "nmsub.<fmt>\t%0,%1,%2,%3"
   [(set_attr "type" "fmadd")
-   (set_attr "accum_in"	"1")
    (set_attr "mode" "<UNITMODE>")])
 
 (define_insn "*nmsub3<mode>_fastmath"
@@ -2641,7 +2630,6 @@
    && !HONOR_NANS (<MODE>mode)"
   "nmsub.<fmt>\t%0,%1,%2"
   [(set_attr "type" "fmadd")
-   (set_attr "accum_in"	"1")
    (set_attr "mode" "<UNITMODE>")])
 
 ;;


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