From ddbd42e66cc71b470730037d76f4f267e98d8d40 Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 13 Apr 2026 19:25:11 +0200 Subject: C99 complex types MVP Missing: static eval of complex values, Silly inefficient implementation of equality comparisons between them The whole thing is pretty inefficient without proper aggregate mem2reg anyway --- src/t_aarch64_aapcs.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/t_aarch64_aapcs.c') diff --git a/src/t_aarch64_aapcs.c b/src/t_aarch64_aapcs.c index 5389a49..a1be63d 100644 --- a/src/t_aarch64_aapcs.c +++ b/src/t_aarch64_aapcs.c @@ -2,12 +2,15 @@ /* Ref: https://github.com/ARM-software/abi-aa/blob/2025Q4/aapcs64/aapcs64.rst */ + static bool -hfa_scalar(enum typetag *hfa_t, enum typetag t) +hfa_scalar(enum typetag *hfa_t, Type t) { - if (!isfltt(t)) return 0; - if (!*hfa_t) *hfa_t = t; - else if (*hfa_t != t) return 0; + enum typetag tt; + if (isflt(t)) tt = scalartypet(t); + if (iscomplex(t)) tt = t.t - TYCOMPLEXF + TYFLOAT; + if (!*hfa_t) *hfa_t = tt; + else if (*hfa_t != tt) return 0; return 1; } @@ -21,7 +24,7 @@ hfa_arr(enum typetag *hfa_t, Type ty) return cls_hfa(hfa_t, &typedata[chld.dat]); if (chld.t == TYARRAY) return hfa_arr(hfa_t, chld); - return hfa_scalar(hfa_t, scalartypet(chld)); + return hfa_scalar(hfa_t, chld); } static bool @@ -38,7 +41,7 @@ cls_hfa(enum typetag *hfa_t, const TypeData *td) if (!hfa_arr(hfa_t, fld->t)) return 0; } else { - if (!hfa_scalar(hfa_t, scalartypet(fld->t))) + if (!hfa_scalar(hfa_t, fld->t)) return 0; } } -- cgit v1.2.3