From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17328 invoked from network); 4 Sep 2021 13:56:50 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 4 Sep 2021 13:56:50 -0000 Received: (qmail 30491 invoked by uid 550); 4 Sep 2021 13:56:47 -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 30471 invoked from network); 4 Sep 2021 13:56:46 -0000 Date: Sat, 4 Sep 2021 15:56:22 +0200 From: Ismael Luceno To: musl@lists.openwall.com Cc: Jeffrey Walton Message-ID: References: <4e37b6c4.19be.17b8bc750df.Coremail.13824125580@163.com> <20210828195330.GZ13220@brightrain.aerifal.cx> <20210828203431.GA13220@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210828203431.GA13220@brightrain.aerifal.cx> Subject: Re: [musl] Why the musl libc did not support neon simd acceleartor officially on mem* operations? On 28/Aug/2021 16:34, Rich Felker wrote: > On Sat, Aug 28, 2021 at 04:27:49PM -0400, Jeffrey Walton wrote: > > On Sat, Aug 28, 2021 at 3:53 PM Rich Felker wrote: > > > > > > On Sat, Aug 28, 2021 at 04:01:40PM +0800, tugouxp wrote: > > > > HI guys: > > > > I found that the current implmention of musl arm port memcpy.S and > > > > other mem*.S operations did not use arm neon instructions, this > > > > seems differenct with other counterparts like newlibc, glibc and > > > > bonic libc, which all impl. the neon version of mem* operations. so > > > > could you tell me why? is there and concern about on this in musl? > > > > if i want to imple my self imple. how to do this, is there any > > > > matual pathches to use? > > > > > > Generally we don't have any significant asm implementations that > > > depend on non-baseline extensions to the ISA. The same is true for x86 > > > where no sse/avx is used. > > > > Out of curiosity, does anyone use Hardware Capabilities > > (https://linux.die.net/man/8/ld-linux) nowadays? Something like a > > /usr/lib/musl, /usr/lib/sse/musl, /usr/lib/avx/musl, > > /usr/lib/neon/musl, etc? > > > > The benefit to using it is no runtime switching. The switching occurs > > at load time, not runtime. > > No, this is a really really bad way to do it. It's not compatible with > static linking and greatly increases startup overhead finding the > right libraries (leading to glibc recently redesigning how they do > it). > > > I know of a handful of libraries that could benefit from the speed up > > on a critical path with an arch specific implementation. But I think > > most libraries don't need it. > > If you really need this, assuming your distro/package installation > system knows what specific ISA extensions you want it could just > install suitable alt packages, *or* install both and edit the > ld-musl-$(ARCH).path file (or do boot-time symlink or bind mount > stuff, etc.) to make the desired ones available. > > Rich It might be interesting to use the dynamic linker to implement this, by switching the symbols depending on some link-time test, which could be provided by the library in a special function symbol (is __init too late?). I'm interested in rewriting these functions...