public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@redhat.com>
To: libffi-discuss@sourceware.org
Subject: Recent aarch64 iOS changes (pull #170)
Date: Thu, 22 Jan 2015 18:11:00 -0000	[thread overview]
Message-ID: <54C13CE3.5070903@redhat.com> (raw)

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~

                 reply	other threads:[~2015-01-22 18:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54C13CE3.5070903@redhat.com \
    --to=rth@redhat.com \
    --cc=libffi-discuss@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).