From: 'Rich Felker' <dalias@libc.org>
To: sidneym@codeaurora.org
Cc: musl@lists.openwall.com
Subject: Re: [musl] Hexagon DSP support
Date: Thu, 16 Apr 2020 12:34:45 -0400 [thread overview]
Message-ID: <20200416163445.GX11469@brightrain.aerifal.cx> (raw)
In-Reply-To: <0d3901d6140b$d6e49a30$84adce90$@codeaurora.org>
On Thu, Apr 16, 2020 at 11:26:52AM -0500, sidneym@codeaurora.org wrote:
>
>
> > -----Original Message-----
> > From: Rich Felker <dalias@libc.org>
> > Sent: Thursday, April 16, 2020 10:34 AM
> > To: sidneym@codeaurora.org; musl@lists.openwall.com
> > Subject: Re: [musl] Hexagon DSP support
> >
> > On Thu, Apr 16, 2020 at 11:36:38AM +0200, Szabolcs Nagy wrote:
> > > * sidneym@codeaurora.org <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.
>
> I will add the assembly version for sqrt. There was an issue in qemu when
> using the assembly version but that is fixed. FWIW when I use the soft
> version with clang for hexagon I still see errors, mostly looking for
> INEXACT but not seeing it.
I saw errors that were actual incorrect results not just wrong
exception flags, like:
src/math/ucb/sqrt.h:49: RU sqrt(0x1.fffffffffffffp+1023) want 0x1p+512 got 0x1.fffffffffffffp+511 ulperr -0.250 = -0x1p-1 + 0x1p-2
At least they all seemed to be in non-default rounding modes though so
the impact is low-ish. These are probably all qemu bugs but hard to
say for sure...
Rich
next prev parent reply other threads:[~2020-04-16 16:35 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-15 13:19 sidneym
2020-04-15 16:30 ` Rich Felker
2020-04-15 17:50 ` sidneym
2020-04-15 18:06 ` Szabolcs Nagy
2020-04-15 18:22 ` sidneym
2020-04-16 9:36 ` Szabolcs Nagy
2020-04-16 15:34 ` Rich Felker
2020-04-16 16:26 ` sidneym
2020-04-16 16:34 ` 'Rich Felker' [this message]
2020-04-15 18:26 ` Rich Felker
2020-04-15 19:12 ` sidneym
2020-04-15 19:29 ` 'Rich Felker'
2020-04-30 22:44 ` sidneym
2020-04-30 23:51 ` Rich Felker
2020-05-05 23:37 ` sidneym
2020-05-06 0:59 ` Rich Felker
2020-06-18 16:37 ` sidneym
2020-06-18 21:42 ` Szabolcs Nagy
2020-06-19 21:58 ` sidneym
2020-06-19 22:46 ` Rich Felker
2020-06-20 0:03 ` [musl] strtok Robert Skopalík
2020-06-20 0:15 ` Rich Felker
2020-06-20 0:36 ` Robert Skopalík
2020-06-20 0:46 ` Robert Skopalík
2020-06-20 1:44 ` Rich Felker
2020-06-20 7:07 ` Patrick Oppenlander
2020-06-20 13:00 ` Robert Skopalík
2020-06-22 0:57 ` Bery Saidi
2020-06-20 2:29 ` [musl] Hexagon DSP support sidneym
2020-06-20 3:20 ` Rich Felker
2020-07-20 21:26 ` sidneym
2020-07-23 21:56 ` Szabolcs Nagy
2020-07-24 17:49 ` sidneym
2020-09-16 20:49 ` sidneym
2020-09-17 1:32 ` 'Rich Felker'
2020-09-17 22:31 ` sidneym
2020-09-18 1:08 ` Rich Felker
2020-09-18 8:10 ` Szabolcs Nagy
2020-09-20 13:12 ` sidneym
2020-09-20 17:17 ` 'Rich Felker'
2020-09-21 14:09 ` sidneym
2020-04-15 18:55 ` Fangrui Song
2021-03-09 20:25 sidneym
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200416163445.GX11469@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=musl@lists.openwall.com \
--cc=sidneym@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).