Commit cac8ce95 by David Edelsohn Committed by David Edelsohn

unroll.c (loop_iteration_var, [...]): No longer static.

        * unroll.c (loop_iteration_var, loop_initial_value, loop_increment
        loop_final_value, loop_comparison_code): No longer static.
        (unroll_loop): Delete loop_start_value update.
        * loop.h (loop_iteration_var, loop_initial_value, loop_increment,
        loop_final_value, loop_comparison_code): Extern.
        (loop_start_value): Delete extern.
        * loop.c (loop_can_insert_bct, loop_increment, loop_start_value,
        loop_comparison_value, loop_comparison_code): Delete.
        (loop_optimize): Remove initialization for deleted variables.
        (strength_reduce): Delete analyze_loop_iterations call.  Only call
        insert_bct if flag_branch_count_on_reg set.
        (analyze_loop_iterations): Delete.
        (insert_bct): Remove iteration count calculation.  Move checks for
        viable BCT optimization to here.  Obtain iteration count from
        loop_iterations and correct for unrolling.  Check for enough
        iteration to be beneficial.  Comment out runtime iteration count
        case.
        (insert_bct): Print iteration count in dump file.  Remove
        loop_var_mode and use word_mode directly.
        * rs6000.h (processor_type): Add PROCESSOR_PPC604e.
        * rs6000.c (rs6000_override_options): Use it.
        (optimization_options): Enable use of flag_branch_on_count_reg.
        * rs6000.md (define_function_unit): Describe 604e.

