1 /* Used by the elf ifunc tests. */
2 #ifndef ELF_IFUNC_SEL_H
3 #define ELF_IFUNC_SEL_H 1
8 ifunc_sel (int (*f1
) (void), int (*f2
) (void), int (*f3
) (void))
10 register void *ret
__asm__ ("r3");
11 __asm__ ("mflr 12\n\t"
15 "addis 12,11,global-1b@ha\n\t"
16 "lwz 12,global-1b@l(12)\n\t"
17 "addis %0,11,%2-1b@ha\n\t"
18 "addi %0,%0,%2-1b@l\n\t"
21 "addis %0,11,%3-1b@ha\n\t"
22 "addi %0,%0,%3-1b@l\n\t"
25 "addis %0,11,%4-1b@ha\n\t"
28 : "X" (&global
), "X" (f1
), "X" (f2
), "X" (f3
));
33 ifunc_one (int (*f1
) (void))
35 register void *ret
__asm__ ("r3");
36 __asm__ ("mflr 12\n\t"
40 "addis %0,%0,%1-1b@ha\n\t"