ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libecb/Changes
Revision: 1.38
Committed: Wed Mar 23 09:58:06 2022 UTC (2 years, 2 months ago) by root
Branch: MAIN
Changes since 1.37: +3 -0 lines
Log Message:
*** empty log message ***

File Contents

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