summaryrefslogtreecommitdiff
path: root/gcc/config/ia64/ia64.c
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-15 11:02:20 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-15 11:02:20 +0000
commit5c74c9e4ecbf72fbd32c987460886b8cf50ddda1 (patch)
treefd9ec527045a1cd9c48f7473376d2429b748a3d0 /gcc/config/ia64/ia64.c
parent15150de6bd6a40d4ac0cc15743190d74d685ea79 (diff)
downloadgcc-5c74c9e4ecbf72fbd32c987460886b8cf50ddda1.tar.gz
Fix scheduling abort; stop bits must have selector in range 1..3.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40497 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/ia64/ia64.c')
-rw-r--r--gcc/config/ia64/ia64.c39
1 files changed, 32 insertions, 7 deletions
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index fb8a5847ec2..03f977a95d4 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -5650,6 +5650,20 @@ schedule_stop (dump)
dump_current_packet (dump);
}
+/* If necessary, perform one or two rotations on the scheduling state.
+ This should only be called if we are starting a new cycle. */
+
+static void
+maybe_rotate (dump)
+ FILE *dump;
+{
+ if (sched_data.cur == 6)
+ rotate_two_bundles (dump);
+ else if (sched_data.cur >= 3)
+ rotate_one_bundle (dump);
+ sched_data.first_slot = sched_data.cur;
+}
+
/* We are about to being issuing insns for this clock cycle.
Override the default sort algorithm to better slot instructions. */
@@ -5673,13 +5687,7 @@ ia64_sched_reorder (dump, sched_verbose, ready, pn_ready, reorder_type)
}
if (reorder_type == 0)
- {
- if (sched_data.cur == 6)
- rotate_two_bundles (sched_verbose ? dump : NULL);
- else if (sched_data.cur >= 3)
- rotate_one_bundle (sched_verbose ? dump : NULL);
- sched_data.first_slot = sched_data.cur;
- }
+ maybe_rotate (sched_verbose ? dump : NULL);
/* First, move all USEs, CLOBBERs and other crud out of the way. */
highest = ready[n_ready - 1];
@@ -5697,12 +5705,17 @@ ia64_sched_reorder (dump, sched_verbose, ready, pn_ready, reorder_type)
{
schedule_stop (sched_verbose ? dump : NULL);
sched_data.last_was_stop = 1;
+ maybe_rotate (sched_verbose ? dump : NULL);
+ if (dump)
+ fprintf (dump, "// UNKNOWN insn; group barrier needed.\n");
}
else if (GET_CODE (PATTERN (insn)) == ASM_INPUT
|| asm_noperands (PATTERN (insn)) >= 0)
{
/* It must be an asm of some kind. */
cycle_end_fill_slots (sched_verbose ? dump : NULL);
+ if (dump)
+ fprintf (dump, "// UNKNOWN (asm).\n");
}
return 1;
}
@@ -5728,6 +5741,7 @@ ia64_sched_reorder (dump, sched_verbose, ready, pn_ready, reorder_type)
{
schedule_stop (sched_verbose ? dump : NULL);
sched_data.last_was_stop = 1;
+ maybe_rotate (sched_verbose ? dump : NULL);
if (reorder_type == 1)
return 0;
}
@@ -6082,6 +6096,17 @@ ia64_emit_nops ()
if (b && INSN_P (insn))
{
t = ia64_safe_type (insn);
+ if (asm_noperands (PATTERN (insn)) >= 0
+ || GET_CODE (PATTERN (insn)) == ASM_INPUT)
+ {
+ while (bundle_pos < 3)
+ {
+ emit_insn_before (gen_nop_type (b->t[bundle_pos]), insn);
+ bundle_pos++;
+ }
+ continue;
+ }
+
if (t == TYPE_UNKNOWN)
continue;
while (bundle_pos < 3)