From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13483 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: 32-bit double and long double Date: Mon, 26 Nov 2018 19:19:58 +0100 Message-ID: <20181126181957.GR21289@port70.net> References: <87va4j3lpr.fsf@southeast> <20181126170339.GO23599@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1543256286 2370 195.159.176.226 (26 Nov 2018 18:18:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Nov 2018 18:18:06 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) To: musl@lists.openwall.com Original-X-From: musl-return-13499-gllmg-musl=m.gmane.org@lists.openwall.com Mon Nov 26 19:18:02 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1gRLSL-0000ST-V6 for gllmg-musl@m.gmane.org; Mon, 26 Nov 2018 19:18:02 +0100 Original-Received: (qmail 19692 invoked by uid 550); 26 Nov 2018 18:20:10 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 19643 invoked from network); 26 Nov 2018 18:20:10 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:13483 Archived-At: * Jon Chesterfield [2018-11-26 17:36:58 +0000]: > > Is there a reason your target is defining double in an unuseful and > > incompatible way rather than doing hard-single and soft-double? If you > > have any control over the choice of ABI, I think the latter makes a > > lot more sense. > > > > I can see a few arguments for float==double, but haven't actually done that > for our target yet. > > A common error is to write 1.0 instead of 1.0f, where the former sometimes > pulls in the soft double support. > > Integer arguments to libm functions promote to double but I would prefer > promote to 32 bit float. > > Arguments to variadic functions promote to double. Again I would prefer 32 > bit float. > > Leaving long double as 64 bit, unlike in the question, means no loss of > functionality relative to double == long double. > lot of existing c code assumes double is 64bit, (and you don't get a compile error building them, just wrong results) if you expect users to write software from scratch for your target then using 32bit double is fine (e.g. baremetal embedded software) if you expect existing libraries to work on your target then double should be 64bit. (e.g. you want linux userspace)