Recent aarch64 iOS changes (pull #170)
Richard Henderson
rth@redhat.com
Thu Jan 22 18:11:00 GMT 2015
I dunno if the github comment thingy actually notifies anyone effectively,
especially if the pull is already closed. So copying my comment:
----
The trampoline can be done in 3 insns instead of 5.
And indeed, the trampoline that you do use looks wrong.
adr x17, -16384
adr x16, -16380
Note that these two addresses are 4 bytes apart ...
ldr x16, [x16]
ldr x17, [x17]
... but these are 8 byte loads.
As for the optimial code, one can either use adr+ldp or two pc-relative loads:
adr x16, -16384
ldp x16, x17, [x16]
br x16
or
1: ldr x16, 1b-16384
ldr x17, 1b-16384+8
br x16
----
r~
More information about the Libffi-discuss
mailing list