summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn van Groningen2006-03-14 10:48:23 +0000
committerJohn van Groningen2006-03-14 10:48:23 +0000
commit311220f83cf2486092013470bac4dd519a8089bd (patch)
tree5225a824595031cc97e4e56dbc668c6ba008f275
parentadd generating instruction for converting real to int (diff)
improve computation of used registers for reading from arrays, prevents
incrementing counters too soon in many small loops using one array
-rw-r--r--cgcalc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cgcalc.c b/cgcalc.c
index 6287cf2..9fe8490 100644
--- a/cgcalc.c
+++ b/cgcalc.c
@@ -598,7 +598,6 @@ static void calculate_dyadic_non_commutative_operator (INSTRUCTION_GRAPH graph)
graph->i_dregs=i_dregs;
graph->order_alterable=graph->node_count<=1;
- return;
}
static void calculate_dyadic_non_commutative_data_operator (INSTRUCTION_GRAPH graph)
@@ -1541,8 +1540,11 @@ static void calculate_store_x_operator (INSTRUCTION_GRAPH graph)
if (graph_1_before_reorder->order_mode==R_DREGISTER)
i_dregs-=graph_1_before_reorder->order_alterable;
- else
+ else {
i_aregs-=graph_1_before_reorder->order_alterable;
+ if (graph_1_before_reorder->order_mode==R_MEMORY && u_dregs<i_dregs+1)
+ u_dregs=i_dregs+1;
+ }
if (graph_3_before_reorder!=NULL){
if (graph_3_before_reorder->order_mode==R_DREGISTER)