Open paulcadman opened 10 months ago
In general, only MemRepConstr
is supported in C code generation. There are macros/functions in the C runtime that enable support for other representations, but they have not been tested and code generation with them has not been fully implemented.
To support MemRepTuple
one needs to look at and modify C code generation for:
Case
instruction (accesses the tag),MemRef
and Field
-- reading constructor arguments (we might need to shift the index by 1 for tuples without tag, or preferably use a different runtime macro).
We wish to use the
MemRepTuple
constructor representation in the Nockma backend.However the code emitted by the Reg->C translation is incorrect:
https://github.com/anoma/juvix/blob/1147e1fce131f5b423fd558e5636e6aaf23120ac/src/Juvix/Compiler/Backend/C/Translation/FromReg.hs#L341-L342
Specifically an
ALLOC_CONSTR_TUPLE
call is generated with too many arguments.