[inferno-npe] push by noah.evans - Added nosched to 5l, this allows you to turn off branch optimization f... on 2010-11-08 17:47 GMT

1 view
Skip to first unread message

infer...@googlecode.com

unread,
Nov 8, 2010, 12:48:01 PM11/8/10
to inferno-n...@googlegroups.com
Revision: 4d718d2213
Author: n...@mori.local
Date: Mon Nov 8 09:46:52 2010
Log: Added nosched to 5l, this allows you to turn off branch optimization
for certain tasks where it is harmful(eg. branching past static data in
executables, trace function calls in the trace device). --npe
http://code.google.com/p/inferno-npe/source/detail?r=4d718d2213

Modified:
/utils/5l/l.h
/utils/5l/pass.c

=======================================
--- /utils/5l/l.h Fri Dec 22 13:39:35 2006
+++ /utils/5l/l.h Mon Nov 8 09:46:52 2010
@@ -213,6 +213,7 @@
FOLL = 1<<0,
LABEL = 1<<1,
LEAF = 1<<2,
+ NOSCHED = 1<<7,

BIG = (1<<12)-4,
STRINGSZ = 200,
=======================================
--- /utils/5l/pass.c Fri Dec 22 13:39:35 2006
+++ /utils/5l/pass.c Mon Nov 8 09:46:52 2010
@@ -131,7 +131,7 @@
int i;

for(i=0; i<20; i++) {
- if(p == P || p->as != AB)
+ if(p == P || p->as != AB || p->mark & NOSCHED)
return p;
p = p->cond;
}
@@ -193,6 +193,17 @@
curtext = p;
if(a == AB) {
q = p->cond;
+ if((p->mark&NOSCHED) || q && (q->mark&NOSCHED)){
+ p->mark |= FOLL;
+ lastp->link = p;
+ lastp = p;
+ p = p->link;
+ xfol(p);
+ p = q;
+ if(p && !(p->mark & FOLL))
+ goto loop;
+ return;
+ }
if(q != P) {
p->mark |= FOLL;
p = q;
@@ -202,7 +213,7 @@
}
if(p->mark & FOLL) {
for(i=0,q=p; i<4; i++,q=q->link) {
- if(q == lastp)
+ if(q == lastp || (q->mark&NOSCHED))
break;
a = q->as;
if(a == ANOP) {
@@ -257,6 +268,10 @@
lastp->link = p;
lastp = p;
if(a == AB || (a == ARET && p->scond == 14) || a == ARFE){
+ if(p->mark & NOSCHED){
+ p = p->link;
+ goto loop;
+ }
return;
}
if(p->cond != P)

Reply all
Reply to author
Forward
0 new messages