<div dir="ltr"><div><div><div>I'm trying to define new set of instructions, however I'm getting an error:<br><br>error:Illegal operand for the 'VADDvg' instruction!<br><br></div>I know the error is coming from <a href="https://github.com/llvm-mirror/llvm/blob/eab2869a64182bf66a53fac3c73458f29a3c43e5/utils/TableGen/CodeGenInstruction.cpp#L67">https://github.com/llvm-mirror/llvm/blob/eab2869a64182bf66a53fac3c73458f29a3c43e5/utils/TableGen/CodeGenInstruction.cpp#L67</a><br><br></div>but I can't figure out what it means. <br><br></div>Below is the code that is causing the error. Would anyone care to help out? Many thanks in advance.<br><br>class VALU0vv<bits<8> subOp, string asmstr, SDNode OpNode><br> : InstFRR<subOp, (outs VR:$rD), (ins VR:$rA, VR:$rB),<br> !strconcat(asmstr, "\t$rD, $rA, $rB"),<br> [(set VR:$rD, (OpNode VR:$rA, VR:$rB))]> {<br> bits<5> rD;<br> bits<5> rA;<br> bits<5> rB;<br><br> let Inst{25-21} = rD;<br> let Inst{20-16} = rA;<br> let Inst{15-11} = rB;<br>}<br><br>class VALU0vg<bits<8> subOp, string asmstr, SDNode OpNode><br> : InstFRR<subOp, (outs VR:$rD), (ins VR:$rA, (i32 GPR:$rB)),<br> !strconcat(asmstr, "\t$rD, $rA, $rB"),<br> [(set VR:$rD, (OpNode VR:$rA, (i32 GPR:$rB)))]> {<br> bits<5> rD;<br> bits<5> rA;<br> bits<5> rB;<br><br> let Inst{25-21} = rD;<br> let Inst{20-16} = rA;<br> let Inst{15-11} = rB;<br>}<br><br>multiclass VALU1<bits<8> subOp1, bits<8> subOp2, string asmstr, SDNode OpNode> {<br> def vv : VALU0vv<subOp1, asmstr, OpNode>;<br> def vg : VALU0vg<subOp2, asmstr, OpNode>;<br>}<br><br>let Itinerary = l_add in<br> defm VADD : VALU1<0x07, 0x08, "v.add", add>;<br><br clear="all"><div><div><div><div><div><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Rail Shafigulin<br></div>Software Engineer <br>Esencia Technologies<br></div></div></div></div>
</div></div></div></div></div></div>