I am porting llvm to a new architecture.
I have two register classes r and d.
many instructions are like "add r,r,r" or "add d,d,d" so their
operands are either all r or all d but they do the same operation.
How do I describe such an instruction with its two alternatives in the .td file?
When doing it in GCC you have the alternatives mechanism in the insn
Is there something similar in LLVM?
I don't want to describe 2 different instructions because then the
code generator selects one of them at the begining.
I want that the final instruction (the one with the r or the one with
the d) would be selected after the register allocator chooses with
which register class it is better to operate.