4 ms·
shameless plug: I have been playing with a new IR here: https://github.com/robertmuth/Cwerg https://github.com/robertmuth/Cwerg It does simplify the pointer re
by muth02446 5y ago
shameless plug: I have been playing with a new IR here:
https://github.com/robertmuth/Cwerg https://github.com/robertmuth/Cwerg
It does simplify the pointer related operations but re-introduces the signed/unsigned notion for integers.
I felt this is important because at some point you may want
additional notions, e.g. saturating int arithmetic and then you have a choice of either adding more operation, e.g. add_sat, sub_sat, etc or re-use the existing add, sub, etc and interpret it differently based on the operand type.
- Mathnerd314 5y agoThe point of that section of the article IMO was to say that you always want to err on the side of more operations rather than more types. When canonicalizing, it is easy to reduce operations to their simplest form, but changing the type of an operand is a global operation and hence is a lot more complex. And x86 has mul and imul instructions operating on general-purpose registers, rather than typed registers, so using more operations is closer to the assembly.