On Wed, Feb 13, 2013 at 7:00 PM, reed kotler <span dir="ltr"><<a href="mailto:rkotler@mips.com" target="_blank">rkotler@mips.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is there a simple way to just change the opcode of a machine instruction.<br>
<br>
I have a lot of long/short pairs where when I know the offset, i can replace the long version with the short version.<br></blockquote><div><br></div><div><p style="margin:0px;font-size:13px;font-family:Arial">Hey Reed,</p>
<p style="margin:0px;font-size:13px;font-family:Arial;min-height:15px"><br></p>
<p style="margin:0px;font-size:13px;font-family:Arial">The x86 target does something like this. Check out <span style="font-size:11px;font-family:Menlo">ReplaceableInstrs </span>in<span style="font-size:11px;font-family:Menlo"> lib/Target/X86/X86InstrInfo.cpp.</span></p>
<p style="margin:0px;font-size:13px;font-family:Arial"><span style="font-size:11px;font-family:Menlo"><br></span></p><p style="margin:0px;font-size:13px;font-family:Arial"></p><p style="margin:0px">Hope that helps,</p>
<p style="margin:0px">Cameron</p><p></p></div><div> </div></div>