1 |
TODO: naming of cutnions, index_to_coord, xy_to_s, xy_to_linear/seq, 32/64 |
2 |
TODO: returning packed coordinates, really |
3 |
TODO: support order=0? |
4 |
0x0001000c |
5 |
- added ecb_hilbert2d function family. |
6 |
|
7 |
0x0001000b |
8 |
- added ecb_gray*_{de,en}code functions. |
9 |
|
10 |
0x0001000a |
11 |
- added ecb_ptrmix. |
12 |
|
13 |
0x00010009 |
14 |
- added ecb_i2a family of functions. |
15 |
- added ECB_64BIT_NATIVE. |
16 |
|
17 |
TODO: |
18 |
08:30:06 <b_jonas> I think it could be worth to add a macro that works like alignof or _Alignof on sane |
19 |
compilers, and like __alignof on MS compilers that support it, see |
20 |
http://msdn.microsoft.com/en-us/library/45t0s5f4.aspx |
21 |
08:30:24 <b_jonas> even if you can't support it on all the old compilers |
22 |
08:31:17 <b_jonas> I'd also like a macro for alignas, but sadly, that seems impossible in general, because |
23 |
the MS compiler only has some half-attempt to do something similar but with different and |
24 |
more broken semantics, see http://msdn.microsoft.com/en-us/library/83ythb65.aspx |
25 |
08:31:35 <b_jonas> but I wonder if some special case could still be worth to support |
26 |
08:32:23 <b_jonas> probably not, because it would just account to making a union with a highly aligned type, |
27 |
which is something I can do on any compiler portably |
28 |
|
29 |
TODO: #define ECB_IS_INTEGRAL(x) !((1 ? 1 : (x)) / 2) |
30 |
#define ECB_IS_INTEGRAL(x) (sizeof ((x) + 1.0f) != sizeof((x) + 1ULL)) |
31 |
|
32 |
TODO: ecb_minpot, either using bit tricks or ecb_ldXX |
33 |
|
34 |
TODO: __builtin_popcountll exists... |
35 |
|
36 |
TODO: __builtin_powi |
37 |
|
38 |
TODO: https://gustedt.wordpress.com/2010/06/08/detect-empty-macro-arguments/ |
39 |
|
40 |
implement is_constant for c11: https://gustedt.wordpress.com/2013/08/22/testing-compile-time-constness-and-null-pointers-with-c11s-_generic/ |
41 |
|
42 |
#ifdef _MSC_VER |
43 |
|
44 |
#include <stdlib.h> |
45 |
#define bswap_32(x) _byteswap_ulong(x) |
46 |
#define bswap_64(x) _byteswap_uint64(x) |
47 |
|
48 |
#elif defined(__APPLE__) |
49 |
|
50 |
// Mac OS X / Darwin features |
51 |
#include <libkern/OSByteOrder.h> |
52 |
#define bswap_32(x) OSSwapInt32(x) |
53 |
#define bswap_64(x) OSSwapInt64(x) |
54 |
|
55 |
#elif defined(__sun) || defined(sun) |
56 |
|
57 |
#include <sys/byteorder.h> |
58 |
#define bswap_32(x) BSWAP_32(x) |
59 |
#define bswap_64(x) BSWAP_64(x) |
60 |
|
61 |
#elif defined(__FreeBSD__) |
62 |
|
63 |
#include <sys/endian.h> |
64 |
#define bswap_32(x) bswap32(x) |
65 |
#define bswap_64(x) bswap64(x) |
66 |
|
67 |
#elif defined(__OpenBSD__) |
68 |
|
69 |
#include <sys/types.h> |
70 |
#define bswap_32(x) swap32(x) |
71 |
#define bswap_64(x) swap64(x) |
72 |
|
73 |
#elif defined(__NetBSD__) |
74 |
|
75 |
#include <sys/types.h> |
76 |
#include <machine/bswap.h> |
77 |
#if defined(__BSWAP_RENAME) && !defined(__bswap_32) |
78 |
#define bswap_32(x) bswap32(x) |
79 |
#define bswap_64(x) bswap64(x) |
80 |
#endif |
81 |
|
82 |
#else |
83 |
|
84 |
#include <byteswap.h> |
85 |
|
86 |
#endif |
87 |
|
88 |
TODO: generic poprcount etc., also fast_t for them? |
89 |
|
90 |
- allow any rotate count in rcb_rot*, at the expense |
91 |
of bad optimisation results on some platforms or with |
92 |
some word sizes. |
93 |
- try to use inttypes.h on mingw. |
94 |
|
95 |
0x00010008 |
96 |
- aligned/unaligned load/store, bswap, host order |
97 |
conversion. |
98 |
- generic C++ ecb_rot[lr], ecb_popcount, ecb_ctz, |
99 |
ecb_is_pot32 and ecb_bitrev functions. |
100 |
|
101 |
0x00010007 |
102 |
- new ECB_OPTIMIZE_SIZE symbol. |
103 |
|
104 |
0x00010006 |
105 |
- new ECB_MEMORY_FENCE_RELAXED memory fence. |
106 |
- use acquire/eelease memory barriers on sun workshop pro, not read/write. |
107 |
- rely on c++ compiler barriers to do the right thing in gcc/clang. |
108 |
- change release memory fence to memory barrier on ia32/ia64. |
109 |
- apply ctz/ld patch for msc by Zsbán Ambrus. |
110 |
- ECB_PTRSIZE erroneously was 8 on most 32bit systems ( |
111 |
found by Zsbán Ambrus). |
112 |
- improved compiletime detection of endianness, also, allow |
113 |
runtime detection to indicate other-than-big/little endianness. |
114 |
- no memory barrier neded on arm < 6. |
115 |
|
116 |
0x00010005 |
117 |
- improve ecb_binary16_to_float. |
118 |
- add ecb_float_to_binary16. |
119 |
- add ecb_binary16_to_binary32 and ecb_binary32_to_binary16 pair. |
120 |
|
121 |
0x00010001 |
122 |
- add ecb_is_pot32/64. |
123 |
- add intptr_t/uintptr_t. |
124 |
- add ECB_PTRSIZE. |
125 |
- more macros for C/C++ version checks. |
126 |
- support C11 atomics for memory fences. |
127 |
- support gcc-4.7 atomics for memory fences. |
128 |
- support m68k, m88k and sh (patch by Miod Vallat). |
129 |
- add ecb_binary16_to_float. |
130 |
|
131 |
TODO: ecb_restrict_array etc. http://ue.tst.eu/5093eafd713ec5fda776d8065070aa4c.txt |
132 |
TODO: ffs |
133 |
64 bit variants of everything |
134 |
TODO: examples from X for clz/ctz |
135 |
TODO: arithmetic right shift |
136 |
TODO: template/generic functions for x32/x64 and so on |
137 |
TODO: #define ecb_integer_multiples_of(n,d) ((char (*)[d])(n) - (char (*)[d])0) |
138 |
TODO: generalised shift |
139 |
TODO: #define ECB_FAST_UNALIGNED_ACCESS |
140 |
unsigned long gensh(unsigned long v, int x) { |
141 |
int a, b; |
142 |
a = (v << x) & -(((unsigned int)x) < 32); |
143 |
x = -x; |
144 |
b = (v >> x) & -(((unsigned int)x) < 32); |
145 |
return a|b; |
146 |
} |
147 |
|
148 |
TODO: export(=dllexport) & hidden |
149 |
TODO: flatten |
150 |
TODO: warning(msg) |
151 |
TODO: error(msg) |
152 |
TODO: leaf (uh), noclone (hmmm) |
153 |
TODO: nonnull, returns_nonnull |
154 |
TODO: nothrow |
155 |
TODO: used |
156 |
TODO: trap |
157 |
TODO: http://llvm.org/docs/doxygen/html/Compiler_8h_source.html |
158 |
|
159 |
TODO: read/write unaligned macros |
160 |
TODO: htonl and friends |
161 |
TODO: macro to convert from unsigned to signed "the natural way" |
162 |
TODO: ecb_static_assert, with message (just like boost), or somesuch, using array-declaration |
163 |
TODO: alignof |
164 |
|
165 |
|