Re: [PATCH 0/2] libm/riscv: Fixing machine-specific fma/sqrt
Kito Cheng via Newlib <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <CA+yXCZARaAT6ZgWu=XKzKur_DgkBvCRhY9WE4OM-aE0cXQ61Qw@mail.gmail.com> |
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 <[email protected]> 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. > >