diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-04-20 09:47:38 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-04-20 09:56:29 -0400 |
commit | 657c3fa66b5700a1fde89fbd8c92cd9dc56eea3b (patch) | |
tree | 3a26376d76d86df68f31abeadcc91b040a9bd921 /mem.c | |
parent | b7debc4e7f5d50a89214421a704864a30a291cdc (diff) | |
download | roux-657c3fa66b5700a1fde89fbd8c92cd9dc56eea3b.tar.gz |
match jumps/ops with il text
Diffstat (limited to 'mem.c')
-rw-r--r-- | mem.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/mem.c b/mem.c index c59d7fe..ea0bef7 100644 --- a/mem.c +++ b/mem.c @@ -4,10 +4,10 @@ static int loadsz(Ins *l) { switch (l->op) { - case OLoadsb: case OLoadub: return 1; - case OLoadsh: case OLoaduh: return 2; - case OLoadsw: case OLoaduw: return 4; - case OLoad: return KWIDE(l->cls) ? 8 : 4; + case Oloadsb: case Oloadub: return 1; + case Oloadsh: case Oloaduh: return 2; + case Oloadsw: case Oloaduw: return 4; + case Oload: return KWIDE(l->cls) ? 8 : 4; } die("unreachable"); } @@ -16,10 +16,10 @@ static int storesz(Ins *s) { switch (s->op) { - case OStoreb: return 1; - case OStoreh: return 2; - case OStorew: case OStores: return 4; - case OStorel: case OStored: return 8; + case Ostoreb: return 1; + case Ostoreh: return 2; + case Ostorew: case Ostores: return 4; + case Ostorel: case Ostored: return 8; } die("unreachable"); } @@ -38,7 +38,7 @@ memopt(Fn *fn) /* promote uniform stack slots to temporaries */ b = fn->start; for (i=b->ins; i-b->ins < b->nins; i++) { - if (OAlloc > i->op || i->op > OAlloc1) + if (Oalloc > i->op || i->op > Oalloc1) continue; /* specific to NAlign == 3 */ assert(rtype(i->to) == RTmp); @@ -67,14 +67,14 @@ memopt(Fn *fn) goto Skip; } /* get rid of the alloc and replace uses */ - *i = (Ins){.op = ONop}; + *i = (Ins){.op = Onop}; t->ndef--; ue = &t->use[t->nuse]; for (u=t->use; u!=ue; u++) { l = u->u.ins; if (isstore(l->op)) { l->cls = k; - l->op = OCopy; + l->op = Ocopy; l->to = l->arg[1]; l->arg[1] = R; t->nuse--; @@ -86,16 +86,16 @@ memopt(Fn *fn) /* try to turn loads into copies so we * can eliminate them later */ switch(l->op) { - case OLoad: - case OLoadsw: - case OLoaduw: + case Oload: + case Oloadsw: + case Oloaduw: if (KBASE(k) != KBASE(l->cls)) - l->op = OCast; + l->op = Ocast; else - l->op = OCopy; + l->op = Ocopy; break; default: - l->op = OExtsb + (l->op - OLoadsb); + l->op = Oextsb + (l->op - Oloadsb); break; } } |