<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">def VGETITEM:<br>
[(set GPR:$rD, (extractelt (v4i32 VR:$rA), GPR:$rB))]<br>
<br>
def: Pat<(extractelt (v4f32 VR:$rA), GPR:$rB)),<br>
(VGETITEM VR:$rA, GPR:$rB)>;<br>
<br>
-Krzysztof<span class=""><font color="#888888"><br>
<br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</font></span></blockquote></div><br>What about load instruction? I tried the same approach but I got an error.</div><div class="gmail_extra"><br></div><div class="gmail_extra">error: In anonymous_570: Type inference contradiction found, merging '{v4i32:v4f32}' into '{i32:f32}'<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">For some reason I had no issues doing the same for store.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Any help is really appreciated.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Here is what I tried for load:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">// Addressing modes.</div><div class="gmail_extra">def ADDRri : ComplexPattern<i32, 2, "SelectAddr", [frameindex], []>;</div><div class="gmail_extra"><br></div><div class="gmail_extra">// Address operands</div><div class="gmail_extra">def MEMri : Operand<i32> {</div><div class="gmail_extra"> let PrintMethod = "printMemOperand";</div><div class="gmail_extra"> let EncoderMethod = "getMemoryOpValue";</div><div class="gmail_extra"> let DecoderMethod = "DecodeMemoryValue";</div><div class="gmail_extra"> let MIOperandInfo = (ops GPR, i32imm);</div><div class="gmail_extra">}</div><div class="gmail_extra"><br></div></div><div class="gmail_extra"><div class="gmail_extra">class LOAD<bits<4> subop, string asmstring, list<dag> pattern></div><div class="gmail_extra"> : InstLD<subop, (outs GPR:$rD), (ins MEMri:$src),</div><div class="gmail_extra"> !strconcat(asmstring, "\t$rD, $src"), pattern> {</div><div class="gmail_extra"> bits<5> rD;</div><div class="gmail_extra"> bits<21> src;</div><div class="gmail_extra"><br></div><div class="gmail_extra"> let Inst{25-21} = rD;</div><div class="gmail_extra"> let Inst{20-0} = src;</div><div class="gmail_extra">}</div><div class="gmail_extra"><br></div><div class="gmail_extra">class LOADi32<bits<4> subop, string asmstring, PatFrag opNode></div><div class="gmail_extra"> : LOAD<subop, asmstring, [(set (i32 GPR:$rD), (opNode ADDRri:$src))]>;</div><div class="gmail_extra"><br></div><div class="gmail_extra">let mayLoad = 1 in {</div><div class="gmail_extra"> let Itinerary = l_lwz in</div><div class="gmail_extra"> def LWZ : LOADi32<0x1, "l.lwz", load>;</div><div class="gmail_extra">}</div><div><br></div></div><div class="gmail_extra"><div class="gmail_extra">class VLOADi32<bits<4> subop, string asmstring, PatFrag opNode></div><div class="gmail_extra"> : VLOAD<subop, asmstring, [(set (v4i32 VR:$rD), (opNode ADDRri:$src))]>;</div><div class="gmail_extra"><br></div><div class="gmail_extra">let mayLoad = 1 in {</div><div class="gmail_extra"> let Itinerary = v_lwz in</div><div class="gmail_extra"> def VLWZ : VLOADi32<0x2, "v.lwz", load>;</div><div class="gmail_extra">}</div><div class="gmail_extra"><br></div><div class="gmail_extra">// Cast load of a floating point vector to use the same</div><div class="gmail_extra">// operation as a load of an integer vector.</div><div class="gmail_extra">def: Pat<(set (v4f32 VR:$rD), (load ADDRri:$src)),</div><div class="gmail_extra"> (VLWZ VR:$rD, ADDRri:$src)>;</div><div><br></div></div><div class="gmail_extra"><br clear="all"><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>