[PATCH, committed] PowerPC jump and loop alignment
David Edelsohn
dje@watson.ibm.com
Fri Aug 27 20:48:00 GMT 2004
POWER4 and POWER5 show better performance when branching to
aligned addresses, which help instruction fetch.
David
* config/rs6000/rs6000.c (rs6000_override_options): Increase
maximum skip to 15. Set function alignment, jump alignment, and
loop alignment to 16 for processors that form dispatch groups.
(rs6000_rtx_costs): outer_code is used.
Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.702
diff -c -p -r1.702 rs6000.c
*** rs6000.c 26 Aug 2004 17:20:16 -0000 1.702
--- rs6000.c 27 Aug 2004 17:46:47 -0000
*************** rs6000_override_options (const char *def
*** 1429,1437 ****
targetm.asm_out.unaligned_op.di = NULL;
}
! /* Set maximum branch target alignment at two instructions, eight bytes. */
! align_jumps_max_skip = 8;
! align_loops_max_skip = 8;
/* Arrange to save and restore machine status around nested functions. */
init_machine_status = rs6000_init_machine_status;
--- 1429,1451 ----
targetm.asm_out.unaligned_op.di = NULL;
}
! /* Set branch target alignment, if not optimizing for size. */
! if (!optimize_size)
! {
! if (rs6000_sched_groups)
! {
! if (align_functions <= 0)
! align_functions = 16;
! if (align_jumps <= 0)
! align_jumps = 16;
! if (align_loops <= 0)
! align_loops = 16;
! }
! if (align_jumps_max_skip <= 0)
! align_jumps_max_skip = 15;
! if (align_loops_max_skip <= 0)
! align_loops_max_skip = 15;
! }
/* Arrange to save and restore machine status around nested functions. */
init_machine_status = rs6000_init_machine_status;
*************** rs6000_binds_local_p (tree decl)
*** 17070,17077 ****
scanned. In either case, *TOTAL contains the cost result. */
static bool
! rs6000_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED,
! int *total)
{
enum machine_mode mode = GET_MODE (x);
--- 17084,17090 ----
scanned. In either case, *TOTAL contains the cost result. */
static bool
! rs6000_rtx_costs (rtx x, int code, int outer_code, int *total)
{
enum machine_mode mode = GET_MODE (x);
More information about the Gcc-patches
mailing list