Hi all,<div><br></div><div>Currently, I run into a problem in selecting a multiply-add-forward instruction in my backend. </div><div><br></div><div><font class="Apple-style-span" face="'courier new', monospace">...</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">%bin = xor i16 %1, %2 (any binary operation)</font></div><div><font class="Apple-style-span" face="'courier new', monospace">%mul = mul i16 %3, %4</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">%add = add i16 %mul, %bin</font></div><div><br></div><div>should generate a multiply-add-forward instruction as</div><div><font class="Apple-style-span" face="'courier new', monospace">XOR R0, R1, R2 ; R1 xor R2 -> R0 </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">MULADDFWD R5, R3, R4 ; R3 * R4 + <b>result of (R1 xor R2)</b> -> R5</font></div><div><font class="Apple-style-span" face="'courier new', monospace">(Note the implicit operand of MULADDFWD is the result of previous binary instruction, not the R0 register. In my target, there is no data forwarding path, only the immediate result can be directly used, otherwise, several noops need to be inserted.)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">As the result generated by the binary operation is stored in an implicit forwarding register and flushed every cycle, I need to stick AND and MULADDFWD instructions together. </font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">I can use a custom node with SDNPInGlue property to select MULADDFWD, but how can I make the binary operation output a glue, so that I use the glue to stick them together?</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">This may be confusing, but I work in a not-so-normal target. Look forward to your reply.</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Best wishes</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Peng Wang</font></div>
<div><br></div>