Yes, Chris. I'd have to create a big switch table.<br><br><div><span class="gmail_quote">2007/8/17, Chris Lattner <<a href="mailto:clattner@apple.com">clattner@apple.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>On Aug 17, 2007, at 12:02 PM, Evan Cheng wrote:<br><br>>  void *ARMJITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter<br>> &MCE) {<br>> -  unsigned addr = (intptr_t)Fn-MCE.getCurrentPCValue()-4;<br>> +  unsigned addr = (intptr_t)Fn;
<br>>    // If this is just a call to an external function, emit a branch<br>> instead of a<br>>    // call.  The code is the same except for one bit of the last<br>> instruction.<br>>    if (Fn != (void*)(intptr_t)ARMCompilationCallback) {
<br>> +    // branch to the corresponding function addr<br>> +    MCE.startFunctionStub(8, 4);<br>> +    MCE.emitWordLE(0xE51FF004); // LDR PC, [PC,#-4]<br>><br>> This is ok.... But I would rather see you refactor
<br>> getBinaryCodeForInstr() so you can "manufacture" the value by<br>> passing it ARM::LDR, ARM::PC, etc.? Do you think that's possible?<br><br>This probably isn't possible, because it would require creating a
<br>machineinstr to pass in.  Other JITs do similar things :(<br><br>-Chris<br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu
</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br></blockquote></div><br><br clear="all"><br>-- <br>Raul Fernandes Herbster<br>Embedded and Pervasive Computing Laboratory - 
<a href="http://embedded.dee.ufcg.edu.br">embedded.dee.ufcg.edu.br</a><br>Electrical Engineering Department - DEE - <a href="http://www.ee.ufcg.edu.br">www.ee.ufcg.edu.br</a><br>Electrical Engineering and Informatics Center - CEEI
<br>Federal University of Campina Grande - UFCG - <a href="http://www.ufcg.edu.br">www.ufcg.edu.br</a><br>Caixa Postal 10105<br>58109-970 Campina Grande - PB - Brasil