--- /dev/null
+;; DFA based pipeline description for the r3000
+;; This is a special pipeline - this is also the default schedule and
+;; so we need to schedule instructions that may not exist on the r2k/r3k.
+
+;; Generic processor description that assumes that the only latencies are for
+;; hazards or delay slots, otherwise everything is assumed to issue and execute
+;; in one cycle.
+(define_automaton "r3k")
+
+(define_cpu_unit "r3k_alu" "r3k")
+
+(define_insn_reservation "r3k_generic_alu" 1
+ (and (eq_attr "cpu" "r3000")
+ (eq_attr "type" "unknown,prefetch,prefetchx,condmove,mthilo,const,arith,shift,slt,clz,trap,fmove,fadd,fmadd,fabs,fneg,fcvt,fsqrt,frsqrt,multi,nop"))
+ "r3k_alu")
+
+(define_insn_reservation "r3k_load_alu" 2
+ (and (eq_attr "cpu" "r3000")
+ (eq_attr "type" "load, fpload, fpidxload, xfer"))
+ "r3k_alu*2")
+
+(define_insn_reservation "r3k_call_alu" 2
+ (and (eq_attr "cpu" "r3000")
+ (eq_attr "type" "branch,jump,call"))
+ "r3k_alu*2")
+
+(define_insn_reservation "r3k_hilo_alu" 3
+ (and (eq_attr "cpu" "r3000")
+ (eq_attr "type" "mfhilo"))
+ "r3k_alu*3")
+
+(define_insn_reservation "r3k_fcmp_alu" 2
+ (and (eq_attr "cpu" "r3000")
+ (eq_attr "type" "fcmp, fadd"))
+ "r3k_alu*2")
+
+(define_insn_reservation "r3k_imul_alu" 12
+ (and (eq_attr "cpu" "r3000")
+ (eq_attr "type" "imul, imadd"))
+ "r3k_alu*12")
+
+(define_insn_reservation "r3k_idiv_alu" 35
+ (and (eq_attr "cpu" "r3000")
+ (eq_attr "type" "idiv"))
+ "r3k_alu*35")
+
+(define_insn_reservation "r3k_fmul_single_alu" 4
+ (and (eq_attr "cpu" "r3000")
+ (and (eq_attr "type" "fmul")
+ (eq_attr "mode" "SF")))
+ "r3k_alu*4")
+
+(define_insn_reservation "r3k_fmul_double_alu" 5
+ (and (eq_attr "cpu" "r3000")
+ (and (eq_attr "type" "fmul")
+ (eq_attr "mode" "DF")))
+ "r3k_alu*5")
+
+(define_insn_reservation "r3k_fdiv_single_alu" 12
+ (and (eq_attr "cpu" "r3000")
+ (and (eq_attr "type" "fdiv")
+ (eq_attr "mode" "SF")))
+ "r3k_alu*12")
+
+(define_insn_reservation "r3k_fdiv_double_alu" 19
+ (and (eq_attr "cpu" "r3000")
+ (and (eq_attr "type" "fdiv")
+ (eq_attr "mode" "DF")))
+ "r3k_alu*19")
(define_function_unit "memory" 1 0
(and (eq_attr "type" "load,fpload,fpidxload")
- (eq_attr "cpu" "!r3000,r3900,r4600,r4650,r4100,r4120,r4300,r5000"))
+ (eq_attr "cpu" "r3900,r4600,r4650,r4100,r4120,r4300,r5000"))
3 0)
(define_function_unit "memory" 1 0
(and (eq_attr "type" "load,fpload,fpidxload")
- (eq_attr "cpu" "r3000,r3900,r4600,r4650,r4100,r4120,r4300,r5000"))
+ (eq_attr "cpu" "r3900,r4600,r4650,r4100,r4120,r4300,r5000"))
2 0)
(define_function_unit "memory" 1 0
(define_function_unit "imuldiv" 1 0
(and (eq_attr "type" "imul,imadd")
- (eq_attr "cpu" "!r3000,r3900,r4000,r4600,r4650,r4100,r4120,r4300,r5000"))
+ (eq_attr "cpu" "r3900,r4000,r4600,r4650,r4100,r4120,r4300,r5000"))
17 17)
;; On them mips16, we want to stronly discourage a mult from appearing
1 5)
(define_function_unit "imuldiv" 1 0
- (and (eq_attr "type" "imul,imadd") (eq_attr "cpu" "r3000,r3900"))
+ (and (eq_attr "type" "imul,imadd") (eq_attr "cpu" "r3900"))
12 12)
(define_function_unit "imuldiv" 1 0
(define_function_unit "imuldiv" 1 0
(and (eq_attr "type" "idiv")
- (eq_attr "cpu" "!r3000,r3900,r4000,r4600,r4650,r4100,r4120,r4300,r5000"))
+ (eq_attr "cpu" "r3900,r4000,r4600,r4650,r4100,r4120,r4300,r5000"))
38 38)
(define_function_unit "imuldiv" 1 0
- (and (eq_attr "type" "idiv") (eq_attr "cpu" "r3000,r3900"))
+ (and (eq_attr "type" "idiv") (eq_attr "cpu" "r3900"))
35 35)
(define_function_unit "imuldiv" 1 0
;; instructions to be processed in the "imuldiv" unit.
(define_function_unit "adder" 1 1
- (and (eq_attr "type" "fcmp") (eq_attr "cpu" "!r3000,r3900,r6000,r4300,r5000"))
+ (and (eq_attr "type" "fcmp") (eq_attr "cpu" "r3900,r6000,r4300,r5000"))
3 0)
(define_function_unit "adder" 1 1
- (and (eq_attr "type" "fcmp") (eq_attr "cpu" "r3000,r3900,r6000"))
+ (and (eq_attr "type" "fcmp") (eq_attr "cpu" "r3900,r6000"))
2 0)
(define_function_unit "adder" 1 1
1 0)
(define_function_unit "adder" 1 1
- (and (eq_attr "type" "fadd") (eq_attr "cpu" "!r3000,r3900,r6000,r4300"))
+ (and (eq_attr "type" "fadd") (eq_attr "cpu" "r3900,r6000,r4300"))
4 0)
(define_function_unit "adder" 1 1
- (and (eq_attr "type" "fadd") (eq_attr "cpu" "r3000,r3900"))
+ (and (eq_attr "type" "fadd") (eq_attr "cpu" "r3900"))
2 0)
(define_function_unit "adder" 1 1
(define_function_unit "adder" 1 1
(and (eq_attr "type" "fabs,fneg,fmove")
- (eq_attr "cpu" "!r3000,r3900,r4600,r4650,r4300,r5000"))
+ (eq_attr "cpu" "r3900,r4600,r4650,r4300,r5000"))
2 0)
(define_function_unit "adder" 1 1
- (and (eq_attr "type" "fabs,fneg,fmove") (eq_attr "cpu" "r3000,r3900,r4600,r4650,r5000"))
+ (and (eq_attr "type" "fabs,fneg,fmove") (eq_attr "cpu" "r3900,r4600,r4650,r5000"))
1 0)
(define_function_unit "mult" 1 1
(and (eq_attr "type" "fmul")
(and (eq_attr "mode" "SF")
- (eq_attr "cpu" "!r3000,r3900,r6000,r4600,r4650,r4300,r5000")))
+ (eq_attr "cpu" "r3900,r6000,r4600,r4650,r4300,r5000")))
7 0)
(define_function_unit "mult" 1 1
(and (eq_attr "type" "fmul")
- (and (eq_attr "mode" "SF") (eq_attr "cpu" "r3000,r3900,r5000")))
+ (and (eq_attr "mode" "SF") (eq_attr "cpu" "r3900,r5000")))
4 0)
(define_function_unit "mult" 1 1
(define_function_unit "mult" 1 1
(and (eq_attr "type" "fmul")
- (and (eq_attr "mode" "DF") (eq_attr "cpu" "!r3000,r3900,r6000,r4300,r5000")))
+ (and (eq_attr "mode" "DF") (eq_attr "cpu" "r3900,r6000,r4300,r5000")))
8 0)
(define_function_unit "mult" 1 1
(and (eq_attr "type" "fmul")
- (and (eq_attr "mode" "DF") (eq_attr "cpu" "r3000,r3900,r5000")))
+ (and (eq_attr "mode" "DF") (eq_attr "cpu" "r3900,r5000")))
5 0)
(define_function_unit "mult" 1 1
(define_function_unit "divide" 1 1
(and (eq_attr "type" "fdiv")
(and (eq_attr "mode" "SF")
- (eq_attr "cpu" "!r3000,r3900,r6000,r4600,r4650,r4300,r5000")))
+ (eq_attr "cpu" "r3900,r6000,r4600,r4650,r4300,r5000")))
23 0)
(define_function_unit "divide" 1 1
(and (eq_attr "type" "fdiv")
- (and (eq_attr "mode" "SF") (eq_attr "cpu" "r3000,r3900")))
+ (and (eq_attr "mode" "SF") (eq_attr "cpu" "r3900")))
12 0)
(define_function_unit "divide" 1 1
(define_function_unit "divide" 1 1
(and (eq_attr "type" "fdiv")
(and (eq_attr "mode" "DF")
- (eq_attr "cpu" "!r3000,r3900,r6000,r4600,r4650,r4300")))
+ (eq_attr "cpu" "r3900,r6000,r4600,r4650,r4300")))
36 0)
(define_function_unit "divide" 1 1
(and (eq_attr "type" "fdiv")
- (and (eq_attr "mode" "DF") (eq_attr "cpu" "r3000,r3900")))
+ (and (eq_attr "mode" "DF") (eq_attr "cpu" "r3900")))
19 0)
(define_function_unit "divide" 1 1
\f
;; Include scheduling descriptions.
+(include "3000.md")
(include "4130.md")
(include "5400.md")
(include "5500.md")