This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Recent aarch64 iOS changes (pull #170)
- From: Richard Henderson <rth at redhat dot com>
- To: libffi-discuss at sourceware dot org
- Date: Thu, 22 Jan 2015 10:09:39 -0800
- Subject: Recent aarch64 iOS changes (pull #170)
- Authentication-results: sourceware.org; auth=none
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~