mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [PATCH] convert arm memcpy asm to UAL, remove .word hacks
Date: Mon, 19 Oct 2015 17:15:53 -0400	[thread overview]
Message-ID: <20151019211553.GO8645@brightrain.aerifal.cx> (raw)
In-Reply-To: <7CC703B4-FA8E-413E-BBFE-73E2107D36EF@gmail.com>

On Mon, Oct 19, 2015 at 02:07:53PM -0700, Khem Raj wrote:
> 
> > On Oct 18, 2015, at 5:17 PM, Rich Felker <dalias@libc.org> wrote:
> > 
> > I've found that, contrary to the message in commit
> > 9367fe926196f407705bb07cd29c6e40eb1774dd, all relevant gas versions
> > actually do support .syntax unified, and assemble memcpy.s
> > successfully with the attached patch applied. If there are no
> > objections I'd like to go ahead and commit it. The only remaining
> > .word hacks I'm aware of are in setjmp and longjmp, but they may still
> > be needed to avoid wrongly flagging plain EABI (softfloat) binaries
> > as needing hard float.
> 
> IIRC .syntax should not affect the fp ABI assumptions, Its plainly
> for unifying arm/thumb-ness in asm files and .eabi_attribute is the
> directive which could set FP ABI and I don’t see it being set in asm
> file which means it will be set depending on compiler cmdline.

Right now setjmp and longjmp use .word to encode the instrutions:

	stc p11, cr8, [ip], #64
	ldc p11, cr8, [ip], #64

because UAL does not permit them. Switching to the forms:

	vstmia ip!, {d8-d15}
	vldmia ip!, {d8-d15}

would of course work, but these are floating point instructions, so
they're not accessible without using .fpu, and then the object file is
tagged as needing fpu, despite these instructions being needed even
for no-fpu builds and only executed conditionally. (They're needed
conditionally because, even if libc is soft ABI, the caller could be
using "softfp" model, and in that case longjmp needs to be able to
restore call-saved fp registers that have been modified between setjmp
and longjmp.)

Do you know a viable way to include these instructions without the
file getting an ABI-tag marking it as requiring fpu?

Rich


      reply	other threads:[~2015-10-19 21:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19  0:17 Rich Felker
2015-10-19 21:07 ` Khem Raj
2015-10-19 21:15   ` Rich Felker [this message]

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=20151019211553.GO8645@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).