|
|
Message-ID: <20260612214341.GK3520958@port70.net> Date: Fri, 12 Jun 2026 23:43:41 +0200 From: Szabolcs Nagy <nsz@...t70.net> To: musl@...ts.openwall.com Subject: using builtins within musl i experimented with using compiler builtins in musl after it was shown that builtin memcpy allows optimising qsort for various element sizes. i expected code gen to get more streamlined. for math functions this mostly works when calls are inlined as single instruction, for string functions cold and hot code should be handled differently ideally, but the compiler does not know the hot calls so it can unnecessarily bloat the code with inlines. i don't know if this is worth it, attached the patches for the record. View attachment "0001-string.h-use-builtin-memcpy-and-memset-internally.patch" of type "text/x-diff" (4300 bytes) View attachment "0002-string.h-use-builtin-memcmp.patch" of type "text/x-diff" (1078 bytes) View attachment "0003-math.h-use-builtin-fabs-and-sqrt.patch" of type "text/x-diff" (20041 bytes) View attachment "0004-math.h-use-builtin-copysign.patch" of type "text/x-diff" (3881 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.