In The LLVM Target-Independent Code Generator — LLVM 16.0.0git documentation, I see the following.
In def FMADDS : AForm_1<59, 29,
(ops F4RC:$FRT, F4RC:$FRA, F4RC:$FRC, F4RC:$FRB),
“fmadds $FRT, $FRA, $FRC, $FRB”,
[(set F4RC:$FRT, (fadd (fmul F4RC:$FRA, F4RC:$FRC),
def FADDS : AForm_2<59, 21,
(ops F4RC:$FRT, F4RC:$FRA, F4RC:$FRB),
“fadds $FRT, $FRA, $FRB”,
[(set F4RC:$FRT, (fadd F4RC:$FRA, F4RC:$FRB))]>;
In PPCInstrFormat.td, I see that AForm_1’s signature is as follows.
class AForm_1<bits<6> opcode, bits<5> xo, dag OOL, dag IOL, string asmstr,
InstrItinClass itin, list pattern>
For a beginner to write records like FMADDS is not straightforward. Can someone simplify this FMADDS? For example, I didn’t understand why InstrItinClass is used in AForm_1 as a parameter. Is there any document explaining how to write Instruction records from scratch?
Thanks in advance!