<div dir="ltr"><div><div><div>In the first definition, I think you defined that the loaded data contains an i32. But the second definition (Pat) is not clear.<br></div>Actually, I do not too much knowledge about Patters, PatFrags and ComplexPatterns etc. and there is no document about them.<br>
</div>Some explanation will be good for me.<br><br></div>Thanks.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-06-07 21:39 GMT+03:00 Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Ramin,<br>
<div class=""><br>
On 7 June 2014 09:04, Ramin Guner <<a href="mailto:webvlkn@gmail.com">webvlkn@gmail.com</a>> wrote:<br>
> Error Message:<br>
> LDRAM: (set GPRegs:{i32:f32}:$dst, (ld:{i32:f32}<br>
> addr:iPTR:$src)<<P:Predicate_unindexedload>><<P:Predicate_load>>)<br>
> Included from<br>
<br>
</div>Each particular instance of a pattern has to be well-typed. In this<br>
case you can see that LLVM can't decide whether you intended the<br>
pattern to be loading i32 or f32 (the "{i32:f32}" tags).<br>
<br>
So you have to explicitly pick one and annotate the type. In this case<br>
(and for the LD only), you'd probably end up writing something like:<br>
<div class=""><br>
def LDRAM : FG1<0b000001, (outs GPRegs:$dst), (ins mem:$src), "ldram<br>
</div>$dst,$src", [(set GPRegs:$dst, (i32 (load addr:$src)))]>;<br>
def : Pat<(f32 (load addr:$src)), (LDRAM addr:$src)>;<br>
<br>
using the second "Pat" instantiation to get the other version of the load.<br>
<br>
Cheers.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br></div>