about summary refs log tree commit diff
path: root/src/fenv
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-08-27 18:08:29 -0400
committerRich Felker <dalias@aerifal.cx>2013-08-27 18:08:29 -0400
commita543369e3b06a51eacd392c738fc10c5267a195f (patch)
tree7f7b59c2a45d22ad4a3e66774dcc547ae45b06ac /src/fenv
parent06ceee8ca34999c5c35e5dfb85133d4b35c9689b (diff)
downloadmusl-a543369e3b06a51eacd392c738fc10c5267a195f.tar.gz
musl-a543369e3b06a51eacd392c738fc10c5267a195f.tar.xz
musl-a543369e3b06a51eacd392c738fc10c5267a195f.zip
optimized C memset
this version of memset is optimized both for small and large values of
n, and makes no misaligned writes, so it is usable (and near-optimal)
on all archs. it is capable of filling up to 52 or 56 bytes without
entering a loop and with at most 7 branches, all of which can be fully
predicted if memset is called multiple times with the same size.

it also uses the attribute extension to inform the compiler that it is
violating the aliasing rules, unlike the previous code which simply
assumed it was safe to violate the aliasing rules since translation
unit boundaries hide the violations from the compiler. for non-GNUC
compilers, 100% portable fallback code in the form of a naive loop is
provided. I intend to eventually apply this approach to all of the
string/memory functions which are doing word-at-a-time accesses.
Diffstat (limited to 'src/fenv')
0 files changed, 0 insertions, 0 deletions