cosmetic fixes

This commit is contained in:
Quentin Carbonneaux 2017-02-27 09:38:02 -05:00
parent 2c2db15995
commit da9a30bd77

21
copy.c
View file

@ -63,30 +63,23 @@ iscopy(Ins *i, Ref r, Fn *fn)
[Wsw] = BIT(Wsw), [Wsw] = BIT(Wsw),
[Wuw] = BIT(Wuw), [Wuw] = BIT(Wuw),
}; };
int k, w; bits b;
Tmp *t; Tmp *t;
if (i->op == Ocopy) if (i->op == Ocopy)
return 1; return 1;
if (!isext(i->op)) if (!isext(i->op) || rtype(r) != RTmp)
return 0; return 0;
if (i->op == Oextsw || i->op == Oextuw) if (i->op == Oextsw || i->op == Oextuw)
if (i->cls == Kw) if (i->cls == Kw)
return 1; return 1;
if (rtype(r) == RTmp) {
t = &fn->tmp[r.val]; t = &fn->tmp[r.val];
w = t->width; assert(KBASE(t->cls) == 0);
k = t->cls; if (i->cls == Kl && t->cls == Kw)
assert(k == Kw || k == Kl);
} else {
assert(rtype(r) == RCon);
w = WFull;
k = Kl;
}
if (i->cls == Kl && k == Kw)
/* not enough bits in r */
return 0; return 0;
return (BIT(Wsb + (i->op - Oextsb)) & extcpy[w]) != 0; b = extcpy[t->width];
return (BIT(Wsb + (i->op-Oextsb)) & b) != 0;
} }
static void static void