From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by sourceware.org (Postfix) with ESMTPS id 9E5E43857C74 for ; Fri, 4 Sep 2020 03:07:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9E5E43857C74 Received: by mail-wm1-x343.google.com with SMTP id v4so4692094wmj.5 for ; Thu, 03 Sep 2020 20:07:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=B839hnxcPmc5p1/EgBbHcXFs0bWPHgy9RZuBHrjSt7A=; b=YH3U6azikMn52HwDng6aVg2vdb0l6IzEpgOoRdIQ1p54PZkQYWNula3eCt+lDo5Lrw 6WRmBHhfWlUcT5J98V/bcI7I0IGfyTDIwdyKh+VmAd0MC3nlD8pp/10yNvNfRxZI+5mE 1bh4fxxD7kyfgevQo+Yug8B4FEoxUeO5g9twPkRHzlJD3Zrymy79gFeW0WnZaKWUr9kh RnVZM93Okty9i7osf6bqdYn+eiYk+el1crWKuvkKZMrCYZrWZapp3gdZDZQF6W7omvoG eeKKKrcnKVF3KvUN3oOvgflh+ddY7S+gaqaSGmPHIks44pMiW23bnUJvaMmp35Fzft52 CaUw== X-Gm-Message-State: AOAM532zksdvbg8E0vQkXHWo0+qM0iaG+VvwkMqd2KuLv6GXis+hoJCr xHqnjd9PanLoVxK15rReyt1KymzEKbt31W6Uw1ASGU0+r+s= X-Google-Smtp-Source: ABdhPJxSz3oKU52nHcl79ARUfL63jir+9mi+8I7iXlWuCZsV4+LrnB96slFX37Sttqy1FLFmICk+L09ZyX0z8pYw3O0= X-Received: by 2002:a1c:7215:: with SMTP id n21mr2099127wmc.154.1599188853233; Thu, 03 Sep 2020 20:07:33 -0700 (PDT) MIME-Version: 1.0 References: <20200903205433.2108717-1-keithp@keithp.com> In-Reply-To: <20200903205433.2108717-1-keithp@keithp.com> From: Kito Cheng Date: Fri, 4 Sep 2020 11:07:22 +0800 Message-ID: Subject: Re: [PATCH 0/2] libm/riscv: Fixing machine-specific fma/sqrt To: Keith Packard Cc: Newlib Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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 03:07:36 -0000 Hi Keith: Thanks! and it's LGTM. Seems like those issues can't be captured by GCC testsuite, I should add more tests to my regular patch review test list :) On Fri, Sep 4, 2020 at 4:55 AM 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. > >