From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 32165 invoked from network); 16 Apr 2020 15:34:19 -0000 Received-SPF: pass (mother.openwall.net: domain of lists.openwall.com designates 195.42.179.200 as permitted sender) receiver=inbox.vuxu.org; client-ip=195.42.179.200 envelope-from= Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with UTF8ESMTPZ; 16 Apr 2020 15:34:19 -0000 Received: (qmail 5871 invoked by uid 550); 16 Apr 2020 15:34:17 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 5851 invoked from network); 16 Apr 2020 15:34:16 -0000 Date: Thu, 16 Apr 2020 11:34:03 -0400 From: Rich Felker To: sidneym@codeaurora.org, musl@lists.openwall.com Message-ID: <20200416153403.GS11469@brightrain.aerifal.cx> References: <000a01d61328$7f2614b0$7d723e10$@codeaurora.org> <20200415163015.GG11469@brightrain.aerifal.cx> <029101d6134e$56d4ece0$047ec6a0$@codeaurora.org> <20200415180620.GA23945@port70.net> <02b601d61352$d3d8b8d0$7b8a2a70$@codeaurora.org> <20200416093637.GB23945@port70.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200416093637.GB23945@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Hexagon DSP support On Thu, Apr 16, 2020 at 11:36:38AM +0200, Szabolcs Nagy wrote: > * sidneym@codeaurora.org [2020-04-15 13:22:29 -0500]: > > > sqrt/sqrtf should work too (you may want to implement them if there is a > > > single instruction) other math failures are not target specific. > > > > In fact that does go away if I used the hardware accelerated routine that is > > part of compiler-rt.builtins (__hexagon_sqrt) Creating an explicit > > reference to compiler-rt-builtins vs just copying the assembly, which is > > preferred? > > the preferred is like on other targets an inline asm block. > i think using __builtin_sqrt may be fine too if you know that > all hexagon compilers support that and doesnt generate an > actual sqrt call (e.g. on gcc that needs -fno-math-errno). __builtin_sqrt is explicitly allowed to compile to an external call to sqrt (at compiler discretion), and thus can't be used to implement the sqrt function. If you're implementing a native sqrt it should be inline asm. But the C sqrt should work too. If it's not working that indicates a bug in the compiler, in the code in musl, or in qemu, and whichever it is we should track that down and get it fixed. Rich