<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><br><div class="gmail_quote">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>
<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>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>_______________________________________________<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>