From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by sourceware.org (Postfix) with ESMTP id 7527B386F424 for ; Fri, 4 Sep 2020 13:12:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7527B386F424 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-559-sOlyeGHqOTqUnS2iJzuNsQ-1; Fri, 04 Sep 2020 09:11:58 -0400 X-MC-Unique: sOlyeGHqOTqUnS2iJzuNsQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B10E680EDA9 for ; Fri, 4 Sep 2020 13:11:57 +0000 (UTC) Received: from calimero.vinschen.de (ovpn-118-162.rdu2.redhat.com [10.10.118.162]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7FFCF1002D65 for ; Fri, 4 Sep 2020 13:11:57 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id A3A86A83A7A; Fri, 4 Sep 2020 15:11:55 +0200 (CEST) Date: Fri, 4 Sep 2020 15:11:55 +0200 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: [PATCH 0/2] libm/riscv: Fixing machine-specific fma/sqrt Message-ID: <20200904131155.GU4127@calimero.vinschen.de> Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: <20200903205433.2108717-1-keithp@keithp.com> MIME-Version: 1.0 In-Reply-To: <20200903205433.2108717-1-keithp@keithp.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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, 04 Sep 2020 13:12:02 -0000 On Sep 3 13:54, Keith Packard via Newlib wrote: > RISC-V has a couple of acceleration paths that are designed to repace > the general code for sqrt and fma. > > The sqrt code was using the wrong filenames and ended up replacing the > wrong functions (sqrt instead of __ieee754_sqrt). For builds that > disabled errno, that code provided an alias for sqrt mapping to > __ieee754_sqrt so things "worked". > > The fma code had the right filenames, but because it only generated > code on machines with hardware support, machines lacking it ended up > replacing the useful general implementation with an empty object file. > > To fix this, I've renamed the RISC-V sqrt files then fixed both sqrt > and fma to #include the general code when the machine-specific code > wasn't used. > > I tested the result by making sure every libm.a generated for RISC-V > contained exactly one of each relevant function. > Pushed. Thanks, Corinna