mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-21 03:00:35 +00:00
5b4dd683cb
These are the 64-bit equivalent of htonl() and ntohl(). They're a bit tricky in order to avoid expensive operations. The principle consists in letting the compiler detect we're playing with a union and simplify most or all operations. The asm-optimized htonl() version involving bswap (x86) / rev (arm) / other is a single operation on little endian, or a NOP on big-endian. In both cases, this lets the compiler "see" that we're rebuilding a 64-bit word from two 32-bit quantities that fit into a 32-bit register. In big endian, the whole code is optimized out. In little endian, with a decent compiler, a few bswap and 2 shifts are left, which is the minimum acceptable. |
||
---|---|---|
.. | ||
accept4.h | ||
appsession.h | ||
base64.h | ||
buffer.h | ||
cfgparse.h | ||
chunk.h | ||
compat.h | ||
compiler.h | ||
config.h | ||
debug.h | ||
defaults.h | ||
epoll.h | ||
errors.h | ||
hash.h | ||
memory.h | ||
mini-clist.h | ||
namespace.h | ||
rbtree.h | ||
regex.h | ||
sessionhash.h | ||
splice.h | ||
standard.h | ||
syscall.h | ||
template.h | ||
ticks.h | ||
time.h | ||
tools.h | ||
uri_auth.h | ||
version.h |