public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* Recent aarch64 iOS changes (pull #170)
@ 2015-01-22 18:11 Richard Henderson
  0 siblings, 0 replies; only message in thread
From: Richard Henderson @ 2015-01-22 18:11 UTC (permalink / raw)
  To: libffi-discuss

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~

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-01-22 18:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-22 18:11 Recent aarch64 iOS changes (pull #170) Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).