summaryrefslogtreecommitdiff
path: root/gcc/config/s390/s390.c
diff options
context:
space:
mode:
authorhpenner <hpenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-21 11:41:43 +0000
committerhpenner <hpenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-21 11:41:43 +0000
commit369293ed9c65de0c519c829159ead40bd141af1d (patch)
tree3cb7725adaf6bb62f615835bda0633155edc6fda /gcc/config/s390/s390.c
parent163275ab6dce5a6c424324c8e979ac682f7c458e (diff)
downloadgcc-369293ed9c65de0c519c829159ead40bd141af1d.tar.gz
2001-09-21 Hartmut Penner <hpenner@de.ibm.com>
* s390.md: Changed attributes for scheduling. * s390.c: (s390_adjust_cost, s390_adjust_priority) Changed scheduling git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45725 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/s390/s390.c')
-rw-r--r--gcc/config/s390/s390.c59
1 files changed, 46 insertions, 13 deletions
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 425c98e1781..e4bc735209e 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -46,6 +46,7 @@ Boston, MA 02111-1307, USA. */
static int s390_adjust_cost PARAMS ((rtx, rtx, rtx, int));
+static int s390_adjust_priority PARAMS ((rtx, int));
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE s390_function_prologue
@@ -62,6 +63,9 @@ static int s390_adjust_cost PARAMS ((rtx, rtx, rtx, int));
#undef TARGET_SCHED_ADJUST_COST
#define TARGET_SCHED_ADJUST_COST s390_adjust_cost
+#undef TARGET_SCHED_ADJUST_PRIORITY
+#define TARGET_SCHED_ADJUST_PRIORITY s390_adjust_priority
+
struct gcc_target targetm = TARGET_INITIALIZER;
extern int reload_completed;
@@ -1587,7 +1591,9 @@ addr_generation_dependency_p (dep_rtx, insn)
Data dependencies are all handled without delay. However, if a
register is modified and subsequently used as base or index
register of a memory reference, at least 4 cycles need to pass
- between setting and using the register to avoid pipeline stalls. */
+ between setting and using the register to avoid pipeline stalls.
+ A exception is the LA instruction. A address generated by LA can
+ be used by introducing only a one cycle stall on the pipeline. */
static int
s390_adjust_cost (insn, link, dep_insn, cost)
@@ -1610,19 +1616,13 @@ s390_adjust_cost (insn, link, dep_insn, cost)
if (recog_memoized (insn) < 0 || recog_memoized (dep_insn) < 0)
return cost;
- /* If cost equal 1 nothing needs to be checked. */
-
- if (cost == 1)
- {
- return cost;
- }
-
dep_rtx = PATTERN (dep_insn);
if (GET_CODE (dep_rtx) == SET)
{
if (addr_generation_dependency_p (dep_rtx, insn))
{
+ cost += (get_attr_type (dep_insn) == TYPE_LA) ? 1 : 4;
if (DEBUG_SCHED)
{
fprintf (stderr, "\n\nAddress dependency detected: cost %d\n",
@@ -1630,10 +1630,8 @@ s390_adjust_cost (insn, link, dep_insn, cost)
debug_rtx (dep_insn);
debug_rtx (insn);
}
- return cost;
}
}
-
else if (GET_CODE (dep_rtx) == PARALLEL)
{
for (i = 0; i < XVECLEN (dep_rtx, 0); i++)
@@ -1641,6 +1639,7 @@ s390_adjust_cost (insn, link, dep_insn, cost)
if (addr_generation_dependency_p (XVECEXP (dep_rtx, 0, i),
insn))
{
+ cost += (get_attr_type (dep_insn) == TYPE_LA) ? 1 : 4;
if (DEBUG_SCHED)
{
fprintf (stderr, "\n\nAddress dependency detected: cost %d\n"
@@ -1648,15 +1647,49 @@ s390_adjust_cost (insn, link, dep_insn, cost)
debug_rtx (dep_insn);
debug_rtx (insn);
}
- return cost;
}
}
}
- /* default cost. */
- return 1;
+ return cost;
+}
+
+
+/* A C statement (sans semicolon) to update the integer scheduling priority
+ INSN_PRIORITY (INSN). Reduce the priority to execute the INSN earlier,
+ increase the priority to execute INSN later. Do not define this macro if
+ you do not need to adjust the scheduling priorities of insns.
+
+ A LA instruction maybe scheduled later, since the pipeline bypasses the
+ calculated value. */
+
+static int
+s390_adjust_priority (insn, priority)
+ rtx insn ATTRIBUTE_UNUSED;
+ int priority;
+{
+ if (! INSN_P (insn))
+ return priority;
+
+ if (GET_CODE (PATTERN (insn)) == USE
+ || GET_CODE (PATTERN (insn)) == CLOBBER)
+ return priority;
+
+ switch (get_attr_type (insn))
+ {
+ default:
+ break;
+
+ case TYPE_LA:
+ if (priority >= 0 && priority < 0x01000000)
+ priority <<= 3;
+ break;
+ }
+
+ return priority;
}
+
/* Pool concept for Linux 390:
- Function prologue saves used register
- literal pool is dumped in prologue and jump across with bras