From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 99DA83858CDA for ; Fri, 19 Aug 2022 09:19:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 99DA83858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660900757; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=9PrsBOyGWCoB+cPvn02v1+Y1//fey4cTbs1ZgeV22vw=; b=eU+FaJUZocPVesChBR/zZdX9KqzFE6+7/qiDnLLteEdiFXXXt8SQM4sLNLpASF9QwH8Tkj Ki/tQXZy//M6EgJb5vSd3o/tOysVwDoHIglwHPJPr0SMRrdBclXAVbRVR/MXdGxeCF4bWe PP0Ex8vTmwt79PUOLHHOHnHBrhW+Uno= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-90-MjSmpHNJN_C6IQyOfJFfsw-1; Fri, 19 Aug 2022 05:19:13 -0400 X-MC-Unique: MjSmpHNJN_C6IQyOfJFfsw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8B5BD381079E; Fri, 19 Aug 2022 09:19:13 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.39.193.176]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 67F8640D2827; Fri, 19 Aug 2022 09:19:13 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 2865CA8096F; Fri, 19 Aug 2022 11:19:12 +0200 (CEST) Date: Fri, 19 Aug 2022 11:19:12 +0200 From: Corinna Vinschen To: Joel Sherrill Cc: Newlib Subject: Re: Revisiting More Complete long double Support Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: Joel Sherrill , Newlib References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2022 09:19:18 -0000 On Aug 18 17:16, Joel Sherrill wrote: > I've dug in a bit and tried to bring in one function. Found > a few things that are going to shape the solution: > > (1) Newlib and FreeBSD do not agree on filenames. truncl.c > gets replaced by s_truncl.c > (a) Great work on the new build system. :) We can easily change this to the FreeBSD naming convention. We're using it mostly anyway. > (2) FreeBSD long double methods rely on _fpmath.h to define > the long double format. It doesn't have to be 128 bits for the > code to work. But only a handful of architectures have this file: > > aarch64 amd64 arm i386 mips powerpc powerpc64 riscv sparc64 > > This file would go in libc/machine/... I think based on the FreeBSD > source layout. _fpmath.h defines one union and 5 macros. It's very basic. We have already multiple files defining structs and unions based on the value of LDBL_MANT_DIG, libc/include/ieeefp.h, libc/include/machine/ieee.h, and libc/stdio/vfieeefp.h. The most useful way of action would probably be to define a common _fpmath.h with all the required structs, unions and macros and use that throughout, i. e., we include it from the above files. And ideally we only have one *ieee*.h file, not three, in future... > (3) I think my suggestion to have the default implementation and > then this implementation in parallel and then select the appropriate > one at configure time. For the architectures with _fpmath.h, the > new FreeBSD implementation can be used. For others, architectures > the old implementation could be used. Dunno about others, but I'd rather not see two parallel implementations of math in newlib. It might be a bit more work to port the code, but it's certainly not unfeasible. Corinna