diff options
author | DJ Delorie <dj@redhat.com> | 2011-05-10 07:01:49 -0400 |
---|---|---|
committer | Nick Clifton <nickc@gcc.gnu.org> | 2011-05-10 11:01:49 +0000 |
commit | 34cc3c861dc01807a8fbe392ba3f275286e7bf1b (patch) | |
tree | 72b4a0484c2689bf0a43ccd949c9e078168caaf1 | |
parent | be17328916770319a04f236f42aaf12404bad162 (diff) | |
download | gcc-34cc3c861dc01807a8fbe392ba3f275286e7bf1b.zip gcc-34cc3c861dc01807a8fbe392ba3f275286e7bf1b.tar.gz gcc-34cc3c861dc01807a8fbe392ba3f275286e7bf1b.tar.bz2 |
rx.h (JUMP_ALIGN, [...]): Define.
* config/rx/rx.h (JUMP_ALIGN, LABEL_ALIGN, LOOP_ALIGN): Define.
(LABEL_ALIGN_AFTER_BARRIER): Pass label to rx_align_for_label
* config/rx/rx.c (rx_align_for_label): Add label and
uses_threshold parameters. Do not align when the label is not
used enough.
* config/rx/rx-protos.h (rx_align_for_label): Update prototype.
From-SVN: r173615
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/config/rx/rx-protos.h | 4 | ||||
-rw-r--r-- | gcc/config/rx/rx.c | 9 | ||||
-rw-r--r-- | gcc/config/rx/rx.h | 8 |
4 files changed, 26 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7e5d7b9..43784a6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2011-05-10 DJ Delorie <dj@redhat.com> + + * config/rx/rx.h (JUMP_ALIGN, LABEL_ALIGN, LOOP_ALIGN): Define. + (LABEL_ALIGN_AFTER_BARRIER): Pass label to rx_align_for_label + * config/rx/rx.c (rx_align_for_label): Add label and + uses_threshold parameters. Do not align when the label is not + used enough. + * config/rx/rx-protos.h (rx_align_for_label): Update prototype. + 2011-05-10 Richard Guenther <rguenther@suse.de> * tree-ssa-forwprop.c (combine_conversions): Pattern-match diff --git a/gcc/config/rx/rx-protos.h b/gcc/config/rx/rx-protos.h index c43b398..72cb199 100644 --- a/gcc/config/rx/rx-protos.h +++ b/gcc/config/rx/rx-protos.h @@ -21,12 +21,12 @@ #ifndef GCC_RX_PROTOS_H #define GCC_RX_PROTOS_H -extern int rx_align_for_label (void); extern void rx_expand_prologue (void); extern int rx_initial_elimination_offset (int, int); #ifdef RTX_CODE extern int rx_adjust_insn_length (rtx, int); +extern int rx_align_for_label (rtx, int); extern void rx_emit_stack_popm (rtx *, bool); extern void rx_emit_stack_pushm (rtx *); extern void rx_expand_epilogue (bool); @@ -35,7 +35,7 @@ extern bool rx_legitimate_constant_p (enum machine_mode, rtx); extern bool rx_is_restricted_memory_address (rtx, enum machine_mode); extern bool rx_match_ccmode (rtx, enum machine_mode); -extern void rx_notice_update_cc (rtx body, rtx insn); +extern void rx_notice_update_cc (rtx, rtx); extern void rx_split_cbranch (enum machine_mode, enum rtx_code, rtx, rtx, rtx); extern enum machine_mode rx_select_cc_mode (enum rtx_code, rtx, rtx); diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c index ccf1a5d..30886dc 100644 --- a/gcc/config/rx/rx.c +++ b/gcc/config/rx/rx.c @@ -2776,8 +2776,15 @@ rx_match_ccmode (rtx insn, enum machine_mode cc_mode) } int -rx_align_for_label (void) +rx_align_for_label (rtx lab, int uses_threshold) { + /* This is a simple heuristic to guess when an alignment would not be useful + because the delay due to the inserted NOPs would be greater than the delay + due to the misaligned branch. If uses_threshold is zero then the alignment + is always useful. */ + if (LABEL_NUSES (lab) < uses_threshold) + return 0; + return optimize_size ? 1 : 3; } diff --git a/gcc/config/rx/rx.h b/gcc/config/rx/rx.h index 742d83f..1780867 100644 --- a/gcc/config/rx/rx.h +++ b/gcc/config/rx/rx.h @@ -397,7 +397,13 @@ typedef unsigned int CUMULATIVE_ARGS; #undef USER_LABEL_PREFIX #define USER_LABEL_PREFIX "_" -#define LABEL_ALIGN_AFTER_BARRIER(x) rx_align_for_label () +/* Compute the alignment needed for label X in various situations. + If the user has specified an alignment then honour that, otherwise + use rx_align_for_label. */ +#define JUMP_ALIGN(x) (align_jumps ? align_jumps : rx_align_for_label (x, 0)) +#define LABEL_ALIGN(x) (align_labels ? align_labels : rx_align_for_label (x, 3)) +#define LOOP_ALIGN(x) (align_loops ? align_loops : rx_align_for_label (x, 2)) +#define LABEL_ALIGN_AFTER_BARRIER(x) rx_align_for_label (x, 0) #define ASM_OUTPUT_MAX_SKIP_ALIGN(STREAM, LOG, MAX_SKIP) \ do \ |