linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] lib/string: optimized mem* functions
@ 2021-06-25  1:01 Matteo Croce
  2021-06-25  1:01 ` [PATCH 1/3] lib/string: optimized memcpy Matteo Croce
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Matteo Croce @ 2021-06-25  1:01 UTC (permalink / raw)
  To: linux-kernel, Nick Kossifidis, Guo Ren, Christoph Hellwig,
	David Laight, Palmer Dabbelt, Emil Renner Berthing, Drew Fustini
  Cc: linux-arch, Andrew Morton, Nick Desaulniers, linux-riscv

From: Matteo Croce <mcroce@microsoft.com>

Rewrite the generic mem{cpy,move,set} so that memory is accessed with
the widest size possible, but without doing unaligned accesses.

This was originally posted as C string functions for RISC-V[1], but as
there was no specific RISC-V code, it was proposed for the generic
lib/string.c implementation.

Tested on RISC-V and on x86_64 by undefining __HAVE_ARCH_MEM{CPY,SET,MOVE}
and HAVE_EFFICIENT_UNALIGNED_ACCESS.

Further testing on big endian machines will be appreciated, as I don't
have such hardware at the moment.

[1] https://lore.kernel.org/linux-riscv/20210617152754.17960-1-mcroce@linux.microsoft.com/

Matteo Croce (3):
  lib/string: optimized memcpy
  lib/string: optimized memmove
  lib/string: optimized memset

 lib/string.c | 129 ++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 112 insertions(+), 17 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-07-01  0:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-25  1:01 [PATCH 0/3] lib/string: optimized mem* functions Matteo Croce
2021-06-25  1:01 ` [PATCH 1/3] lib/string: optimized memcpy Matteo Croce
2021-06-25  5:01   ` kernel test robot
2021-06-25 14:41   ` kernel test robot
2021-06-25  1:01 ` [PATCH 2/3] lib/string: optimized memmove Matteo Croce
2021-06-25  1:02 ` [PATCH 3/3] lib/string: optimized memset Matteo Croce
2021-06-25 17:45 ` [PATCH 0/3] lib/string: optimized mem* functions Nick Desaulniers
2021-06-27  0:19   ` Matteo Croce
2021-07-01  0:29     ` Matteo Croce

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).