Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 20 Jul 2020 16:26:58 -0500
From: <sidneym@...eaurora.org>
To: "'Rich Felker'" <dalias@...c.org>
Cc: <musl@...ts.openwall.com>,
	"'Szabolcs Nagy'" <nsz@...t70.net>
Subject: RE: Hexagon DSP support



> -----Original Message-----
> From: Rich Felker <dalias@...c.org>
> Sent: Friday, June 19, 2020 10:21 PM
> To: sidneym@...eaurora.org
> Cc: musl@...ts.openwall.com; 'Szabolcs Nagy' <nsz@...t70.net>
> Subject: Re: [musl] Hexagon DSP support
> 
> On Fri, Jun 19, 2020 at 09:29:04PM -0500, sidneym@...eaurora.org wrote:
> >
> >
> > > -----Original Message-----
> > > From: Rich Felker <dalias@...c.org>
> > > Sent: Friday, June 19, 2020 5:46 PM
> > > To: sidneym@...eaurora.org
> > > Cc: 'Szabolcs Nagy' <nsz@...t70.net>; musl@...ts.openwall.com
> > > Subject: Re: [musl] Hexagon DSP support
> > >
> > > On Fri, Jun 19, 2020 at 04:58:53PM -0500, sidneym@...eaurora.org
> wrote:
> > > >
> > > > > -----Original Message-----
> > > > > From: Szabolcs Nagy <nsz@...t70.net>
> > > > > Sent: Thursday, June 18, 2020 4:43 PM
> > > > > To: sidneym@...eaurora.org
> > > > > Cc: musl@...ts.openwall.com
> > > > > Subject: Re: [musl] Hexagon DSP support
> > > > >
> > > > > * sidneym@...eaurora.org <sidneym@...eaurora.org> [2020-06-18
> > > > > 11:37:05
> > > > > -0500]:
> > > > > > I attached the updated REPORT with warning output disabled, -w
> > > > > > and -fno-rounding-math (See
> > > > > > https://bugs.llvm.org/show_bug.cgi?id=45329)
> > > > > > along with the patch.  I've rebased a couple of times without
> > > > > > any conflicts and the git repo is here:
> > > > > > https://github.com/quic/musl/tree/hexagon
> > > > >
> > > > > the fmal failures are a bit concerning:
> > > > >
> > > > > fmal should be a tail call to fma if long double has the same
> > > > representation as
> > > > > double. (can you please verify this? there should be a single
> > > > > branch
> > > > instruction
> > > > > in fmal)
> > > > >
> > > > > there are no fma failures with the same tests so fmal should
> > > > > work fine
> > > > too.
> > > >
> > > > In the case of fma the selected function comes from
> > compiler-rt-builtins.
> > > > It looks like since fmal calls fma within the context of the
> > > > c-library the c-library's version is branched to.
> > >
> > > Are you talking about how libc-test was built or how musl was built?
> > > This kind of replacement is not valid in either place. musl is built
> > > with
> > -
> > > ffreestanding, and libc-test is expected to be built with
-fno-builtin.
> > >
> > The link order is the reason.  The clang driver places
> > -lclang_rt.builtins-hexagon ahead of -lc and it happens that this
> > library includes an implementation of fma.  I think fma is something
> > that was introduced in error in compiler-rt.builtins because hexagon
> > is the only arch that has it.
> 
> Yes, that's a bug. compiler-rt cannot define libc functions.

I removed fma/fmal/fmax/fmin/fabs from compiler-rt-builtins,
https://reviews.llvm.org/D82263
The comparison with musl can be found here:
https://github.com/quic/musl/compare/hexagon but I've also attached the
patch.

An assert in clang when building both musl and libc-test for hexagon was
fixed by, https://reviews.llvm.org/D80952 prior to this change
-frounding-math had to be used.

The test-results are also attached.  Everything is built with the
tip-of-tree llvm so sometimes results vary but these are the results I got
from this morning's clone.  The only notable difference in the results would
be that both fma and fmal fail and this is because of the compiler-rt
change.  I didn't add fma to musl because it require more complex assembly,
along the lines you saw in an earlier version with sqrt. 

Thanks for reviewing.


> 
> Rich

Download attachment "Add-Hexagon.diff" of type "application/octet-stream" (41606 bytes)

Download attachment "REPORT" of type "application/octet-stream" (439434 bytes)

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.