Open sirinath opened 4 years ago
In some way, the current mapping description is already kind of DSL implemented on the top of C:
For example, binutils is using even more primitive approach based on C macros and binutils supports much more architectures than one.
To create a general DSL to describe insns (and MIR mapping) of existing processors is a pretty big job. Architectures are so different.
I know one attempt https://sourceware.org/cgen written by one my former colleague. I would not say that its description is more understandable. It failed to be used by binutils, gcc, gdb, simulators etc.
So I prefer a natural approach, informal MIR insn defs in MIR.md and approach currently used by x86_64 mir generator. As I add more architectures, I may be will see that I need implementation of more general DSL.
This might not be immediately actionable but can we have and DSL which describes the passing of a language MIR mapping and the optimisations applied where the code needed will be automatically generated. Also, the DSL should be able to describe itself so a future version of the DSL can be described in an older version. This way the code base will not be C but a purpose-built language on its own right. This way MIR will become more easy to understand, modify and improve.