<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Aug 11, 2014, at 5:32 PM, Matt Arsenault <<a href="mailto:Matthew.Arsenault@amd.com">Matthew.Arsenault@amd.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<div bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 08/11/2014 02:24 PM, kewuzhang
wrote:<br>
</div>
<blockquote cite="mid:0775DF63-5DB5-41E8-BC90-24C2D9E59C05@amd.com" type="cite">
Hi Guys,
<div><br>
</div>
<div>I have a taget instruction which take a vec4 and returns a
vec4.( say instruction “vec4:$dst mod( vec4:$src)" )</div>
<div>And I want to use it to match i an ir instruction/intrinsic
function( say " float:$dst llvm.irmod( vec4:$src)" which
takes a vec4, output a float. </div>
<div><br>
</div>
<div>I think the procedure is: when I see the intrinsic
llvm.irmod, I need to call "extractlt( mod($src), 0)”, </div>
<div><br>
</div>
<div>So I tried to define a pattern “ def Pat<( i32 (
llvm.irmod vf432:$src)), (extractelt( mod v4f32:$src ), 0)>”,
but it reports<b> ERROR” Cannot use “extractelt” in an output
pattern”.</b></div>
<div><b><br>
</b></div>
<div>I knew I can easily do it via lowering operation
by separating the “extractelt” node out. But can I do it via
tablgen?</div>
</blockquote>
You want the machine equivalent of the extract element, which will
probably be something like (EXTRACT_SUBREG (mod $src), sub0)<br>
</div>
</blockquote></div><br><div><br></div><div>tks, "machine equivalent” works, </div><div><br></div><div><br></div><div>kevin</div></body></html>