Thanks for your reply.<br><br>We are trying to implement a simple Mips-based CPU with just for teaching purpose, so we delete some instructions which are not commonly used, thus the task won't be too hard for students. I am responsible for modifying the compiler so that the compiler won't emit unsupported instructions.<br>
<br>In order to avoid "can not select" error, I am trying to expand these instructions when meeting them.<br><br>So what should I modify to achieve the goal?<br><br><br>Thanks,<br>Yang<br><br><br><div class="gmail_quote">
On Fri, Jul 20, 2012 at 10:02 PM, Reed Kotler <span dir="ltr"><<a href="mailto:rkotler@mips.com" target="_blank">rkotler@mips.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>why do you want to "ban" certain
instructions?<br>
<br>
is this for some architectural variant?<br>
<br>
the compiler is trying to match patterns from the target
independent part of the code generator.<br>
<br>
if you remove instructions, the compiler in many cases will no
longer be able to match certain patterns<br>
and you will get thos "can not select" messages.<div><div class="h5"><br>
<br>
On 07/20/2012 03:05 AM, Geraint Yang wrote:<br>
</div></div></div>
<blockquote type="cite"><div><div class="h5">
Hi everyone,<br>
<br>
<font>I am a newbie to LLVM. I am trying to ban some of
instructions in Mips Instruction, for example, lh, lhu, sh, and
etc.<br>
I have tried to </font><font>directly comment lh, lhu, and sh
to make llvm not to choose these instruction when compiling,
however, it usually cause a 'can not select ...' error when
using 'short' data type in source code.<br>
Then I tried to expand these instructions in</font>
EmitInstrWithCustomInserter in file <font>lib/Target/Mips/MipsISelLowering.cpp,
just as commit in:<br>
<br>
<a href="https://github.com/geraint0923/LLVM-ThuMips/commit/6a9ca907f3e945c2bb1f9627e0e5fdcbd7964da2" target="_blank">https://github.com/geraint0923/LLVM-ThuMips/commit/6a9ca907f3e945c2bb1f9627e0e5fdcbd7964da2</a><br>
<br>
It works fine for lh and lhu, and fails for sh:<br>
when expanding sh, there are four instruction, but in *.s
generated by modified llvm's llc, there are only two
instructions which are both sb, addiu and srl are gone.<br>
<br>
Is there anything wrong when expanding? <br>
And I wonder if there is another method to do the same thing.<br>
<br>
Any help will be appreciated.</font><br>
<br>
<br>
Thanks,<br>
Yang
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
LLVM Developers mailing list
<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>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</div>
</blockquote></div><br><br clear="all"><br>-- <br><div style="text-align:left">Geraint Yang <br>Tsinghua University Department of Computer Science and Technology</div>
<div><br></div><br>