ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libecb/Changes
Revision: 1.49
Committed: Sat Apr 11 03:40:03 2026 UTC (2 months ago) by root
Branch: MAIN
CVS Tags: HEAD
Changes since 1.48: +2 -1 lines
Log Message:
*** empty log message ***

File Contents

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