<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div>Hello all,<br><br></div>I would like to assign some bits in the instructions, based on the order of mnemonics that appear in a special order. I can do it in TableGen itself, but it will not be well maintainable based on the things I want to accomplish.<br><br></div>Therefor, I would like to do it in the c++ file which is waaay easier (at least in the concept!!).<br><br></div>Imagine I have this in my base class in TableGen:<br></div><br><b>bits<4> bitpattern = 0;<br></b></div><b>let Inst{10-7} = bitpattern;</b><br><br></div>Then, at the moment that I am parsing the instruction, I would like to assign a value to "bitpattern" variable!<br></div>for example:<br><br></div><div>->ParseInstruction(...) <br></div>   if (Mnemonic == "X")<br></div>     Mnemonic = getLexer().getTok().getString();<br></div>     if (Mnemonic == "Y")<br></div>       <b>** let bitpattern = 0b1010" **  // How can I do this?</b><br><br></div><br>How can I do this? Is it possible?<br><br>Cheers,<br></div>ES<br><div><div><div><div><div><div><br></div></div></div></div></div></div></div>