(TARGET_ASM_LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Change to hook.
(TARGET_ASM_LOOP_ALIGN_MAX_SKIP): Likewise.
(TARGET_ASM_LABEL_ALIGN_MAX_SKIP): Likewise.
* doc/tm.texi: Regenerate.
* targhooks.h (default_label_align_after_barrier_max_skip,
default_loop_align_max_skip, default_label_align_max_skip,
default_jump_align_max_skip): Declare.
* target.def (label_align_after_barrier_max_skip): New.
(loop_align_max_skip): New.
(label_align_max_skip): New.
(jump_align_max_skip): New.
* system.h (poison): Add those macros to the list.
* final.c (LABEL_ALIGN_MAX_SKIP): Remove.
(LOOP_ALIGN_MAX_SKIP): Remove.
(LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Remove.
(JUMP_ALIGN_MAX_SKIP): Remove.
(default_label_align_after_barrier_max_skip): New.
(default_loop_align_max_skip): New.
(default_label_align_max_skip): New.
(default_jump_align_max_skip): New.
(compute_alignments): Use the new hooks.
(shorten_branches): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165707
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-10-19 DJ Delorie <dj@redhat.com>
+
+ * doc/tm.texi.in (TARGET_ASM_JUMP_ALIGN_MAX_SKIP): New.
+ (TARGET_ASM_LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Change to hook.
+ (TARGET_ASM_LOOP_ALIGN_MAX_SKIP): Likewise.
+ (TARGET_ASM_LABEL_ALIGN_MAX_SKIP): Likewise.
+ * doc/tm.texi: Regenerate.
+ * targhooks.h (default_label_align_after_barrier_max_skip,
+ default_loop_align_max_skip, default_label_align_max_skip,
+ default_jump_align_max_skip): Declare.
+ * target.def (label_align_after_barrier_max_skip): New.
+ (loop_align_max_skip): New.
+ (label_align_max_skip): New.
+ (jump_align_max_skip): New.
+ * system.h (poison): Add those macros to the list.
+ * final.c (LABEL_ALIGN_MAX_SKIP): Remove.
+ (LOOP_ALIGN_MAX_SKIP): Remove.
+ (LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Remove.
+ (JUMP_ALIGN_MAX_SKIP): Remove.
+ (default_label_align_after_barrier_max_skip): New.
+ (default_loop_align_max_skip): New.
+ (default_label_align_max_skip): New.
+ (default_jump_align_max_skip): New.
+ (compute_alignments): Use the new hooks.
+ (shorten_branches): Likewise.
+
2010-10-19 Richard Henderson <rth@redhat.com>
* config/i386/i386.c (bdesc_multi_arg): Use fma4i_fmadd_<mode>.
selection in @var{align_jumps} in a @code{JUMP_ALIGN} implementation.
@end defmac
+@deftypefn {Target Hook} int TARGET_ASM_JUMP_ALIGN_MAX_SKIP (rtx @var{label})
+The maximum number of bytes to skip before @var{label} when applying
+@code{JUMP_ALIGN}. This works only if
+@code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
+@end deftypefn
+
@defmac LABEL_ALIGN_AFTER_BARRIER (@var{label})
The alignment (log base 2) to put in front of @var{label}, which follows
a @code{BARRIER}.
define the macro.
@end defmac
-@defmac LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP
-The maximum number of bytes to skip when applying
+@deftypefn {Target Hook} int TARGET_ASM_LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP (rtx @var{label})
+The maximum number of bytes to skip before @var{label} when applying
@code{LABEL_ALIGN_AFTER_BARRIER}. This works only if
@code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
-@end defmac
+@end deftypefn
@defmac LOOP_ALIGN (@var{label})
The alignment (log base 2) to put in front of @var{label}, which follows
selection in @code{align_loops} in a @code{LOOP_ALIGN} implementation.
@end defmac
-@defmac LOOP_ALIGN_MAX_SKIP
-The maximum number of bytes to skip when applying @code{LOOP_ALIGN}.
-This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
-@end defmac
+@deftypefn {Target Hook} int TARGET_ASM_LOOP_ALIGN_MAX_SKIP (rtx @var{label})
+The maximum number of bytes to skip when applying @code{LOOP_ALIGN} to
+@var{label}. This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} is
+defined.
+@end deftypefn
@defmac LABEL_ALIGN (@var{label})
The alignment (log base 2) to put in front of @var{label}.
selection in @code{align_labels} in a @code{LABEL_ALIGN} implementation.
@end defmac
-@defmac LABEL_ALIGN_MAX_SKIP
-The maximum number of bytes to skip when applying @code{LABEL_ALIGN}.
-This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
-@end defmac
+@deftypefn {Target Hook} int TARGET_ASM_LABEL_ALIGN_MAX_SKIP (rtx @var{label})
+The maximum number of bytes to skip when applying @code{LABEL_ALIGN}
+to @var{label}. This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN}
+is defined.
+@end deftypefn
@defmac ASM_OUTPUT_SKIP (@var{stream}, @var{nbytes})
A C statement to output to the stdio stream @var{stream} an assembler
selection in @var{align_jumps} in a @code{JUMP_ALIGN} implementation.
@end defmac
+@hook TARGET_ASM_JUMP_ALIGN_MAX_SKIP
+The maximum number of bytes to skip before @var{label} when applying
+@code{JUMP_ALIGN}. This works only if
+@code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
+@end deftypefn
+
@defmac LABEL_ALIGN_AFTER_BARRIER (@var{label})
The alignment (log base 2) to put in front of @var{label}, which follows
a @code{BARRIER}.
define the macro.
@end defmac
-@defmac LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP
-The maximum number of bytes to skip when applying
+@hook TARGET_ASM_LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP
+The maximum number of bytes to skip before @var{label} when applying
@code{LABEL_ALIGN_AFTER_BARRIER}. This works only if
@code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
-@end defmac
+@end deftypefn
@defmac LOOP_ALIGN (@var{label})
The alignment (log base 2) to put in front of @var{label}, which follows
selection in @code{align_loops} in a @code{LOOP_ALIGN} implementation.
@end defmac
-@defmac LOOP_ALIGN_MAX_SKIP
-The maximum number of bytes to skip when applying @code{LOOP_ALIGN}.
-This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
-@end defmac
+@hook TARGET_ASM_LOOP_ALIGN_MAX_SKIP
+The maximum number of bytes to skip when applying @code{LOOP_ALIGN} to
+@var{label}. This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} is
+defined.
+@end deftypefn
@defmac LABEL_ALIGN (@var{label})
The alignment (log base 2) to put in front of @var{label}.
selection in @code{align_labels} in a @code{LABEL_ALIGN} implementation.
@end defmac
-@defmac LABEL_ALIGN_MAX_SKIP
-The maximum number of bytes to skip when applying @code{LABEL_ALIGN}.
-This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
-@end defmac
+@hook TARGET_ASM_LABEL_ALIGN_MAX_SKIP
+The maximum number of bytes to skip when applying @code{LABEL_ALIGN}
+to @var{label}. This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN}
+is defined.
+@end deftypefn
@defmac ASM_OUTPUT_SKIP (@var{stream}, @var{nbytes})
A C statement to output to the stdio stream @var{stream} an assembler
#include "intl.h"
#include "basic-block.h"
#include "target.h"
+#include "targhooks.h"
#include "debug.h"
#include "expr.h"
#include "cfglayout.h"
#define LABEL_ALIGN(LABEL) align_labels_log
#endif
-#ifndef LABEL_ALIGN_MAX_SKIP
-#define LABEL_ALIGN_MAX_SKIP align_labels_max_skip
-#endif
-
#ifndef LOOP_ALIGN
#define LOOP_ALIGN(LABEL) align_loops_log
#endif
-#ifndef LOOP_ALIGN_MAX_SKIP
-#define LOOP_ALIGN_MAX_SKIP align_loops_max_skip
-#endif
-
#ifndef LABEL_ALIGN_AFTER_BARRIER
#define LABEL_ALIGN_AFTER_BARRIER(LABEL) 0
#endif
-#ifndef LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP
-#define LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP 0
-#endif
-
#ifndef JUMP_ALIGN
#define JUMP_ALIGN(LABEL) align_jumps_log
#endif
-#ifndef JUMP_ALIGN_MAX_SKIP
-#define JUMP_ALIGN_MAX_SKIP align_jumps_max_skip
-#endif
+int
+default_label_align_after_barrier_max_skip (rtx insn ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+int
+default_loop_align_max_skip (rtx insn ATTRIBUTE_UNUSED)
+{
+ return align_loops_max_skip;
+}
+
+int
+default_label_align_max_skip (rtx insn ATTRIBUTE_UNUSED)
+{
+ return align_labels_max_skip;
+}
+
+int
+default_jump_align_max_skip (rtx insn ATTRIBUTE_UNUSED)
+{
+ return align_jumps_max_skip;
+}
#ifndef ADDR_VEC_ALIGN
static int
continue;
}
max_log = LABEL_ALIGN (label);
- max_skip = LABEL_ALIGN_MAX_SKIP;
+ max_skip = targetm.asm_out.label_align_max_skip (label);
FOR_EACH_EDGE (e, ei, bb->preds)
{
if (max_log < log)
{
max_log = log;
- max_skip = JUMP_ALIGN_MAX_SKIP;
+ max_skip = targetm.asm_out.jump_align_max_skip (label);
}
}
/* In case block is frequent and reached mostly by non-fallthru edge,
if (max_log < log)
{
max_log = log;
- max_skip = LOOP_ALIGN_MAX_SKIP;
+ max_skip = targetm.asm_out.loop_align_max_skip (label);
}
}
LABEL_TO_ALIGNMENT (label) = max_log;
if (max_log < log)
{
max_log = log;
- max_skip = LABEL_ALIGN_MAX_SKIP;
+ max_skip = targetm.asm_out.label_align_max_skip (insn);
}
}
/* ADDR_VECs only take room if read-only data goes into the text
if (max_log < log)
{
max_log = log;
- max_skip = LABEL_ALIGN_MAX_SKIP;
+ max_skip = targetm.asm_out.label_align_max_skip (insn);
}
}
LABEL_TO_ALIGNMENT (insn) = max_log;
if (max_log < log)
{
max_log = log;
- max_skip = LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP;
+ max_skip = targetm.asm_out.label_align_after_barrier_max_skip (label);
}
break;
}
TRAMPOLINE_ADJUST_ADDRESS STATIC_CHAIN STATIC_CHAIN_INCOMING \
RETURN_POPS_ARGS UNITS_PER_SIMD_WORD OVERRIDE_OPTIONS \
OPTIMIZATION_OPTIONS CLASS_LIKELY_SPILLED_P \
- USING_SJLJ_EXCEPTIONS TARGET_UNWIND_INFO
+ USING_SJLJ_EXCEPTIONS TARGET_UNWIND_INFO \
+ LABEL_ALIGN_MAX_SKIP LOOP_ALIGN_MAX_SKIP \
+ LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP JUMP_ALIGN_MAX_SKIP
/* Other obsolete target macros, or macros that used to be in target
headers and were not used, and may be obsolete or may never have
DEFHOOKPOD (aligned_op, "*", struct asm_int_op, TARGET_ASM_ALIGNED_INT_OP)
DEFHOOKPOD (unaligned_op, "*", struct asm_int_op, TARGET_ASM_UNALIGNED_INT_OP)
+/* The maximum number of bytes to skip when applying
+ LABEL_ALIGN_AFTER_BARRIER. */
+DEFHOOK
+(label_align_after_barrier_max_skip,
+ "",
+ int, (rtx label),
+ default_label_align_after_barrier_max_skip)
+
+/* The maximum number of bytes to skip when applying
+ LOOP_ALIGN. */
+DEFHOOK
+(loop_align_max_skip,
+ "",
+ int, (rtx label),
+ default_loop_align_max_skip)
+
+/* The maximum number of bytes to skip when applying
+ LABEL_ALIGN. */
+DEFHOOK
+(label_align_max_skip,
+ "",
+ int, (rtx label),
+ default_label_align_max_skip)
+
+/* The maximum number of bytes to skip when applying
+ JUMP_ALIGN. */
+DEFHOOK
+(jump_align_max_skip,
+ "",
+ int, (rtx label),
+ default_jump_align_max_skip)
+
/* Try to output the assembler code for an integer object whose
value is given by X. SIZE is the size of the object in bytes and
ALIGNED_P indicates whether it is aligned. Return true if
extern enum unwind_info_type default_except_unwind_info (void);
extern enum unwind_info_type dwarf2_except_unwind_info (void);
extern enum unwind_info_type sjlj_except_unwind_info (void);
+
+extern int default_label_align_after_barrier_max_skip (rtx);
+extern int default_loop_align_max_skip (rtx);
+extern int default_label_align_max_skip (rtx);
+extern int default_jump_align_max_skip (rtx);