<div dir="ltr"><div><div><div><div><div>Hi Tom,<br><br></div>each "X" has a unique bitpattern that should be assigned to the Inst.<br></div>e.g:<br></div>X1 = 0001<br></div>X2 = 0010<br>....<br><br> Imagine X as a predicate and Y as the Instruction Mnemonic.<br></div>If this is the answer to your question.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 26, 2015 at 4:15 PM, Tom Stellard <span dir="ltr"><<a href="mailto:tom@stellard.net" target="_blank">tom@stellard.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, Nov 26, 2015 at 03:57:42PM +0100, Sky Flyer via llvm-dev wrote:<br>
> Hello all,<br>
><br>
> I would like to assign some bits in the instructions, based on the order of<br>
> mnemonics that appear in a special order. I can do it in TableGen itself,<br>
> but it will not be well maintainable based on the things I want to<br>
> accomplish.<br>
><br>
> Therefor, I would like to do it in the c++ file which is waaay easier (at<br>
> least in the concept!!).<br>
><br>
> Imagine I have this in my base class in TableGen:<br>
><br>
><br>
</span>> *bits<4> bitpattern = 0;*<br>
> *let Inst{10-7} = bitpattern;*<br>
<span class="">><br>
> Then, at the moment that I am parsing the instruction, I would like to<br>
> assign a value to "bitpattern" variable!<br>
> for example:<br>
><br>
> ->ParseInstruction(...)<br>
>    if (Mnemonic == "X")<br>
>      Mnemonic = getLexer().getTok().getString();<br>
>      if (Mnemonic == "Y")<br>
</span>>        *** let bitpattern = 0b1010" **  // How can I do this?*<br>
<span class="">><br>
><br>
> How can I do this? Is it possible?<br>
><br>
<br>
</span>One thing you might be able to do is add 'bitpattern' as an instruction operand.<br>
Does each instruction always have the same bitpattern?<br>
<br>
-Tom<br>
<br>
> Cheers,<br>
> ES<br>
<br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br>
</blockquote></div><br></div>