diff options
author | Quentin Carbonneaux <quentin@c9x.me> | 2017-04-08 21:09:59 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin@c9x.me> | 2017-04-08 21:57:05 -0400 |
commit | 96836855a55cd28f1449b4a58d1e5301669350c0 (patch) | |
tree | 3b0688d1b63f528d41edba87232e5469d95d08cb /amd64/sysv.c | |
parent | 49a4593c335126ba279f47328824abfef379725e (diff) | |
download | roux-96836855a55cd28f1449b4a58d1e5301669350c0.tar.gz |
rework storage of types
The arm64 ABI needs to know precisely what floating point types are being used, so we need to store that information. I also made typ[] a dynamic array.
Diffstat (limited to 'amd64/sysv.c')
-rw-r--r-- | amd64/sysv.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/amd64/sysv.c b/amd64/sysv.c index dcaa812..ea81eee 100644 --- a/amd64/sysv.c +++ b/amd64/sysv.c @@ -19,32 +19,37 @@ struct RAlloc { static void classify(AClass *a, Typ *t, int *pn, int *pe) { - Seg *seg; - int n, s, *cls; + Field *fld; + int s, *cls; + uint n; for (n=0; n<t->nunion; n++) { - seg = t->seg[n]; + fld = t->fields[n]; for (s=0; *pe<2; (*pe)++) { cls = &a->cls[*pe]; for (; *pn<8; s++) { - switch (seg[s].type) { - case SEnd: + switch (fld[s].type) { + case FEnd: goto Done; - case SPad: + case FPad: /* don't change anything */ break; - case SFlt: + case Fs: + case Fd: if (*cls == Kx) *cls = Kd; break; - case SInt: + case Fb: + case Fh: + case Fw: + case Fl: *cls = Kl; break; - case STyp: - classify(a, &typ[seg[s].len], pn, pe); + case FTyp: + classify(a, &typ[fld[s].len], pn, pe); continue; } - *pn += seg[s].len; + *pn += fld[s].len; } Done: assert(*pn <= 8); |