[llvm-commits] [llvm] r106662 - /llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp

Rafael Espindola espindola at google.com
Thu Jun 24 09:54:36 PDT 2010


> The B instruction does not support ARM/Thumb interworking, so if functions f and g are compiled with different instruction sets, the linker would need to insert a stub.  The stub would need to load the address of the target into a register and do a BX to it.  That would certainly negate any advantage from the tail call transformation, although hopefully the common case would not require interworking.  Does the GNU linker do that?

Looks like it does. I renamed f to main, compiled g as a thumb
function and linked. What I got:

000083fc <main>:
    83fc:       e92d4080        push    {r7, lr}
    8400:       e8bd4080        pop     {r7, lr}
    8404:       ea000035        b       84e0 <__f_from_arm>

000084e0 <__f_from_arm>:
    84e0:       e51ff004        ldr     pc, [pc, #-4]   ; 84e4
<__f_from_arm+0x4>
    84e4:       00008409        .word   0x00008409

00008408 <f>:
    8408:       202a            movs    r0, #42 ; 0x2a
    840a:       4770            bx      lr

Cheers,
-- 
Rafael Ávila de Espíndola




More information about the llvm-commits mailing list