From-SVN: r22852
parent d64db93f
Mon Oct 5 22:43:36 1998 David Edelsohn <edelsohn@mhpcc.edu>
* unroll.c (loop_iteration_var, loop_initial_value, loop_increment
loop_final_value, loop_comparison_code): No longer static.
(unroll_loop): Delete loop_start_value update.
* loop.h (loop_iteration_var, loop_initial_value, loop_increment,
loop_final_value, loop_comparison_code): Extern.
(loop_start_value): Delete extern.
* loop.c (loop_can_insert_bct, loop_increment, loop_start_value,
loop_comparison_value, loop_comparison_code): Delete.
(loop_optimize): Remove initialization for deleted variables.
(strength_reduce): Delete analyze_loop_iterations call. Only call
insert_bct if flag_branch_count_on_reg set.
(analyze_loop_iterations): Delete.
(insert_bct): Remove iteration count calculation. Move checks for
viable BCT optimization to here. Obtain iteration count from
loop_iterations and correct for unrolling. Check for enough
iteration to be beneficial. Comment out runtime iteration count
case.
(insert_bct): Print iteration count in dump file. Remove
loop_var_mode and use word_mode directly.
* rs6000.h (processor_type): Add PROCESSOR_PPC604e.
* rs6000.c (rs6000_override_options): Use it.
(optimization_options): Enable use of flag_branch_on_count_reg.
* rs6000.md (define_function_unit): Describe 604e.
1998-10-05 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl> 1998-10-05 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
* loop.c (move_movables): Corrected threshold calculation for * loop.c (move_movables): Corrected threshold calculation for
......
...@@ -228,7 +228,7 @@ rs6000_override_options (default_cpu) ...@@ -228,7 +228,7 @@ rs6000_override_options (default_cpu)
{"604", PROCESSOR_PPC604, {"604", PROCESSOR_PPC604,
MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
{"604e", PROCESSOR_PPC604, {"604e", PROCESSOR_PPC604e,
MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
{"620", PROCESSOR_PPC620, {"620", PROCESSOR_PPC620,
...@@ -353,13 +353,11 @@ optimization_options (level, size) ...@@ -353,13 +353,11 @@ optimization_options (level, size)
int level; int level;
int size ATTRIBUTE_UNUSED; int size ATTRIBUTE_UNUSED;
{ {
#if 0
#ifdef HAIFA #ifdef HAIFA
/* When optimizing, enable use of BCT instruction. */ /* When optimizing, enable use of BCT instruction. */
if (level >= 1) if (level >= 1)
flag_branch_on_count_reg = 1; flag_branch_on_count_reg = 1;
#endif #endif
#endif
} }
/* Do anything needed at the start of the asm file. */ /* Do anything needed at the start of the asm file. */
......
...@@ -389,7 +389,7 @@ extern int target_flags; ...@@ -389,7 +389,7 @@ extern int target_flags;
#define TARGET_DEFAULT (MASK_POWER | MASK_MULTIPLE | MASK_STRING) #define TARGET_DEFAULT (MASK_POWER | MASK_MULTIPLE | MASK_STRING)
/* Processor type. */ /* Processor type. Order must match cpu attribute in MD file. */
enum processor_type enum processor_type
{PROCESSOR_RIOS1, {PROCESSOR_RIOS1,
PROCESSOR_RIOS2, PROCESSOR_RIOS2,
...@@ -398,6 +398,7 @@ enum processor_type ...@@ -398,6 +398,7 @@ enum processor_type
PROCESSOR_PPC601, PROCESSOR_PPC601,
PROCESSOR_PPC603, PROCESSOR_PPC603,
PROCESSOR_PPC604, PROCESSOR_PPC604,
PROCESSOR_PPC604e,
PROCESSOR_PPC620}; PROCESSOR_PPC620};
extern enum processor_type rs6000_cpu; extern enum processor_type rs6000_cpu;
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
;; Processor type -- this attribute must exactly match the processor_type ;; Processor type -- this attribute must exactly match the processor_type
;; enumeration in rs6000.h. ;; enumeration in rs6000.h.
(define_attr "cpu" "rios1,rios2,mpccore,ppc403,ppc601,ppc603,ppc604,ppc620" (define_attr "cpu" "rios1,rios2,mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620"
(const (symbol_ref "rs6000_cpu_attr"))) (const (symbol_ref "rs6000_cpu_attr")))
; (define_function_unit NAME MULTIPLICITY SIMULTANEITY ; (define_function_unit NAME MULTIPLICITY SIMULTANEITY
...@@ -50,12 +50,12 @@ ...@@ -50,12 +50,12 @@
; (POWER and 601 use Integer Unit) ; (POWER and 601 use Integer Unit)
(define_function_unit "lsu" 1 0 (define_function_unit "lsu" 1 0
(and (eq_attr "type" "load") (and (eq_attr "type" "load")
(eq_attr "cpu" "mpccore,ppc603,ppc604,ppc620")) (eq_attr "cpu" "mpccore,ppc603,ppc604,ppc604e,ppc620"))
2 1) 2 1)
(define_function_unit "lsu" 1 0 (define_function_unit "lsu" 1 0
(and (eq_attr "type" "store,fpstore") (and (eq_attr "type" "store,fpstore")
(eq_attr "cpu" "mpccore,ppc603,ppc604,ppc620")) (eq_attr "cpu" "mpccore,ppc603,ppc604,ppc604e,ppc620"))
1 1) 1 1)
(define_function_unit "lsu" 1 0 (define_function_unit "lsu" 1 0
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
(define_function_unit "lsu" 1 0 (define_function_unit "lsu" 1 0
(and (eq_attr "type" "fpload") (and (eq_attr "type" "fpload")
(eq_attr "cpu" "ppc604,ppc620")) (eq_attr "cpu" "ppc604,ppc604e,ppc620"))
3 1) 3 1)
(define_function_unit "iu" 1 0 (define_function_unit "iu" 1 0
...@@ -181,12 +181,12 @@ ...@@ -181,12 +181,12 @@
(eq_attr "cpu" "mpccore")) (eq_attr "cpu" "mpccore"))
6 6) 6 6)
; PPC604 has two units that perform integer operations ; PPC604{,e} has two units that perform integer operations
; and one unit for divide/multiply operations (and move ; and one unit for divide/multiply operations (and move
; from/to spr). ; from/to spr).
(define_function_unit "iu2" 2 0 (define_function_unit "iu2" 2 0
(and (eq_attr "type" "integer") (and (eq_attr "type" "integer")
(eq_attr "cpu" "ppc604,ppc620")) (eq_attr "cpu" "ppc604,ppc604e,ppc620"))
1 1) 1 1)
(define_function_unit "imuldiv" 1 0 (define_function_unit "imuldiv" 1 0
...@@ -195,8 +195,13 @@ ...@@ -195,8 +195,13 @@
4 2) 4 2)
(define_function_unit "imuldiv" 1 0 (define_function_unit "imuldiv" 1 0
(and (eq_attr "type" "imul")
(eq_attr "cpu" "ppc604e"))
2 1)
(define_function_unit "imuldiv" 1 0
(and (eq_attr "type" "idiv") (and (eq_attr "type" "idiv")
(eq_attr "cpu" "ppc604,ppc620")) (eq_attr "cpu" "ppc604,ppc604e,ppc620"))
20 19) 20 19)
; compare is done on integer unit, but feeds insns which ; compare is done on integer unit, but feeds insns which
...@@ -213,7 +218,7 @@ ...@@ -213,7 +218,7 @@
(define_function_unit "iu" 1 0 (define_function_unit "iu" 1 0
(and (eq_attr "type" "compare,delayed_compare") (and (eq_attr "type" "compare,delayed_compare")
(eq_attr "cpu" "mpccore,ppc403,ppc601,ppc603,ppc604,ppc620")) (eq_attr "cpu" "mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620"))
3 1) 3 1)
(define_function_unit "iu2" 2 0 (define_function_unit "iu2" 2 0
...@@ -223,7 +228,7 @@ ...@@ -223,7 +228,7 @@
(define_function_unit "iu2" 2 0 (define_function_unit "iu2" 2 0
(and (eq_attr "type" "compare,delayed_compare") (and (eq_attr "type" "compare,delayed_compare")
(eq_attr "cpu" "ppc604,ppc620")) (eq_attr "cpu" "ppc604,ppc604e,ppc620"))
1 1) 1 1)
; fp compare uses fp unit ; fp compare uses fp unit
...@@ -250,7 +255,7 @@ ...@@ -250,7 +255,7 @@
; fp compare uses fp unit ; fp compare uses fp unit
(define_function_unit "fpu" 1 0 (define_function_unit "fpu" 1 0
(and (eq_attr "type" "fpcompare") (and (eq_attr "type" "fpcompare")
(eq_attr "cpu" "ppc601,ppc603,ppc604,ppc620")) (eq_attr "cpu" "ppc601,ppc603,ppc604,ppc604e,ppc620"))
5 1) 5 1)
(define_function_unit "fpu" 1 0 (define_function_unit "fpu" 1 0
...@@ -265,7 +270,7 @@ ...@@ -265,7 +270,7 @@
(define_function_unit "bpu" 1 0 (define_function_unit "bpu" 1 0
(and (eq_attr "type" "mtjmpr") (and (eq_attr "type" "mtjmpr")
(eq_attr "cpu" "mpccore,ppc403,ppc601,ppc603,ppc604,ppc620")) (eq_attr "cpu" "mpccore,ppc403,ppc601,ppc603,ppc604,ppc604e,ppc620"))
4 1) 4 1)
; all jumps/branches are executing on the bpu, in 1 cycle, for all machines. ; all jumps/branches are executing on the bpu, in 1 cycle, for all machines.
...@@ -295,7 +300,7 @@ ...@@ -295,7 +300,7 @@
(define_function_unit "fpu" 1 0 (define_function_unit "fpu" 1 0
(and (eq_attr "type" "fp") (and (eq_attr "type" "fp")
(eq_attr "cpu" "ppc603,ppc604,ppc620")) (eq_attr "cpu" "ppc603,ppc604,ppc604e,ppc620"))
3 1) 3 1)
(define_function_unit "fpu" 1 0 (define_function_unit "fpu" 1 0
...@@ -316,7 +321,7 @@ ...@@ -316,7 +321,7 @@
(define_function_unit "fpu" 1 0 (define_function_unit "fpu" 1 0
(and (eq_attr "type" "dmul") (and (eq_attr "type" "dmul")
(eq_attr "cpu" "ppc604,ppc620")) (eq_attr "cpu" "ppc604,ppc604e,ppc620"))
3 1) 3 1)
(define_function_unit "fpu" 1 0 (define_function_unit "fpu" 1 0
...@@ -336,7 +341,7 @@ ...@@ -336,7 +341,7 @@
(define_function_unit "fpu" 1 0 (define_function_unit "fpu" 1 0
(and (eq_attr "type" "sdiv") (and (eq_attr "type" "sdiv")
(eq_attr "cpu" "ppc603,ppc604,ppc620")) (eq_attr "cpu" "ppc603,ppc604,ppc604e,ppc620"))
18 18) 18 18)
(define_function_unit "fpu" 1 0 (define_function_unit "fpu" 1 0
...@@ -346,7 +351,7 @@ ...@@ -346,7 +351,7 @@
(define_function_unit "fpu" 1 0 (define_function_unit "fpu" 1 0
(and (eq_attr "type" "ddiv") (and (eq_attr "type" "ddiv")
(eq_attr "cpu" "ppc601,ppc604,ppc620")) (eq_attr "cpu" "ppc601,ppc604,ppc604e,ppc620"))
31 31) 31 31)
(define_function_unit "fpu" 1 0 (define_function_unit "fpu" 1 0
......
/* Loop optimization definitions for GNU C-Compiler /* Loop optimization definitions for GNU C-Compiler
Copyright (C) 1991, 1995 Free Software Foundation, Inc. Copyright (C) 1991, 1995, 1998 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -184,9 +184,12 @@ void emit_unrolled_add PROTO((rtx, rtx, rtx)); ...@@ -184,9 +184,12 @@ void emit_unrolled_add PROTO((rtx, rtx, rtx));
int back_branch_in_range_p PROTO((rtx, rtx, rtx)); int back_branch_in_range_p PROTO((rtx, rtx, rtx));
extern int *loop_unroll_factor; extern int *loop_unroll_factor;
#ifdef HAIFA
/* variables for interaction between unroll.c and loop.c, for #ifdef HAVE_decrement_and_branch_on_count
the insertion of branch-on-count instruction. */ extern rtx loop_iteration_var;
extern rtx *loop_start_value; extern rtx loop_initial_value;
#endif /* HAIFA */ extern rtx loop_increment;
extern rtx loop_final_value;
extern enum rtx_code loop_comparison_code;
#endif /* HAVE_decrement_and_branch_on_count */
...@@ -189,11 +189,11 @@ static int *splittable_regs_updates; ...@@ -189,11 +189,11 @@ static int *splittable_regs_updates;
/* Values describing the current loop's iteration variable. These are set up /* Values describing the current loop's iteration variable. These are set up
by loop_iterations, and used by precondition_loop_p. */ by loop_iterations, and used by precondition_loop_p. */
static rtx loop_iteration_var; rtx loop_iteration_var;
static rtx loop_initial_value; rtx loop_initial_value;
static rtx loop_increment; rtx loop_increment;
static rtx loop_final_value; rtx loop_final_value;
static enum rtx_code loop_comparison_code; enum rtx_code loop_comparison_code;
/* Forward declarations. */ /* Forward declarations. */
...@@ -1127,13 +1127,6 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before, ...@@ -1127,13 +1127,6 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before,
/* Set unroll type to MODULO now. */ /* Set unroll type to MODULO now. */
unroll_type = UNROLL_MODULO; unroll_type = UNROLL_MODULO;
loop_preconditioned = 1; loop_preconditioned = 1;
#ifdef HAIFA
/* Fix the initial value for the loop as needed. */
if (loop_n_iterations <= 0)
loop_start_value [uid_loop_num [INSN_UID (loop_start)]]
= initial_value;
#endif
} }
} }
......
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