From 96836855a55cd28f1449b4a58d1e5301669350c0 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 8 Apr 2017 21:09:59 -0400 Subject: 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. --- amd64/sysv.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'amd64') 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; nnunion; 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); -- cgit 1.4.1