This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to add condmove insn type to mips.md
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: 15 Jul 2003 09:15:40 +0100
- Subject: Patch to add condmove insn type to mips.md
This patch adds a condmove insn type to mips.md and updates the schedulers
accordingly.
Approved by Eric some time ago, applied.
Richard
* config/mips/mips.md (define_attr type): Add condmove. Use it for
the conditional move patterns.
* config/mips/5400.md (ir_vr54_move): Rename to ir_vr54_condmove.
Check for condmove type.
(ir_vr54_arith): Add move type.
* config/mips/5500.md (ir_vr55_move, ir_vr54_arith): Likewise.
* config/mips/sr71k.md (ir_sr70_move, ir_sr70_arith): Likewise.
Index: config/mips/mips.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.md,v
retrieving revision 1.181
diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.181 mips.md
--- config/mips/mips.md 14 Jul 2003 20:41:27 -0000 1.181
+++ config/mips/mips.md 15 Jul 2003 08:08:07 -0000
@@ -100,6 +100,7 @@ (define_attr "jal_macro" "no,yes"
;; store store instruction(s)
;; prefetch memory prefetch
;; move data movement within same register set
+;; condmove conditional moves
;; xfer transfer to/from coprocessor
;; hilo transfer of hi/lo registers
;; arith integer arithmetic instruction
@@ -122,7 +123,7 @@ (define_attr "jal_macro" "no,yes"
;; multi multiword sequence (or user asm statements)
;; nop no operation
(define_attr "type"
- "unknown,branch,jump,call,load,store,prefetch,move,xfer,hilo,const,arith,darith,imul,imadd,idiv,icmp,fadd,fmul,fmadd,fdiv,fabs,fneg,fcmp,fcvt,fsqrt,frsqrt,multi,nop"
+ "unknown,branch,jump,call,load,store,prefetch,move,condmove,xfer,hilo,const,arith,darith,imul,imadd,idiv,icmp,fadd,fmul,fmadd,fdiv,fabs,fneg,fcmp,fcvt,fsqrt,frsqrt,multi,nop"
(cond [(eq_attr "jal" "!unset")
(const_string "call")]
(const_string "unknown")))
@@ -8764,7 +8765,7 @@ (define_insn ""
"@
mov%B4\\t%0,%z2,%1
mov%b4\\t%0,%z3,%1"
- [(set_attr "type" "move")
+ [(set_attr "type" "condmove")
(set_attr "mode" "SI")])
(define_insn ""
@@ -8779,7 +8780,7 @@ (define_insn ""
"@
mov%B4\\t%0,%z2,%1
mov%b4\\t%0,%z3,%1"
- [(set_attr "type" "move")
+ [(set_attr "type" "condmove")
(set_attr "mode" "SI")])
(define_insn ""
@@ -8795,7 +8796,7 @@ (define_insn ""
"@
mov%T3\\t%0,%z1,%4
mov%t3\\t%0,%z2,%4"
- [(set_attr "type" "move")
+ [(set_attr "type" "condmove")
(set_attr "mode" "SI")])
(define_insn ""
@@ -8810,7 +8811,7 @@ (define_insn ""
"@
mov%B4\\t%0,%z2,%1
mov%b4\\t%0,%z3,%1"
- [(set_attr "type" "move")
+ [(set_attr "type" "condmove")
(set_attr "mode" "DI")])
(define_insn ""
@@ -8825,7 +8826,7 @@ (define_insn ""
"@
mov%B4\\t%0,%z2,%1
mov%b4\\t%0,%z3,%1"
- [(set_attr "type" "move")
+ [(set_attr "type" "condmove")
(set_attr "mode" "DI")])
(define_insn ""
@@ -8841,7 +8842,7 @@ (define_insn ""
"@
mov%T3\\t%0,%z1,%4
mov%t3\\t%0,%z2,%4"
- [(set_attr "type" "move")
+ [(set_attr "type" "condmove")
(set_attr "mode" "DI")])
(define_insn ""
@@ -8856,7 +8857,7 @@ (define_insn ""
"@
mov%B4.s\\t%0,%2,%1
mov%b4.s\\t%0,%3,%1"
- [(set_attr "type" "move")
+ [(set_attr "type" "condmove")
(set_attr "mode" "SF")])
(define_insn ""
@@ -8871,7 +8872,7 @@ (define_insn ""
"@
mov%B4.s\\t%0,%2,%1
mov%b4.s\\t%0,%3,%1"
- [(set_attr "type" "move")
+ [(set_attr "type" "condmove")
(set_attr "mode" "SF")])
(define_insn ""
@@ -8887,7 +8888,7 @@ (define_insn ""
"@
mov%T3.s\\t%0,%1,%4
mov%t3.s\\t%0,%2,%4"
- [(set_attr "type" "move")
+ [(set_attr "type" "condmove")
(set_attr "mode" "SF")])
(define_insn ""
@@ -8902,7 +8903,7 @@ (define_insn ""
"@
mov%B4.d\\t%0,%2,%1
mov%b4.d\\t%0,%3,%1"
- [(set_attr "type" "move")
+ [(set_attr "type" "condmove")
(set_attr "mode" "DF")])
(define_insn ""
@@ -8917,7 +8918,7 @@ (define_insn ""
"@
mov%B4.d\\t%0,%2,%1
mov%b4.d\\t%0,%3,%1"
- [(set_attr "type" "move")
+ [(set_attr "type" "condmove")
(set_attr "mode" "DF")])
(define_insn ""
@@ -8933,7 +8934,7 @@ (define_insn ""
"@
mov%T3.d\\t%0,%1,%4
mov%t3.d\\t%0,%2,%4"
- [(set_attr "type" "move")
+ [(set_attr "type" "condmove")
(set_attr "mode" "DF")])
;; These are the main define_expand's used to make conditional moves.
Index: config/mips/5400.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/5400.md,v
retrieving revision 1.2
diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.2 5400.md
--- config/mips/5400.md 1 May 2003 02:33:10 -0000 1.2
+++ config/mips/5400.md 15 Jul 2003 08:08:07 -0000
@@ -44,11 +44,10 @@ (define_insn_reservation "ir_vr54_fstore
;; This reservation is for conditional move based on integer
-;; or floating point CC. This could probably use some refinement
-;; as "move" type attr seems to be overloaded in rtl.
-(define_insn_reservation "ir_vr54_move" 4
+;; or floating point CC.
+(define_insn_reservation "ir_vr54_condmove" 4
(and (eq_attr "cpu" "r5400")
- (eq_attr "type" "move"))
+ (eq_attr "type" "condmove"))
"vr54_dp0|vr54_dp1")
;; Move to/from FPU registers
@@ -64,7 +63,7 @@ (define_insn_reservation "ir_vr54_hilo"
(define_insn_reservation "ir_vr54_arith" 1
(and (eq_attr "cpu" "r5400")
- (eq_attr "type" "arith,darith,const,icmp,nop"))
+ (eq_attr "type" "move,arith,darith,const,icmp,nop"))
"vr54_dp0|vr54_dp1")
(define_insn_reservation "ir_vr54_imul_si" 3
Index: config/mips/5500.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/5500.md,v
retrieving revision 1.2
diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.2 5500.md
--- config/mips/5500.md 1 May 2003 02:33:11 -0000 1.2
+++ config/mips/5500.md 15 Jul 2003 08:08:07 -0000
@@ -37,11 +37,10 @@ (define_insn_reservation "ir_vr55_store"
"vr55_mem")
;; This reservation is for conditional move based on integer
-;; or floating point CC. This could probably use some refinement
-;; as "move" type attr seems to be overloaded in rtl.
-(define_insn_reservation "ir_vr55_move" 2
+;; or floating point CC.
+(define_insn_reservation "ir_vr55_condmove" 2
(and (eq_attr "cpu" "r5500")
- (eq_attr "type" "move"))
+ (eq_attr "type" "condmove"))
"vr55_dp0|vr55_dp1")
;; Move to/from FPU registers
@@ -57,7 +56,7 @@ (define_insn_reservation "ir_vr55_hilo"
(define_insn_reservation "ir_vr55_arith" 1
(and (eq_attr "cpu" "r5500")
- (eq_attr "type" "arith,darith,const,icmp,nop"))
+ (eq_attr "type" "move,arith,darith,const,icmp,nop"))
"vr55_dp0|vr55_dp1")
(define_insn_reservation "ir_vr55_imul_si" 3
Index: config/mips/sr71k.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/sr71k.md,v
retrieving revision 1.4
diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.4 sr71k.md
--- config/mips/sr71k.md 6 Jul 2003 23:05:12 -0000 1.4
+++ config/mips/sr71k.md 15 Jul 2003 08:08:07 -0000
@@ -172,12 +172,11 @@ (define_insn_reservation "ir_sr70_fstore
;; This reservation is for conditional move based on integer
-;; or floating point CC. This could probably use some refinement
-;; as "move" type attr seems to be overloaded in rtl.
-(define_insn_reservation "ir_sr70_move"
+;; or floating point CC.
+(define_insn_reservation "ir_sr70_condmove"
4
(and (eq_attr "cpu" "sr71000")
- (eq_attr "type" "move"))
+ (eq_attr "type" "condmove"))
"ri_insns")
;; Try to discriminate move-from-cp1 versus move-to-cp1 as latencies
@@ -206,7 +205,7 @@ (define_insn_reservation "ir_sr70_hilo"
(define_insn_reservation "ir_sr70_arith"
1
(and (eq_attr "cpu" "sr71000")
- (eq_attr "type" "arith,darith,const"))
+ (eq_attr "type" "move,arith,darith,const"))
"ri_insns")
;; emulate repeat (dispatch stall) by spending extra cycle(s) in