Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2244)

Unified Diff: src/cmd/5l/softfloat.c

Issue 870044: code review 870044: replace original float instruction with jump to make br... (Closed)
Patch Set: code review 870044: replace original float instruction with jump to make br... Created 14 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cmd/5l/softfloat.c
===================================================================
--- a/src/cmd/5l/softfloat.c
+++ b/src/cmd/5l/softfloat.c
@@ -8,7 +8,7 @@
void
softfloat()
{
- Prog *p, *prev, *psfloat;
+ Prog *p, *next, *psfloat;
Sym *symsfloat;
int wasfloat;
@@ -26,7 +26,6 @@
wasfloat = 0;
p = firstp;
- prev = P;
for(p = firstp; p != P; p = p->link) {
switch(p->as) {
case AMOVWD:
@@ -50,21 +49,23 @@
if (psfloat == P)
diag("floats used with _sfloat not defined");
if (!wasfloat) {
- if (prev == P)
- diag("float instruction without predecessor TEXT");
+ next = prg();
+ *next = *p;
+
// BL _sfloat(SB)
- prev = appendp(prev);
- prev->as = ABL;
- prev->to.type = D_BRANCH;
- prev->to.sym = symsfloat;
- prev->cond = psfloat;
-
+ *p = zprg;
+ p->link = next;
+ p->as = ABL;
+ p->to.type = D_BRANCH;
+ p->to.sym = symsfloat;
+ p->cond = psfloat;
+
+ p = next;
wasfloat = 1;
}
break;
default:
wasfloat = 0;
}
- prev = p;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b