Commit ab0ca06f by David S. Miller Committed by David S. Miller

sparc.c (niagara2_costs): Adjust integer divide costs.

	* gcc/config/sparc/sparc.c (niagara2_costs): Adjust integer
	divide costs.
	(niagara3_costs): New.
	(sparc_option_override): Use it.
	* gcc/config/sparc/niagara2.md: Adjust with more accurate
	Niagara-3 reservations.

From-SVN: r178938
parent b38fb6fa
......@@ -21,6 +21,13 @@
__vis_fpack32): Fix types.
* doc/extend.texi: Document new 'edge' VIS intrinsics.
* gcc/config/sparc/sparc.c (niagara2_costs): Adjust integer
divide costs.
(niagara3_costs): New.
(sparc_option_override): Use it.
* gcc/config/sparc/niagara2.md: Adjust with more accurate
Niagara-3 reservations.
2011-09-17 Jakub Jelinek <jakub@redhat.com>
* config/i386/sse.md (VIMAX_AVX2): Change V4DI to V2TI.
......@@ -45,12 +45,22 @@
"niag2_pipe")
(define_insn_reservation "niag2_imul" 5
(and (eq_attr "cpu" "niagara2,niagara3")
(and (eq_attr "cpu" "niagara2")
(eq_attr "type" "imul"))
"niag2_pipe*5")
(define_insn_reservation "niag2_idiv" 31
(and (eq_attr "cpu" "niagara2,niagara3")
(define_insn_reservation "niag3_imul" 9
(and (eq_attr "cpu" "niagara3")
(eq_attr "type" "imul"))
"niag2_pipe*9")
(define_insn_reservation "niag2_idiv" 26
(and (eq_attr "cpu" "niagara2")
(eq_attr "type" "idiv"))
"niag2_pipe*26")
(define_insn_reservation "niag3_idiv" 31
(and (eq_attr "cpu" "niagara3")
(eq_attr "type" "idiv"))
"niag2_pipe*31")
......@@ -69,22 +79,42 @@
(eq_attr "type" "store,fpstore"))
"niag2_pipe")
(define_insn_reservation "niag2_fp" 3
(and (eq_attr "cpu" "niagara2,niagara3")
(define_insn_reservation "niag2_fp" 6
(and (eq_attr "cpu" "niagara2")
(eq_attr "type" "fpmove,fpcmove,fpcrmove,fpcmp,fpmul"))
"niag2_pipe*3")
"niag2_pipe*6")
(define_insn_reservation "niag3_fp" 9
(and (eq_attr "cpu" "niagara3")
(eq_attr "type" "fpmove,fpcmove,fpcrmove,fpcmp,fpmul"))
"niag2_pipe*9")
(define_insn_reservation "niag2_fdivs" 19
(and (eq_attr "cpu" "niagara2,niagara3")
(and (eq_attr "cpu" "niagara2")
(eq_attr "type" "fpdivs"))
"niag2_pipe*19")
(define_insn_reservation "niag3_fdivs" 23
(and (eq_attr "cpu" "niagara3")
(eq_attr "type" "fpdivs"))
"niag2_pipe*23")
(define_insn_reservation "niag2_fdivd" 33
(and (eq_attr "cpu" "niagara2,niagara3")
(and (eq_attr "cpu" "niagara2")
(eq_attr "type" "fpdivd"))
"niag2_pipe*33")
(define_insn_reservation "niag3_fdivd" 37
(and (eq_attr "cpu" "niagara3")
(eq_attr "type" "fpdivd"))
"niag2_pipe*37")
(define_insn_reservation "niag2_vis" 6
(and (eq_attr "cpu" "niagara2,niagara3")
(and (eq_attr "cpu" "niagara2")
(eq_attr "type" "fga,fgm_pack,fgm_mul,fgm_cmp,fgm_pdist,edge"))
"niag2_pipe*6")
(define_insn_reservation "niag3_vis" 9
(and (eq_attr "cpu" "niagara3")
(eq_attr "type" "fga,fgm_pack,fgm_mul,fgm_cmp,fgm_pdist,edge"))
"niag2_pipe*9")
......@@ -269,8 +269,32 @@ struct processor_costs niagara2_costs = {
COSTS_N_INSNS (5), /* imul */
COSTS_N_INSNS (5), /* imulX */
0, /* imul bit factor */
COSTS_N_INSNS (31), /* idiv, average of 12 - 41 cycle range */
COSTS_N_INSNS (31), /* idivX, average of 12 - 41 cycle range */
COSTS_N_INSNS (26), /* idiv, average of 12 - 41 cycle range */
COSTS_N_INSNS (26), /* idivX, average of 12 - 41 cycle range */
COSTS_N_INSNS (1), /* movcc/movr */
0, /* shift penalty */
};
static const
struct processor_costs niagara3_costs = {
COSTS_N_INSNS (3), /* int load */
COSTS_N_INSNS (3), /* int signed load */
COSTS_N_INSNS (3), /* int zeroed load */
COSTS_N_INSNS (3), /* float load */
COSTS_N_INSNS (9), /* fmov, fneg, fabs */
COSTS_N_INSNS (9), /* fadd, fsub */
COSTS_N_INSNS (9), /* fcmp */
COSTS_N_INSNS (9), /* fmov, fmovr */
COSTS_N_INSNS (9), /* fmul */
COSTS_N_INSNS (23), /* fdivs */
COSTS_N_INSNS (37), /* fdivd */
COSTS_N_INSNS (23), /* fsqrts */
COSTS_N_INSNS (37), /* fsqrtd */
COSTS_N_INSNS (9), /* imul */
COSTS_N_INSNS (9), /* imulX */
0, /* imul bit factor */
COSTS_N_INSNS (31), /* idiv, average of 17 - 45 cycle range */
COSTS_N_INSNS (30), /* idivX, average of 16 - 44 cycle range */
COSTS_N_INSNS (1), /* movcc/movr */
0, /* shift penalty */
};
......@@ -917,9 +941,11 @@ sparc_option_override (void)
sparc_costs = &niagara_costs;
break;
case PROCESSOR_NIAGARA2:
sparc_costs = &niagara2_costs;
break;
case PROCESSOR_NIAGARA3:
case PROCESSOR_NIAGARA4:
sparc_costs = &niagara2_costs;
sparc_costs = &niagara3_costs;
break;
case PROCESSOR_NATIVE:
gcc_unreachable ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment