This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Recent aarch64 iOS changes (pull #170)


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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]