<div>Hi,</div><div><br></div> I agree with you that pseudos are handled (and encoded) in ARMCodeEmitter::emitPseudoInstruction.<div>But unfortunately, emitPseudoInstruction will try to call CodeEmitter::getBinaryCodeForInstr first, then</div>
<div>getBinaryCodeForInstr will report a fatal error. That's why I tried to add new 'case' (though we are doing</div><div>nothing in getBinaryCodeForInstr.) You may trace the control flow while emitting LDMIA_RET or B,</div>
<div>and you will see why this patch is essential. Thanks.</div><div><br></div><div>Sincerely,</div><div>Logan</div><div><br><div class="gmail_quote">On Fri, Jul 22, 2011 at 11:40 PM, Jim Grosbach <span dir="ltr"><<a href="mailto:grosbach@apple.com">grosbach@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word">This isn't what you want to do. The reason pseudos are excluded is that they don't have any binary information to emit. Adding them to the getBinaryCodeForInstr() won't help, as it won't return any bits of the instruction anyway.<div>
<br></div><div>Pseudos are handled in ARMCodeEmitter::emitPseudoInstruction(), and that function is required to fill in all required bits for the instruction(s) the pseudo expands to.</div><div><br></div><div>-Jim<br><div>
<br><div><div><div></div><div class="h5"><div>On Jul 21, 2011, at 7:27 PM, Logan Chien wrote:</div><br></div></div><blockquote type="cite"><div><div></div><div class="h5">Dear all,<div><br></div><div> With commit r134539, the CodeEmitter backend of TableGen will not generate case for</div>
<div>pseudo instruction. It seems that r134539 assumed that the pseudo instruction will</div><div>
be lowered before calling CodeEmitter::getBinaryCodeForInstr. Thus, getBinaryCodeForInstr</div><div>will report a fatal error if it gets a pseudo instruction.</div><div><br></div><div> However, ARMCodeEmitter does not lower the pseudo instruction before calling</div>
<div>getBinaryCodeForInstr, and ARMCodeEmitter will no longer work after r134539.</div><div>With this patch, we will generate case for pseudo instruction for CodeEmitter (but not</div><div>MCCodeEmitter) just like what was done before.</div>
<div><br></div><div> Please review. Thanks!</div><div><br></div><div>Sincerely,</div><div style="text-align:right">Logan</div>
</div></div><span><0001-Fix-ARMCodeEmitter-pseudo-instruction-encoder.patch></span>_______________________________________________<br>llvm-commits mailing list<div class="im"><br><a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
</div><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br></blockquote></div><br></div></div></div>
</blockquote></div><br></div>