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.129.124]) by sourceware.org (Postfix) with ESMTPS id 31C633858D1E for ; Thu, 18 Aug 2022 07:57:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 31C633858D1E 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=1660809431; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=5JPuFM46Vmr7+FIgum/KBSSVsb2lNu5AQHRahzLFbnc=; b=J/QvtvaeEJ4+DV0Ycx8SiU7zNlhdRUFBB5kW10ovjKcKcKSVekU0WsNf4R4XCMLGsPhVH3 xczOoBlh2IUdLcALOEsVEyNwhW1Y1JGSLhHz7DA6vZm+yzhY8ONgArVL3drF8VewM7vkWX MiEb4gO/cXyMtGznPCV/Ns+X8dxGwP8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-573-JbD-MP7tODKSMBF0yvMHvw-1; Thu, 18 Aug 2022 03:57:10 -0400 X-MC-Unique: JbD-MP7tODKSMBF0yvMHvw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3E6C7101A586 for ; Thu, 18 Aug 2022 07:57:10 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.39.193.176]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1B6761121315 for ; Thu, 18 Aug 2022 07:57:10 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id E9CDDA80A58; Thu, 18 Aug 2022 09:57:08 +0200 (CEST) Date: Thu, 18 Aug 2022 09:57:08 +0200 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: Revisiting More Complete long double Support Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, 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: Thu, 18 Aug 2022 07:57:13 -0000 On Aug 17 17:06, Joel Sherrill wrote: > Hi > > I'm looking at newlib long double support again when sizeof(long double) != > sizeof(double). > > (1) Merged FreeBSD C code for long double math > > FreeBSD has C code for long double math routines as default implementation: > > https://github.com/freebsd/freebsd-src/tree/main/lib/msun/src > > I **THINK** those will work if LDBL != DBL so that code might need the > ifdef for LDBL_EQ_DBL to pick the current newlib common implementation of > the method which just calls the normal version of the method. I code even > add the files as XXX_freebsd.c and only add > > ifdef _LDBL_EQ_DBL > long double > acosl (long double x) > { > return acos(x); > } > #else > #include "acosl_freebsd.c" > #endif > > which would definitely avoid edits to the FreeBSD source. Question is, do we really still need this? These #ifdef have been added just as a cheap workaround for small targets, because nobody provided the actual long double implementations, yet. If we merge the actual long double implementations from FreeBSD, there's no need for this anymore and we can probably drop the _LDBL_EQ_DBL flag entirely. If we just merge the long double code from FreeBSD's lib/msun/src into our libm/common dir... > (2) More i386 assembly versions > > Then there appears to be some long double methods for the i386/87 here > which newlib doesn't currently have: > > https://github.com/freebsd/freebsd-src/tree/main/lib/msun/i387 > > Thoughts on adding this long double code from FreeBSD? ...and merge the occasional CPU-specific assembler code from FreeBSD's lib/msun/ into our libm/machine/ dir, that should work nicely. Corinna