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