gcc/config/sh/sh.h original rev. 1.51
gcc/config/sh/sh.c original rev. 1.43 > Wed Feb 23 16:42:21 2000 J"orn Rennecke <amylaar@cygnus.co.uk> > > * sh.h (LOOP_ALIGN): If aligning loops, call sh_loop_align > to check for special cases. > * sh.c (sh_loop_align): Define.
This commit is contained in:
parent
16f8beb6c9
commit
373c220202
|
@ -2633,6 +2633,30 @@ barrier_align (barrier_or_label)
|
|||
return CACHE_LOG;
|
||||
}
|
||||
|
||||
/* If we are inside a phony loop, almost any kind of label can turn up as the
|
||||
first one in the loop. Aligning a braf label causes incorrect switch
|
||||
destination addresses; we can detect braf labels because they are
|
||||
followed by a BARRIER.
|
||||
Applying loop alignment to small constant or switch tables is a waste
|
||||
of space, so we suppress this too. */
|
||||
int
|
||||
sh_loop_align (label)
|
||||
rtx label;
|
||||
{
|
||||
rtx next = label;
|
||||
|
||||
do
|
||||
next = next_nonnote_insn (next);
|
||||
while (next && GET_CODE (next) == CODE_LABEL);
|
||||
|
||||
if (! next
|
||||
|| GET_RTX_CLASS (GET_CODE (next)) != 'i'
|
||||
|| GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC
|
||||
|| recog_memoized (next) == CODE_FOR_consttable_2)
|
||||
return 0;
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* Exported to toplev.c.
|
||||
|
||||
Do a final pass over the function, just before delayed branch
|
||||
|
|
|
@ -281,7 +281,7 @@ do { \
|
|||
barrier_align (LABEL_AFTER_BARRIER)
|
||||
|
||||
#define LOOP_ALIGN(A_LABEL) \
|
||||
((! optimize || TARGET_SMALLCODE) ? 0 : 2)
|
||||
((! optimize || TARGET_SMALLCODE) ? 0 : sh_loop_align (A_LABEL))
|
||||
|
||||
#define LABEL_ALIGN(A_LABEL) \
|
||||
( \
|
||||
|
|
|
@ -2756,6 +2756,30 @@ barrier_align (barrier_or_label)
|
|||
return CACHE_LOG;
|
||||
}
|
||||
|
||||
/* If we are inside a phony loop, almost any kind of label can turn up as the
|
||||
first one in the loop. Aligning a braf label causes incorrect switch
|
||||
destination addresses; we can detect braf labels because they are
|
||||
followed by a BARRIER.
|
||||
Applying loop alignment to small constant or switch tables is a waste
|
||||
of space, so we suppress this too. */
|
||||
int
|
||||
sh_loop_align (label)
|
||||
rtx label;
|
||||
{
|
||||
rtx next = label;
|
||||
|
||||
do
|
||||
next = next_nonnote_insn (next);
|
||||
while (next && GET_CODE (next) == CODE_LABEL);
|
||||
|
||||
if (! next
|
||||
|| GET_RTX_CLASS (GET_CODE (next)) != 'i'
|
||||
|| GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC
|
||||
|| recog_memoized (next) == CODE_FOR_consttable_2)
|
||||
return 0;
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* Exported to toplev.c.
|
||||
|
||||
Do a final pass over the function, just before delayed branch
|
||||
|
|
|
@ -354,7 +354,7 @@ do { \
|
|||
barrier_align (LABEL_AFTER_BARRIER)
|
||||
|
||||
#define LOOP_ALIGN(A_LABEL) \
|
||||
((! optimize || TARGET_HARWARD || TARGET_SMALLCODE) ? 0 : 2)
|
||||
((! optimize || TARGET_HARWARD || TARGET_SMALLCODE) ? 0 : sh_loop_align (A_LABEL))
|
||||
|
||||
#define LABEL_ALIGN(A_LABEL) \
|
||||
( \
|
||||
|
|
Loading…
Reference in New Issue