commit 74562a93debff6954f16a4c3434efa69d37c954b
parent f71206500c6693eed4393d72e8ab95d6a7e07d98
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date: Mon, 4 Apr 2016 14:45:49 -0400
reorder instructions
Diffstat:
3 files changed, 19 insertions(+), 24 deletions(-)
diff --git a/all.h b/all.h
@@ -232,28 +232,28 @@ enum Op {
OCmpd,
OCmpd1 = OCmpd + NFCmp-1,
- OStored,
- OStores,
- OStorel,
- OStorew,
- OStoreh,
OStoreb,
-#define isstore(o) (OStored <= o && o <= OStoreb)
- OLoadsw, /* needs to match OExt (mem.c) */
- OLoaduw,
+ OStoreh,
+ OStorew,
+ OStorel,
+ OStores,
+ OStored,
+#define isstore(o) (OStoreb <= o && o <= OStored)
+ OLoadsb, /* needs to match OExt (mem.c) */
+ OLoadub,
OLoadsh,
OLoaduh,
- OLoadsb,
- OLoadub,
+ OLoadsw,
+ OLoaduw,
OLoad,
-#define isload(o) (OLoadsw <= o && o <= OLoad)
- OExtsw,
- OExtuw,
- OExtsh,
- OExtuh,
+#define isload(o) (OLoadsb <= o && o <= OLoad)
OExtsb,
OExtub,
-#define isext(o) (OExtsw <= o && o <= OExtub)
+ OExtsh,
+ OExtuh,
+ OExtsw,
+ OExtuw,
+#define isext(o) (OExtsw <= o && o <= OExtuw)
OExts,
OTruncd,
diff --git a/mem.c b/mem.c
@@ -67,8 +67,8 @@ memopt(Fn *fn)
break;
default:
/* keep l->cls */
- a = l->op - OLoadsw;
- l->op = OExtsw + a;
+ a = l->op - OLoadsb;
+ l->op = OExtsb + a;
break;
}
}
diff --git a/spill.c b/spill.c
@@ -240,13 +240,8 @@ reloads(BSet *u, BSet *v)
static void
store(Ref r, int s)
{
- static int kstore[] = {
- [Kw] = OStorew, [Kl] = OStorel,
- [Ks] = OStores, [Kd] = OStored,
- };
-
if (s != -1)
- emit(kstore[tmp[r.val].cls], 0, R, r, SLOT(s));
+ emit(OStorew + tmp[r.val].cls, 0, R, r, SLOT(s));
}
static int