Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240626152547.GL10433@brightrain.aerifal.cx>
Date: Wed, 26 Jun 2024 11:25:47 -0400
From: Rich Felker <dalias@...c.org>
To: Thorsten Glaser <tg@...bsd.de>
Cc: musl@...ts.openwall.com
Subject: Re: roundf() (and round(), and ...)

On Wed, Jun 26, 2024 at 03:43:27AM +0000, Thorsten Glaser wrote:
> Markus Wichmann dixit:
> 
> >memcpy() is special, in that GCC reserves the right to create calls to
> >it (and memmove(), memcmp(), and memset()) even in freestanding mode. It
> >doesn't do that for any other builtin.
> 
> But not to replace code that implements a memcpy, only to implement
> things like struct copying.

FWIW "struct copying" (with __may_alias__ attribute) is, or would be,
a reasonable way to write a portable "efficiently copy blocks of the
middle at a time" part of memcpy -- outsourcing the strategy for doing
so to the compiler's logic for what insn patterns are efficient.

Unfortunately you can't because it will just emit a call to memcpy on
many archs.

Rich

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.