diff options
| author | 2026-04-13 19:25:11 +0200 | |
|---|---|---|
| committer | 2026-04-13 19:30:01 +0200 | |
| commit | ddbd42e66cc71b470730037d76f4f267e98d8d40 (patch) | |
| tree | aae9ff541b3e0690e23e391bb2e5e8927d34bf38 /src/t_aarch64_aapcs.c | |
| parent | 36143af2748b6fcae02ca320baaac417d77ebe58 (diff) | |
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
Diffstat (limited to 'src/t_aarch64_aapcs.c')
| -rw-r--r-- | src/t_aarch64_aapcs.c | 15 |
1 files changed, 9 insertions, 6 deletions
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; } } |