<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 24, 2014 at 1:46 PM, Craig Topper <span dir="ltr"><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">MRMDestReg means that 2 register operands are encoded in the modrm byte of the instruction. Operand 0 will be encoded in the r/m field. The other operand will be encoded in the reg field. And the mod field will be 0b11.<div>


<br></div><div>The format<3> just represent a enum value that represents this encoding form.</div><div><br></div><div>MRMSrcReg is similar but operand 0 is in reg and operand 1 is in r/m.</div><div><br></div><div>MRMDestMem means that operand 0 is memory and is encoded in mod and r/m. And operand 1 is in reg.</div>


<div><br></div><div>MRMSrcMem means that operand 0 is a register in reg. Operand 1 is memory in mod and r/m.</div><div><br></div><div>MRM0r means that a single register operand is encoded in mod(0b11) and r/m. Reg will be explicitly 0.</div>


<div><br></div><div>MRM0m means that a single memory operand is encoded in mod(not 0b11) and r/m. Reg will be explicitly 0.</div><div><br></div><div>There are additional formats for specifying nearly the entire modrm byte. Plus some other variations.</div>


<div><br></div><div>The translation from the encoding enum into mod rm byte is in X86MCCodeEmitter.cpp.</div></div><div class="gmail_extra"><br></div></blockquote><div><br></div><div>awesome! but why there are 2 X86MCCodeEmitter.cp?<br>

<br>    lib/Target/X86/X86CodeEmitter.cpp<br>    lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp <br><br></div><div>this is confused, as a quick glance can tell me that there are a lot of overlap between these 2 files.<br>

<br><br></div><div>thanks.<br></div><div>Jun<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_extra"><br><div class="gmail_quote">

<div><div class="h5">On Wed, Apr 23, 2014 at 8:30 PM, Jun Koi <span dir="ltr"><<a href="mailto:junkoi2004@gmail.com" target="_blank">junkoi2004@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div><div><div>hi,<br><br></div>i am struggling to understand how MRMDestReg is used in X86.<br>


<br></div>in X86InstrFormat.td, we have this:<br><br><br>class Format<bits<7> val> {<br>  bits<7> Value = val;                                                                                <br>

}<br>def MRMDestReg : Format<3><br><br><br></div>i think eventually, MRMDestReg is mapped back to ModMRM byte. but this still doesnt make sense to me why MRMDestReg is defined this way, and how it is mapped back to ModRM byte.<br>




<br></div>any hint please?<br><br></div>thanks!<br></div>
<br></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<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><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><span class=""><font color="#888888"><br><br clear="all"><div><br></div>-- <br>~Craig
</font></span></div>
</blockquote></div><br></div></div>