<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 26, 2016 at 2:24 PM, Krzysztof Parzyszek <span dir="ltr"><<a href="mailto:kparzysz@codeaurora.org" target="_blank">kparzysz@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On 9/26/2016 3:58 PM, Phil Tomson wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
But don't the defs for ADDR_RR and ADDR_RI also contain dags?<br>
<br>
  def ADDR_RR : Addr< 2, "SelectAddrRegReg",<br>
                      (ops GPRC:$base, GPRC:$offsetreg) >;<br>
  def ADDR_RI : Addr< 2, "SelectAddrRegImm",<br>
                      (ops GPRC:$base, i64imm:$offsetimm) >;<br>
<br>
Do I need to create some other intermediate node type for a shifted address?<br>
</blockquote>
<br></span>
Technically yes, but the list of allowed types is limited. "RegisterClass" (e.g GPRC) is allowed, as is "Operand" (e.g. i64imm).<br>
<br>
You can create a subclass of "Operand" and provide your EncoderMethod for it.<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
<br></div></div></blockquote><div><br></div><div>Followup question:<br><br></div><div>I was thinking that in order to match this DAG: <br><br>         0x30d29c0: i64 = Constant<3><br><br>        0x30d2e00: i64 = shl 0x30d2be0, 0x30d29c0 [ORD=3]<br><br>      0x30d2f10: i64 = add 0x30d2cf0, 0x30d2e00 [ORD=3]<br><br>      0x30d28b0: <multiple use><br>    0x30d3570: i32,ch = load 0x30a3ec0, 0x30d2f10, 0x30d28b0<LD4[%arrayidx16(addrspace=4)](align=8)(tbaa=<0x3082188>)> [ORD=4]<br><br><br></div><div>And map it to a load.idx instruction with the following semantics: <br></div><div>load.idx r1,r2,r3,SIZE        r1 <- mem[r2 + (r3 << sizeof(operand))]<br><br></div><div>That somehow the pattern matching dag fragment would need to be something like I had in ADDR_SHLI definition:<br>  def ADDR_SHLI : Addr< 2, "SelectAddrShlImm", <br>                      (ops GPRC:$base, ( shl GPRC:$offsetreg, (i64 3))) >;<br><br><br></div><div>Now If I have to create a subclass of Operand and define it's EncoderMethod in C++, does that mean the pattern matching (matching the shift left and add) now happens on the C++ side as well?<br><br></div><div>Phil<br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">
-Krzysztof<br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation<br>
</div></div></blockquote></div><br></div></div>