<div dir="ltr">The MCInst in this case would contain a value from the instruction enum and 6 operands. One being the dest and another 5 to represent the maximal address components used by X86 (base, index, scale, displacement, and segment). The only code that knows how to map those operands is in lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp. It does this by looking up TSFlag bits using the enum value and applying rules based on different bits in the TSFlags.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 26, 2013 at 9:18 AM, James Courtier-Dutton <span dir="ltr"><<a href="mailto:james.dutton@gmail.com" target="_blank">james.dutton@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div>Hi,<br><br></div>By way of example, I have the following instruction:<br>
44 8b 80 c8 03 00 00                            movl    968(%rax), %r8d<br><br></div>1) How is this represented in MCInst?<br>

</div>2) Is there information in MCInst that would tell me which bytes of the instruction are responsible for the 968?<br><br></div>The reason I am asking is that I want to work with the bytes disassembled/decoded to an instruction at MCInst level. I then wish to apply customized relocation records at the MCInst level.<br>


</div>My customized relocation records will consist of an byte offset followed by an expression of what to replace the following X number of bytes with. Much like a normal relocation record.<br></div><div>I need a way to map relocation byte offsets to the correct operand in MCInst.<br>


</div>The main difference is generally relocation records are applied before disassembly, and I wish to do it after disassembly.<br><br></div>Kind Regards<span class="HOEnZb"><font color="#888888"><br><br></font></span></div>
<span class="HOEnZb"><font color="#888888">James<br><br></font></span></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>~Craig
</div>