From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1292 Path: news.gmane.org!not-for-mail From: idunham@lavabit.com Newsgroups: gmane.linux.lib.musl.general Subject: Re: mips port working! & remaining issues Date: Fri, 13 Jul 2012 16:58:39 -0400 (EDT) Message-ID: <11846.50.0.229.11.1342213119.squirrel@lavabit.com> References: <20120713052313.GA20369@brightrain.aerifal.cx> <20120713081525.GA14463@port70.net> <20120713130830.GH544@brightrain.aerifal.cx> <50002443.6050003@gentoo.org> <20120713142521.GI544@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1342213134 7060 80.91.229.3 (13 Jul 2012 20:58:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 13 Jul 2012 20:58:54 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1293-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jul 13 22:58:54 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Spmwv-0007x8-Es for gllmg-musl@plane.gmane.org; Fri, 13 Jul 2012 22:58:53 +0200 Original-Received: (qmail 1698 invoked by uid 550); 13 Jul 2012 20:58:52 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 1687 invoked from network); 13 Jul 2012 20:58:52 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=x0RzQu3x7Vni5qWfi4AZrcYq/w2U3XyIBQ9bFuRzrm0j+13UwEzy6LVg9WxUPCwcneb/8fGZXRm0MzBorLDpxE/MtWkTZ6s+dEswuB7t4rX2+6iWDukGnISDqcQi6DiJyFID9mVl56YxXAyt+vWX1nnZANX9JeC/uwj8GKvy8F8=; h=Message-ID:In-Reply-To:References:Date:Subject:From:To:User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding; In-Reply-To: <20120713142521.GI544@brightrain.aerifal.cx> User-Agent: SquirrelMail/1.4.13 Xref: news.gmane.org gmane.linux.lib.musl.general:1292 Archived-At: > 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