<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Anitha,<br>
<br>
def dispRI : Operand<iPTR>;<br>
def iaddroff : ComplexPattern<iPTR, 1,
"SelectAddrImmOffs", [], []>;<br>
def ptr_rc_nor0 : PointerLikeRegClass<1>;<br>
<br>
iaddroff is defined as a ComplexPattern that results in an iPTR, and
dispRI is also an operand of type iPTR, so $ptroff and $imm are of
the the same type. The function "SelectAddrImmOffs" will show how
the pattern matching is actually performed.<br>
<br>
I'm not familiar with the ppc backend, but I'm assuming that
PointerLikeRegClass also holds an iPTR value, and that is why ptrreg
can be passed as well. <br>
<meta charset="utf-8">
<br>
Regards,<br>
Sam<br>
<br>
<div class="moz-cite-prefix">On 07/04/2013 18:40, Anitha B Gollamudi
wrote:<br>
</div>
<blockquote
cite="mid:CAMHf9jKCSgnEV9ks8H_0WQ429atKePR8mUWaCF6yLUuo9fthwQ@mail.gmail.com"
type="cite">
<pre wrap="">On 7 April 2013 14:54, Sam Parker <a class="moz-txt-link-rfc2396E" href="mailto:S.Parker3@lboro.ac.uk"><S.Parker3@lboro.ac.uk></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi Anitha,
memri is just describing that the address contains two components, an
immediate and a register, and how to handle them in the instruction printer.
The STWU expects a memri operand, and that is what is passed from the Pat.
</pre>
</blockquote>
<pre wrap="">
My confusion is how operands of STWU from "Pat pre_store" get matched
with those of memri. It is defined with operand types as:
let MIOperandInfo = (ops dispRI:$imm, ptr_rc_nor0:$reg);
while Pat is defined as:
def : Pat<(pre_store i32:$rS, iPTR:$ptrreg, iaddroff:$ptroff),
(STWU $rS, iaddroff:$ptroff, $ptrreg)>;
So now how iPTR:$ptrreg and iaddroff:$ptroff get matched with
ptr_rc_nor0:$reg and dispRI:$imm respectively? I mean the types are
not exactly matching. Probably something is amiss in my understanding.
-Anitha
</pre>
<blockquote type="cite">
<pre wrap="">
On 07/04/2013 10:19, Anitha B Gollamudi wrote:
Hi,
How do "Pat" operands get matched? I am trying to follow the example given
in <a class="moz-txt-link-freetext" href="http://llvm.org/docs/CodeGenerator.html#selectiondag-process">http://llvm.org/docs/CodeGenerator.html#selectiondag-process</a>
In the latest trunk of ppcintrinfo.td following pattern is defined:
def : Pat<(pre_store i32:$rS, iPTR:$ptrreg, iaddroff:$ptroff),
(STWU $rS, iaddroff:$ptroff, $ptrreg)>;
I understand that input operand list i.e. ins of stwu should get matched
with the given pre_store. But I am confused as to how "ptroff" and "ptrreg"
get matched with "memri" used in STWU?
For reference[1] memri is defined as:
def memri :Operand<iPTR> {
let PrintMethod = "printMemRegImm";
let MIOperandInfo = (ops dispRI:$imm, ptr_rc_nor0:$reg);
let EncoderMethod = "getMemRIEncoding";
}
[1]
<a class="moz-txt-link-freetext" href="https://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td?view=markup">https://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td?view=markup</a>
--
Anitha
_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<pre wrap="">
--
Anitha
</pre>
</blockquote>
<br>
</body>
</html>