<div dir="ltr">I've added floating point vector instructions to my target. However when I run a simple test I don't them being generated. What I see is a jump to the library. Does anyone know why llvm is doing it and how I can force it to use a my floating point vector instructions?<div><br></div><div>Any help is appreciated.<br><div><br></div><div>Here are the details of what I'm talking about:</div><div><br></div><div>Command Line:</div><div>clang --target=esencia -S -O3 test.c -o test.s<br></div><div><br></div><div>Instruction definition: </div><div><br></div><div><div>// Floating point instructions</div><div>class InstFRR<bits<8> op, dag outs, dag ins, string asmstr, list<dag> pattern></div><div> : InstEsencia<outs, ins, asmstr, pattern> {</div><div> let optype = 0b11;</div><div> let opcode = 0b0010;</div><div> let Inst{7-0} = op;</div><div>}</div></div><div><br></div><div><div>class VALU<bits<8> subOp, string asmstr, SDNode OpNode></div><div> : InstFRR<subOp, (outs VR:$rD), (ins VR:$rA, VR:$rB),</div><div> !strconcat(asmstr, "\t$rD, $rA, $rB"),</div><div> [(set VR:$rD, (OpNode VR:$rA, VR:$rB))]> {</div><div> bits<5> rD;</div><div> bits<5> rA;</div><div> bits<5> rB;</div><div><br></div><div> let Inst{25-21} = rD;</div><div> let Inst{20-16} = rA;</div><div> let Inst{15-11} = rB;</div><div>}</div></div><div><br></div><div><div>let Itinerary = v_fadd in</div><div> def VFADD : VALU<0x1a, "v.fadd", fadd>;</div><div><br></div><div>Test file:</div><div><br></div><div><div>#define N 32</div><div><br></div><div>void foo (float *a, float *b, float *c) {</div><div><br></div><div> for (int i = 0; i < N; ++i)</div><div> c[i] = a[i] + b[i];</div><div>}</div></div><div><br></div><div>Jump instruction that I see:</div><div>l.jal<span class="" style="white-space:pre"> </span>__addsf3<br></div><div><br></div><div>It should use:</div><div>v.fadd v0, v1, v2</div><div><br></div><div><br></div>-- <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>