diff options
author | Michael Forney <mforney@mforney.org> | 2019-02-13 15:29:54 -0800 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-02-13 19:42:25 -0800 |
commit | 8040e25abcad4b106514315a53f4723e3a387959 (patch) | |
tree | fdc1ca82cd666bca9d05036181a4ff1efd776b00 /qbe.c | |
parent | a0c394bdd0f0c554f504ee8119e8304551653562 (diff) |
Make basic store independent of ABI
Diffstat (limited to 'qbe.c')
-rw-r--r-- | qbe.c | 18 |
1 files changed, 6 insertions, 12 deletions
@@ -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: |