<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 02/15/2017 08:49 AM, vivek pandya
      via llvm-dev wrote:<br>
    </div>
    <blockquote
cite="mid:CAHYgpo+s1mkPFd9tWx_Bdnzj2y9jtyMjZdccskKr1+EO2s4juA@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div dir="ltr"><br>
        <div class="gmail_quote">
          <div dir="ltr">Hello LLVM Devs,
            <div><br>
            </div>
            <div><br>
            </div>
            <div>Hope you are doing well.</div>
            <div>I am implementing LLVM back-end for an architecture
              which has instruction that performs byte by byte
              comparison and stores result for each byte.</div>
            <div><br>
            </div>
            <div>
              <div>pcmpbf rD, rA, rB --> bytewise comparison
                returning position of first match in rd</div>
            </div>
            <div><br>
            </div>
            <div>So with this regard I wanted to find similar
              instruction lowering for nay other architecture which have
              similar instruction. </div>
            <div>I found some thing similar on PPC. If I am wrong kindly
              suggest some example.</div>
            <div><br>
            </div>
            <div>I am trying to understand following statement from
              PPCInstrInfo.td file:</div>
            <div>
              <div>  def CMPRB  : X_BF3_L1_RS5_RS5<31, 192, (outs
                crbitrc:$BF),</div>
              <div>                                (ins u1imm:$L,
                g8rc:$rA, g8rc:$rB),</div>
              <div>                                "cmprb $BF, $L, $rA,
                $rB", IIC_IntCompare, []>,</div>
              <div>               Requires<[IsISA3_0]>;</div>
            </div>
            <div>Here I am not able to understand against which DAG
              pattern this gets matched ? By doing grep I don't get any
              code which provide me the required info.</div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    I don't think we have a pattern for that instruction currently. We
    have a CMPB instruction, which we can automatically generate, and
    sounds similar to your desired semantics, see
    PPCDAGToDAGISel::combineToCMPB in PPCISelDAGToDAG.cpp.<br>
    <br>
     -Hal<br>
    <br>
    <blockquote
cite="mid:CAHYgpo+s1mkPFd9tWx_Bdnzj2y9jtyMjZdccskKr1+EO2s4juA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_quote">
          <div dir="ltr">
            <div><br>
            </div>
            <div>Basically I want to know which LLVM IR instruction or
              intrinsic has similar semantics and then how I can lower
              it correctly.</div>
            <div><br>
            </div>
            <div>Sincerely,</div>
            <div>Vivek</div>
            <div><br>
            </div>
          </div>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
  </body>
</html>