From 0f348202d1282d2b38c3a84547693a7a82b25724 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Mon, 5 Jul 2021 22:54:52 -0700 Subject: qbe: Style --- qbe.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qbe.c b/qbe.c index d108479..c231095 100644 --- a/qbe.c +++ b/qbe.c @@ -329,6 +329,7 @@ funcstore(struct func *f, struct type *t, enum typequal tq, struct lvalue lval, enum typeprop tp; unsigned long long mask; struct qbetype qt; + int bits; if (tq & QUALVOLATILE) error(&tok.loc, "volatile store is not yet supported"); @@ -349,8 +350,9 @@ funcstore(struct func *f, struct type *t, enum typequal tq, struct lvalue lval, default: assert(tp & PROPSCALAR); qt = qbetype(t); - if (lval.bits.before || lval.bits.after) { - mask = 0xffffffffffffffffu >> lval.bits.after + 64 - t->size * 8 ^ (1 << lval.bits.before) - 1; + bits = lval.bits.before + lval.bits.after; + if (bits) { + mask = 0xffffffffffffffffu >> 64 - t->size * 8 + bits << lval.bits.before; v = funcinst(f, ISHL, qt.base, v, mkintconst(lval.bits.before)); r = funcbits(f, t, v, lval.bits); v = funcinst(f, IAND, qt.base, v, mkintconst(mask)); -- cgit v1.2.3