public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch, MIPS] Minor cleanup in mips.md
@ 2015-04-23 22:10 Steve Ellcey 
  2015-04-24  8:43 ` Matthew Fortune
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Ellcey  @ 2015-04-23 22:10 UTC (permalink / raw)
  To: gcc-patches, matthew.fortune, clm

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>")])
 
 ;;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [Patch, MIPS] Minor cleanup in mips.md
  2015-04-23 22:10 [Patch, MIPS] Minor cleanup in mips.md Steve Ellcey 
@ 2015-04-24  8:43 ` Matthew Fortune
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Fortune @ 2015-04-24  8:43 UTC (permalink / raw)
  To: Steve Ellcey, gcc-patches, clm

> 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.

OK, thanks.

Matthew


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-24  8:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-23 22:10 [Patch, MIPS] Minor cleanup in mips.md Steve Ellcey 
2015-04-24  8:43 ` Matthew Fortune

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).