<div dir="ltr"><div>@Alex: Thanks. setOffset(0) eliminated any previous offsets, of course, so I added another param (int64_t Offset) and am adding that, this should preserve the orginial offset of the GA.</div><div><br></div><div>@Mehdi: This is what is slightly confusing. Yes, I have all direct mem ops currently working, for example 'add' (along with other native 'llvm instructions') can take an imm, reg or mem as any of it's operands, either src or dst (obviously not imm for dst). For example 'add, @a, r0, @b' is working just fine currently, that is global a + reg = global b is currently supported. The only issue we are having is with intrinsics.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 16, 2015 at 12:50 PM, Mehdi Amini <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style><br><div><span><blockquote type="cite"><div>On Jun 15, 2015, at 7:05 AM, Ryan Taylor <<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div>To be more specific:</div><div><br></div><div>We have some operators that we are currently implementing as intrinsics, for example things like: abs, min, max, etc.....</div><div><br></div><div>for some code:</div><div><br></div><div>int a;</div><div><br></div><div>int food() </div><div>{</div><div>    return abs(a);</div><div>}</div><div><br></div><div>the corresponding operator should look something like:</div><div><br></div><div>abs $a, r0</div><div><br></div><div>however, it looks like since intrinsics are handled as 'calls', we end up with something like:</div><div><br></div><div>mov $a, r0</div><div>abs r0, r0</div><div><br></div><div>Would it be better to make 'abs' an operator as opposed to an intrinsic, or is it possible in LLVM to support direct mem loads/stores via intrinsics?</div><div><br></div><div>I realize that we could resolve this with some peephole opts, I just want to know if there is a way in LLVM to get the 'abs $a, r0' match directly through tblgen?</div></div></div></blockquote><div><br></div><div><br></div></span><div>I assume that what you mean by “operator” is called “machine instruction” in LLVM. </div><div>It seems from the snippet you show "abs r0, r0” that the intrinsic call is correctly turned into a native instruction and not a runtime call, so the intrinsic is somehow matched.</div><div><br></div><div>What pattern have you tried to match the sequence abs(load(x)) in tblgen?</div><div>If you try to grep for “load” in the X86 backend tblgen files you should find examples of pattern.</div><div><br></div><div><br></div><div>— </div><div>Mehdi</div><div><br></div><br><blockquote type="cite"><div><span><div dir="ltr"><div><br></div><div>Thanks.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 10, 2015 at 8:19 PM, Ryan Taylor <span dir="ltr"><<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr"><div>What's the best way to get direct memory accesses for intrinsics via tblgen?</div><div><br></div><div>We have some instructions represented as intrinsics. These instructions allow direct memory access, I've tried multiclasses but they won't match. I've also tried "def : Pat<....> but it won't recognize the complex pattern as a valid operand?</div><div><br></div><div>Thanks.</div></div>
</blockquote></div><br></div></span>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></div></blockquote></div><br></div></blockquote></div><br></div>