Branch: Tag:

2016-12-31

2016-12-31 17:12:22 by Arne Goedeke <el@laramies.com>

New byte buffer

This new byte buffer implements a simple dynamic buffer. It aims to

* Provide a clean API.
* Convince the compiler to generate good code. In particular it tries
to avoid unnecessary loads and stores which are otherwise generated
due to the C aliasing rules. This is done using the STATIC_ASSUME(X)
macro, which declare !X as unreachable.
* Have the fast path (when the buffer has enough space) completely
inlined to allow the compiler to batch single byte writes to the
buffer into larger stores.

2288:   TEST_BUILTIN(__builtin_ia32_rdrand64_step,[&foo])      TEST_BUILTIN_VOID(__builtin_unreachable,[]) + TEST_BUILTIN_VOID(__builtin_assume,[])   TEST_BUILTIN(__builtin_memset, [&foo,0,0])   TEST_BUILTIN(__builtin_clz, 23)   TEST_BUILTIN(__builtin_clzl, 23)