88/88 regression tests pass (+ffi-02-small-struct).
vendors/ffi_structs/ defines:
Vec2 — 8 B, two f32 — register-pair (float) ABI
Vec4f — 16 B, four f32 — homogeneous float aggregate (HFA) on AAPCS64
Both pass cleanly today: the sx-side struct declarations match the C
ABI for these float-only shapes, and the call-site / foreign-decl
type representations agree.
`#source` only (no `#include`) — c_import's type mapping rewrites
struct-typed params/returns to *void, which would link but pass
through the wrong ABI silently. The hand-written #foreign decls keep
sx's struct types end to end.
16-byte integer-only shapes (`{s64, s64}`, `{s32, s32, s32, s32}`)
discovered to trip the LLVM verifier (`[2 x i64]` vs `{ i64, i64 }`
mismatch between foreign decl and call site). Excluded from this
baseline; filed separately in the next commit as issue-0036.
7 lines
218 B
Plaintext
7 lines
218 B
Plaintext
vec2 make = (1.500000, 2.500000)
|
|
vec2 swap = (2.500000, 1.500000)
|
|
vec2 sum = 4.000000
|
|
vec4f make = (1.000000, 2.000000, 3.000000, 4.000000)
|
|
vec4f rev = (4.000000, 3.000000, 2.000000, 1.000000)
|
|
vec4f sum = 10.000000
|