qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

commit da9a30bd77fd2fd49d801e23b816e7310c2004a8
parent 2c2db15995ce6c0f362d65e174d5a1b933057b80
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date:   Mon, 27 Feb 2017 09:38:02 -0500

cosmetic fixes

Diffstat:
Mcopy.c | 23++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/copy.c b/copy.c @@ -63,30 +63,23 @@ iscopy(Ins *i, Ref r, Fn *fn) [Wsw] = BIT(Wsw), [Wuw] = BIT(Wuw), }; - int k, w; + bits b; Tmp *t; if (i->op == Ocopy) return 1; - if (!isext(i->op)) + if (!isext(i->op) || rtype(r) != RTmp) return 0; if (i->op == Oextsw || i->op == Oextuw) if (i->cls == Kw) return 1; - if (rtype(r) == RTmp) { - t = &fn->tmp[r.val]; - w = t->width; - k = t->cls; - 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 */ + + t = &fn->tmp[r.val]; + assert(KBASE(t->cls) == 0); + if (i->cls == Kl && t->cls == Kw) 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