Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 16 Apr 2020 11:34:03 -0400
From: Rich Felker <>
Subject: Re: Hexagon DSP support

On Thu, Apr 16, 2020 at 11:36:38AM +0200, Szabolcs Nagy wrote:
> * <> [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.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.