mailing list of musl libc
 help / color / mirror / code / Atom feed
From: idunham@lavabit.com
To: musl@lists.openwall.com
Subject: Re: mips port working! & remaining issues
Date: Fri, 13 Jul 2012 16:58:39 -0400 (EDT)	[thread overview]
Message-ID: <11846.50.0.229.11.1342213119.squirrel@lavabit.com> (raw)
In-Reply-To: <20120713142521.GI544@brightrain.aerifal.cx>

> On Fri, Jul 13, 2012 at 03:36:03PM +0200, Luca Barbato wrote:
>> Currently hardfloat just pass the registers instead of doing some copy
>> over in a way or another and it is what people will use.
>
> That's the hardfloat ABI variant of EABI, but there's also base EABI
> that can use hard float behind the scenes (in the soft float
> functions) just by calling the __aeabi functions and having them
> implemented with hard-float. Although I suppose this usage does not
> require the registers to be preserved.
>
> Now I just need to work out a nice way to conditionally compile
> different ASM for each variant. Or I could have setjmp and longjmp
> just read a global var with the hardfloat flag in it, and jump over
> the float register code if it's false. Opinions on what's best?
>
Seems to me that the hardfloat flag (while slightly more bloated,
because you have code for both options) has room for adding runtime
checks: eventually, it might be possible to have that as a static
variable (I'm thinking char or something; at least 2 bits would be
needed for this method...), and if it is uninitialized (0x00?), try
saving the registers or something that will raise a SIGILL on pure
softfloat systems; the handler would set it to indicate softfloat
(0xFF?), while otherwise it sets it to indicate hardfloat (any
intermediate value?).
That particular approach might not work (can you install handlers in
*jmp safely?), but a runtime check would require using the hardfloat
flag.
In fact, you could use the flag to specify which FPU is present,
which is potentially useful for some other purposes down the road.
It would still be possible to set the flag at compile time.

Isaac Dunham




  parent reply	other threads:[~2012-07-13 20:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-13  5:23 Rich Felker
2012-07-13  8:15 ` Szabolcs Nagy
2012-07-13  8:18   ` Justin Cormack
2012-07-13 13:08     ` Rich Felker
2012-07-13 13:36       ` Luca Barbato
2012-07-13 14:25         ` Rich Felker
2012-07-13 16:10           ` Szabolcs Nagy
2012-07-13 17:34             ` Rich Felker
2012-07-13 20:40               ` Szabolcs Nagy
2012-07-13 20:58           ` idunham [this message]
2012-07-13 22:18             ` Rich Felker
2012-07-13 15:15 ` Gregor Richards

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=11846.50.0.229.11.1342213119.squirrel@lavabit.com \
    --to=idunham@lavabit.com \
    --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).