aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/sh
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@redhat.com>2002-11-18 12:46:48 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2002-11-18 12:46:48 +0000
commit3503150c4c5f3f6b5e7ba5d6430a419ff8d38fe2 (patch)
tree5ee06779c76524b019b4fcf122b1d4bad9b623f3 /gcc/config/sh
parent180bde4f78fdc3c07ed45f8219a130f94a214171 (diff)
downloadgcc-3503150c4c5f3f6b5e7ba5d6430a419ff8d38fe2.zip
gcc-3503150c4c5f3f6b5e7ba5d6430a419ff8d38fe2.tar.gz
gcc-3503150c4c5f3f6b5e7ba5d6430a419ff8d38fe2.tar.bz2
sh.c (pool_node): New field: part_of_sequence_p.
* config/sh/sh.c (pool_node): New field: part_of_sequence_p. (add_constant): Set it. (dump_table): Don't reorder a constant if part_of_sequence_p. (machine_dependent_reorg): Assume that float constants will stay in their original order if used as a sequence. From-SVN: r59213
Diffstat (limited to 'gcc/config/sh')
-rw-r--r--gcc/config/sh/sh.c39
1 files changed, 15 insertions, 24 deletions
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 1b3f92d..a26d92b 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -2258,6 +2258,10 @@ typedef struct
rtx label; /* Label of value. */
rtx wend; /* End of window. */
enum machine_mode mode; /* Mode of value. */
+
+ /* True if this constant is accessed as part of a post-increment
+ sequence. Note that HImode constants are never accessed in this way. */
+ bool part_of_sequence_p;
} pool_node;
/* The maximum number of constants that can fit into one pool, since
@@ -2331,12 +2335,16 @@ add_constant (x, mode, last_value)
/* Need a new one. */
pool_vector[pool_size].value = x;
if (last_value && rtx_equal_p (last_value, pool_vector[pool_size - 1].value))
- lab = 0;
+ {
+ lab = 0;
+ pool_vector[pool_size - 1].part_of_sequence_p = true;
+ }
else
lab = gen_label_rtx ();
pool_vector[pool_size].mode = mode;
pool_vector[pool_size].label = lab;
pool_vector[pool_size].wend = NULL_RTX;
+ pool_vector[pool_size].part_of_sequence_p = (lab == 0);
if (lab && pool_window_label)
{
newref = gen_rtx_LABEL_REF (VOIDmode, pool_window_label);
@@ -2409,7 +2417,7 @@ dump_table (scan)
break;
case SImode:
case SFmode:
- if (align_insn)
+ if (align_insn && !p->part_of_sequence_p)
{
for (lab = p->label; lab; lab = LABEL_REFS (lab))
emit_label_before (lab, align_insn);
@@ -3732,7 +3740,6 @@ machine_dependent_reorg (first)
behind. */
rtx barrier = find_barrier (num_mova, mova, insn);
rtx last_float_move, last_float = 0, *last_float_addr;
- int may_need_align = 1;
if (num_mova && ! mova_p (mova))
{
@@ -3790,27 +3797,11 @@ machine_dependent_reorg (first)
if (last_float
&& reg_set_between_p (r0_rtx, last_float_move, scan))
last_float = 0;
- if (TARGET_SHCOMPACT)
- {
- /* The first SFmode constant after a DFmode
- constant may be pulled before a sequence
- of DFmode constants, so the second SFmode
- needs a label, just in case. */
- if (GET_MODE_SIZE (mode) == 4)
- {
- if (last_float && may_need_align)
- last_float = 0;
- may_need_align = 0;
- }
- if (last_float
- && (GET_MODE_SIZE (GET_MODE (last_float))
- != GET_MODE_SIZE (mode)))
- {
- last_float = 0;
- if (GET_MODE_SIZE (mode) == 4)
- may_need_align = 1;
- }
- }
+ if (last_float
+ && TARGET_SHCOMPACT
+ && GET_MODE_SIZE (mode) != 4
+ && GET_MODE_SIZE (GET_MODE (last_float)) == 4)
+ last_float = 0;
lab = add_constant (src, mode, last_float);
if (lab)
emit_insn_before (gen_mova (lab), scan);