aboutsummaryrefslogtreecommitdiff
path: root/qbe.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-07-01 13:25:30 -0700
committerMichael Forney <mforney@mforney.org>2021-07-01 13:30:16 -0700
commit1647af781a279c070a1cd99fc8aeae1be9795084 (patch)
treefc55f3d89b065347e28117035629df4116aa4327 /qbe.c
parentb4f89ba90b6ca3233cc80aef9d42055266fac8df (diff)
qbe: Remove unnecessary distinction between loaduw and loadsw
We always store the result to a w temporary, so there is no difference. In fact, QBE provides loadw as an alias for loadsw precisely for this reason.
Diffstat (limited to 'qbe.c')
-rw-r--r--qbe.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/qbe.c b/qbe.c
index ffd33f5..bfa29e5 100644
--- a/qbe.c
+++ b/qbe.c
@@ -277,7 +277,7 @@ funccopy(struct func *f, struct value *dst, struct value *src, uint64_t size, in
switch (align) {
case 1: load = ILOADUB, store = ISTOREB; break;
case 2: load = ILOADUH, store = ISTOREH; break;
- case 4: load = ILOADUW, store = ISTOREW; break;
+ case 4: load = ILOADW, store = ISTOREW; break;
case 8: load = ILOADL, store = ISTOREL; break;
default:
fatal("internal error; invalid alignment %d", align);
@@ -324,7 +324,7 @@ funcstore(struct func *f, struct type *t, enum typequal tq, struct lvalue lval,
switch (t->size) {
case 1: loadop = ILOADUB; storeop = ISTOREB; break;
case 2: loadop = ILOADUH; storeop = ISTOREH; break;
- case 4: loadop = ILOADUW; storeop = tp & PROPFLOAT ? ISTORES : ISTOREW; break;
+ case 4: loadop = ILOADW; storeop = tp & PROPFLOAT ? ISTORES : ISTOREW; break;
case 8: loadop = ILOADL; storeop = tp & PROPFLOAT ? ISTORED : ISTOREL; break;
default:
fatal("internal error; unimplemented store");
@@ -366,7 +366,7 @@ funcload(struct func *f, struct type *t, struct lvalue lval)
switch (t->size) {
case 1: op = t->basic.issigned ? ILOADSB : ILOADUB; break;
case 2: op = t->basic.issigned ? ILOADSH : ILOADUH; break;
- case 4: op = t->prop & PROPFLOAT ? ILOADS : t->basic.issigned ? ILOADSW : ILOADUW; break;
+ case 4: op = t->prop & PROPFLOAT ? ILOADS : ILOADW; break;
case 8: op = t->prop & PROPFLOAT ? ILOADD : ILOADL; break;
default:
fatal("internal error; unimplemented load");