cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit 8040e25abcad4b106514315a53f4723e3a387959
parent a0c394bdd0f0c554f504ee8119e8304551653562
Author: Michael Forney <mforney@mforney.org>
Date:   Wed, 13 Feb 2019 15:29:54 -0800

Make basic store independent of ABI

Diffstat:
Mqbe.c | 18++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/qbe.c b/qbe.c @@ -243,19 +243,13 @@ funcstore(struct function *f, struct type *t, struct value *addr, struct value * error(&tok.loc, "cannot store to 'const' object"); switch (t->kind) { case TYPEBASIC: - switch (t->basic.kind) { - case BASICBOOL: - case BASICCHAR: op = ISTOREB; break; - case BASICSHORT: op = ISTOREH; break; - case BASICINT: op = ISTOREW; break; - case BASICLONG: op = ISTOREL; break; - case BASICLONGLONG: op = ISTOREL; break; - case BASICFLOAT: op = ISTORES; break; - case BASICDOUBLE: op = ISTORED; break; - case BASICLONGDOUBLE: - fatal("'long double' store is not yet supported"); + switch (t->size) { + case 1: op = ISTOREB; break; + case 2: op = ISTOREH; break; + case 4: op = typeprop(t) & PROPFLOAT ? ISTORES : ISTOREW; break; + case 8: op = typeprop(t) & PROPFLOAT ? ISTORED : ISTOREL; break; default: - fatal("internal error; unknown basic type %d", t->basic.kind); + fatal("internal error; unimplemented store"); } break; case TYPEPOINTER: