{"750", PROCESSOR_PPC750,
MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
+ {"7400", PROCESSOR_PPC7400,
+ MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
+ POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
+ {"7450", PROCESSOR_PPC7450,
+ MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
+ POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
{"801", PROCESSOR_MPCCORE,
MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS,
POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
fprintf (stderr, "\tfp_size = %5d\n", info->fp_size);
if (info->lr_size)
- fprintf (stderr, "\tlr_size = %5d\n", info->cr_size);
+ fprintf (stderr, "\tlr_size = %5d\n", info->lr_size);
if (info->cr_size)
fprintf (stderr, "\tcr_size = %5d\n", info->cr_size);
if (REG_NOTE_KIND (link) == 0)
{
- /* Data dependency; DEP_INSN writes a register that INSN reads some
- cycles later. */
-
- /* Tell the first scheduling pass about the latency between a mtctr
- and bctr (and mtlr and br/blr). The first scheduling pass will not
- know about this latency since the mtctr instruction, which has the
- latency associated to it, will be generated by reload. */
- if (get_attr_type (insn) == TYPE_JMPREG)
- return TARGET_POWER ? 5 : 4;
-
+ /* Data dependency; DEP_INSN writes a register that INSN reads
+ some cycles later. */
+ switch (get_attr_type (insn))
+ {
+ case TYPE_JMPREG:
+ /* Tell the first scheduling pass about the latency between
+ a mtctr and bctr (and mtlr and br/blr). The first
+ scheduling pass will not know about this latency since
+ the mtctr instruction, which has the latency associated
+ to it, will be generated by reload. */
+ return TARGET_POWER ? 5 : 4;
+ case TYPE_BRANCH:
+ /* Leave some extra cycles between a compare and its
+ dependent branch, to inhibit expensive mispredicts. */
+ if ((rs6000_cpu_attr == CPU_PPC750
+ || rs6000_cpu_attr == CPU_PPC7400
+ || rs6000_cpu_attr == CPU_PPC7450)
+ && recog_memoized (dep_insn)
+ && (INSN_CODE (dep_insn) >= 0)
+ && (get_attr_type (dep_insn) == TYPE_COMPARE
+ || get_attr_type (dep_insn) == TYPE_DELAYED_COMPARE
+ || get_attr_type (dep_insn) == TYPE_FPCOMPARE
+ || get_attr_type (dep_insn) == TYPE_CR_LOGICAL))
+ return cost + 2;
+ default:
+ break;
+ }
/* Fall out to return default cost. */
}
case CPU_RIOS1: /* ? */
case CPU_RS64A:
case CPU_PPC601: /* ? */
+ case CPU_PPC7450:
return 3;
case CPU_PPC603:
case CPU_PPC750:
+ case CPU_PPC7400:
return 2;
case CPU_RIOS2:
case CPU_PPC604:
;; Processor type -- this attribute must exactly match the processor_type
;; enumeration in rs6000.h.
-(define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750"
+(define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450"
(const (symbol_ref "rs6000_cpu_attr")))
; (define_function_unit NAME MULTIPLICITY SIMULTANEITY
; (POWER and 601 use Integer Unit)
(define_function_unit "lsu" 1 0
(and (eq_attr "type" "load")
- (eq_attr "cpu" "rs64a,mpccore,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750"))
+ (eq_attr "cpu" "rs64a,mpccore,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400"))
2 1)
+(define_function_unit "lsu" 1 0
+ (and (eq_attr "type" "load")
+ (eq_attr "cpu" "ppc7450"))
+ 3 1)
+
(define_function_unit "lsu" 1 0
(and (eq_attr "type" "store,fpstore")
- (eq_attr "cpu" "rs64a,mpccore,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750"))
+ (eq_attr "cpu" "rs64a,mpccore,ppc603,ppc604,ppc604e,ppc620,ppc630"))
1 1)
+(define_function_unit "lsu" 1 0
+ (and (eq_attr "type" "store,fpstore")
+ (eq_attr "cpu" "ppc750,ppc7400"))
+ 2 1)
+
+(define_function_unit "lsu" 1 0
+ (and (eq_attr "type" "store")
+ (eq_attr "cpu" "ppc7450"))
+ 3 1)
+
+(define_function_unit "lsu" 1 0
+ (and (eq_attr "type" "fpstore")
+ (eq_attr "cpu" "ppc7450"))
+ 3 3)
+
(define_function_unit "lsu" 1 0
(and (eq_attr "type" "fpload")
- (eq_attr "cpu" "mpccore,ppc603,ppc750"))
+ (eq_attr "cpu" "mpccore,ppc603,ppc750,ppc7400"))
2 1)
+(define_function_unit "lsu" 1 0
+ (and (eq_attr "type" "fpload")
+ (eq_attr "cpu" "ppc7450"))
+ 4 1)
+
(define_function_unit "lsu" 1 0
(and (eq_attr "type" "fpload")
(eq_attr "cpu" "rs64a,ppc604,ppc604e,ppc620,ppc630"))
(eq_attr "cpu" "ppc620,ppc630"))
37 36)
+; PPC7450 has 3 integer units (for most integer insns) and one mul/div
+; unit, which also does CR-logical insns and move to/from SPR.
+
+(define_function_unit "iu3" 3 0
+ (and (eq_attr "type" "integer")
+ (eq_attr "cpu" "ppc7450"))
+ 1 1)
+
+(define_function_unit "imuldiv" 1 0
+ (and (eq_attr "type" "imul")
+ (eq_attr "cpu" "ppc7450"))
+ 4 4)
+
+(define_function_unit "imuldiv" 1 0
+ (and (eq_attr "type" "idiv")
+ (eq_attr "cpu" "ppc7450"))
+ 23 23)
+
+(define_function_unit "imuldiv" 1 0
+ (and (eq_attr "type" "cr_logical")
+ (eq_attr "cpu" "ppc7450"))
+ 1 1)
+
; PPC750 has two integer units: a primary one which can perform all
; operations and a secondary one which is fed in lock step with the first
; and can perform "simple" integer operations.
; for the complex insns.
(define_function_unit "iu2" 2 0
(and (eq_attr "type" "integer")
- (eq_attr "cpu" "ppc750"))
+ (eq_attr "cpu" "ppc750,ppc7400"))
1 1)
(define_function_unit "iu2" 2 0
(and (eq_attr "type" "imul")
- (eq_attr "cpu" "ppc750"))
- 4 2)
+ (eq_attr "cpu" "ppc750,ppc7400"))
+ 4 4)
+
+(define_function_unit "iu2" 2 0
+ (and (eq_attr "type" "idiv")
+ (eq_attr "cpu" "ppc750,ppc7400"))
+ 19 19)
(define_function_unit "imuldiv" 1 0
(and (eq_attr "type" "imul")
- (eq_attr "cpu" "ppc750"))
- 4 2)
+ (eq_attr "cpu" "ppc750,ppc7400"))
+ 4 4)
(define_function_unit "imuldiv" 1 0
(and (eq_attr "type" "idiv")
- (eq_attr "cpu" "ppc750"))
+ (eq_attr "cpu" "ppc750,ppc7400"))
19 19)
; CR-logical operations are execute-serialized, that is they don't
; I've imitated this by giving them longer latency.
(define_function_unit "sru" 1 0
(and (eq_attr "type" "cr_logical")
- (eq_attr "cpu" "ppc603,ppc750"))
+ (eq_attr "cpu" "ppc603,ppc750,ppc7400"))
3 2)
; compare is done on integer unit, but feeds insns which
(define_function_unit "iu" 1 0
(and (eq_attr "type" "compare,delayed_compare")
- (eq_attr "cpu" "rs64a,mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750"))
+ (eq_attr "cpu" "rs64a,mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630"))
3 1)
+; some extra cycles added by TARGET_SCHED_ADJUST_COST between compare
+; and a following branch, to reduce mispredicts
+(define_function_unit "iu" 1 0
+ (and (eq_attr "type" "compare,delayed_compare")
+ (eq_attr "cpu" "ppc750,ppc7400"))
+ 1 1)
+
+(define_function_unit "iu3" 3 0
+ (and (eq_attr "type" "compare,delayed_compare")
+ (eq_attr "cpu" "ppc7450"))
+ 1 1)
+
(define_function_unit "iu2" 2 0
(and (eq_attr "type" "compare,delayed_compare")
(eq_attr "cpu" "rios2"))
(define_function_unit "iu2" 2 0
(and (eq_attr "type" "compare,delayed_compare")
- (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc630,ppc750"))
+ (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400"))
1 1)
; fp compare uses fp unit
; fp compare uses fp unit
(define_function_unit "fpu" 1 0
(and (eq_attr "type" "fpcompare")
- (eq_attr "cpu" "rs64a,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750"))
+ (eq_attr "cpu" "rs64a,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630"))
5 1)
+(define_function_unit "fpu" 1 0
+ (and (eq_attr "type" "fpcompare")
+ (eq_attr "cpu" "ppc750,ppc7400,ppc7450"))
+ 3 1)
+
(define_function_unit "fpu" 1 0
(and (eq_attr "type" "fpcompare")
(eq_attr "cpu" "mpccore"))
(define_function_unit "bpu" 1 0
(and (eq_attr "type" "mtjmpr")
- (eq_attr "cpu" "mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750"))
+ (eq_attr "cpu" "mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450"))
4 1)
(define_function_unit "bpu" 1 0
(define_function_unit "fpu" 1 0
(and (eq_attr "type" "fp")
- (eq_attr "cpu" "ppc603,ppc750,ppc604,ppc604e,ppc620"))
+ (eq_attr "cpu" "ppc603,ppc604,ppc604e,ppc620,ppc750,ppc7400"))
3 1)
+(define_function_unit "fpu" 1 0
+ (and (eq_attr "type" "fp,dmul")
+ (eq_attr "cpu" "ppc7450"))
+ 5 1)
+
(define_function_unit "fpu" 1 0
(and (eq_attr "type" "dmul")
(eq_attr "cpu" "rs64a"))
(define_function_unit "fpu" 1 0
(and (eq_attr "type" "dmul")
- (eq_attr "cpu" "ppc604,ppc604e,ppc620"))
+ (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc7400"))
3 1)
(define_function_unit "fpu" 1 0
(define_function_unit "fpu" 1 0
(and (eq_attr "type" "sdiv")
- (eq_attr "cpu" "ppc601"))
+ (eq_attr "cpu" "ppc601,ppc750,ppc7400"))
17 17)
+(define_function_unit "fpu" 1 0
+ (and (eq_attr "type" "sdiv")
+ (eq_attr "cpu" "ppc7450"))
+ 21 21)
+
(define_function_unit "fpu" 1 0
(and (eq_attr "type" "sdiv")
(eq_attr "cpu" "mpccore"))
(define_function_unit "fpu" 1 0
(and (eq_attr "type" "ddiv")
- (eq_attr "cpu" "rs64a,ppc601,ppc750,ppc604,ppc604e,ppc620"))
+ (eq_attr "cpu" "rs64a,ppc601,ppc750,ppc604,ppc604e,ppc620,ppc7400"))
31 31)
+(define_function_unit "fpu" 1 0
+ (and (eq_attr "type" "ddiv")
+ (eq_attr "cpu" "ppc7450"))
+ 35 35)
+
(define_function_unit "fpu" 1 0
(and (eq_attr "type" "ddiv")
(eq_attr "cpu" "ppc603"))