· 8 years ago · Aug 27, 2018, 11:34 PM
1Dale Weiler (313):
2 initial commit
3 Implemented some string library functions, for x86_64, and PowerPC systems.
4 Even faster memcpy for x86_64
5 use register for src32, and dst32 for memcpy, for x86_64, it _could_ fit, inside a SSE register (256 bits)
6 Optimized memcpy to use SSE for x86_64, added optimized strlen ( also using SSE, for x86_64 )
7 Cleaned up, and reworked ccaprice. The following stuff is now implemented memcpy(), memmove(), strncpy(), strcpy(), strncat(), strcat(), memcmp(), strncmp(), strcmp(), memchr(), strchr(), strlen().
8 Implemented SSE version for memchr, to use #define STRING_MEMCHR_SSE. Also implemented CCAPRICE_BSF_TABLE_EXPAND ( this will expand 256 number ( for use with an array / table ) ) as a fast and portable way to to bsf() -- GCC has a __builtin_ctz which could be used ( possibly consider using this in the distant future if this method becomes a mess to maintain )
9 Implemented SSE free ( yet highly optimized strlen as default, to use SSE version #define STRING_STRLEN_SSE )
10 Implemented SSE memcpy (#define STRING_MEMCPY_SSE to use)
11 Reworked various optimized routines
12 Implemented fast memset for x86_64, and x86 platforms ( x86_64 memsets at 8-byte size chunks, x86 memsets at 4-byte size chunks )
13 Implemented signal.h and assert.h
14 Implemented signal.h and assert.h
15 Implemented atexit(), exit(), abs(), and cleaned up assert.
16 we now have working entry support, and exit support, you can now create an int main() and compile with -nostdlib and -ffreestanding and just LINK in ccaprice and your application will run and RETURN. Implemented a very basic memory manager too with malloc and free. for <string.h> strdup() is now wrote. Rewrote abort to use raise(SIGABRT) (is this how C mandate it? Need to check up the standard docs).
17 Implemented strpbrk
18 Implemented atoi and cleaned up things.
19 Implemented proper system call system, portable sorta, assembly had to be used for this sadly. With a `ccaprice_syscall` function now wrappers can be made for open(), close(), read() and others.
20 Proper assertion system, now can raise() via syscall.
21 Implemented proper syscall wrappers. write(), read(), open(), kill(), getpid(), _exit() implemented -- not in accordance with <unistd.h> standard however. Added test.c test program.
22 Removed file not required.
23 Implemented puts(), rewrote test program to use it instead.
24 Make puts more standard.
25 Implemented fputs(), puts() now uses it.
26 Implemented fclose(), fopen(), fwrite(), fputs(), fputc().
27 Fixed fclose()
28 free allocated memory for file pointer on fclose()
29 Buffered filestrem system. Implemented brk() syscall
30 Added all new fclose(), fflush(), fopen(), fputc(), fputs() and fwrite() functions/files.
31 Removed object files.
32 Buffered puts(), and fputs().
33 Documentation for some functions, cleanups, more stdio file buffering.
34 Implemented feof()
35 Implemented ferror().
36 Implemented <stdarg.h> uses gcc builtin if GCC is detected at preprocess time, otherwise it uses a hack stack-hack method to obtain arguments. Also rewrote fopen() to be more standard conformant, now you can actually pass it modes like "rb", "rw", "w" etc etc.
37 Implemented ccaprice_malloc_brk() syscalls for i386(and i386 like CPUs i.e all X86 primarly), as well as x86_64 support too. malloc() now works as expected.
38 syscall cleanups
39 Cleanups
40 Added license headers.
41 use char* for va_list on compilers where no __builtin_va_* exists opposed to unsigned char *. Shuts the compiler up about sequence points.
42 Fix offsetof for gcc too.
43 Use CCAPRICE_INTERNAL_FUNC macro for external functions.
44 Implemented calloc()
45 Implemented support for O_LARGEFILE on i386 / 32bit systems. Fixed i386 assembly error.
46 Fixed atexit() system; still slightly broken in respect to stdout/stdin being invalid after main returns for exit() to perform proper return with status. Objects need to be re-pointed to fix this issue (this should not be required, going to check C90 standard on this, could be a compiler bug).
47 Fixed stack alignment issyes for SSE optimized library routines. This was a really annoying bug. GCC Y U NO ALIGN 4 ME?!
48 Cleanups
49 more cleanups
50 Cleanups and proper organization.
51 Implemented EXIT_SUCESS and EXIT_FAILURE
52 Implemented <iso646.h>
53 Less hack, moved stack-alignment code to assembler files.
54 Implemented argc and argv support for main.
55 use <sys/syscalls.h> for better portabilty. Remove brk syscall -- not required this is deprecated anyways even in linux.
56 BSD fixes
57 Fixed syscalls for freebsd i386
58 FreeBSD fixes
59 Opps this should fix FreeBSD remember C calling convention is reverse of stack order.
60 How about this?
61 This should fix FreeBSD for i386.
62 Fix FreeBSD
63 Store data into registers so FreeBSD does not segfault on memory access violations.
64 No need to movl, already movl.
65 Work?
66 Fix sbrk for FreeBSD
67 Attempt #lost-count-of-attempts, at fixing FreeBSD i386 syscalls.
68 FreeBSD syscall i386 fix code binge again. I'm starting to understand what it's like to be a masochist.
69 FreeBSD stack alignment issues.
70 WORK!
71 This has to work.
72 Freebsd needs stub with return after int $0x80
73 Use SYS_break even for linux. BSD does not define SYS_brk.
74 Fixed ccaprice_runtime_brk for FreeBSD.
75 Fixed typo.
76 Fix ccaprice_runtime_brk for FreeBSD.
77 FreeBSD fixes.
78 I'm really, really, really, tired.
79 >_>
80 This is a more direct approach at fixing FreeBSD.
81 0777 for open() always!
82 Onlt use OPTIMAL paths if SSE2 is found.
83 Fix SSE2 issues.
84 Restore test
85 Fix SSE2 issues on X86 systems with no SSE2.
86 SSE2 Finally Fixed
87 Use standard system header files. Thsi fixes all problems with type name clashing and is more portable.
88 strlen SSE will work on X86 too, use it if SSE2 is enabled, otherwise use GPR optimized path.
89 Less verbose
90 Implemented SUSv[1-3] conformant errno system. Implemented <errno.h> too.
91 Implemented standard posix <sysexit.h>
92 <sysexit.h> Whitespace.
93 Implemented <ctype.h> and working default C_locale.
94 Fix locale bug, use internal locale-function for tolower() and toupper(). Don't use currently selected locale.
95 Swap toupper() and tolower(), add test.
96 Implemented <locale.h> and struct iconv.
97 update locale documentation.
98 updated locale documentation.
99 Implemented LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME constants to <locale.h>
100 whitespace
101 whitespace
102 Implemented en-US locale
103 Implemented setlocale(), and localeconv().
104 Moved signal code to src/signal.c
105 Implemented support for syslog code page specific locale files.
106 ASCII codepage ISO8859-1 does not require a dot tag according to the standard.
107 Implemented en_CA locale.
108 License header.
109 Wrote features.txt
110 add calloc() to features list
111 make <iso646.h> C++ safe
112 Fix feature list typo.
113 Split up string utility functions into seperate sourcecode files for better managability.
114 Implemented strstr(). Fixed locale link issues, locale files don't need include guards.
115 Updated feature list
116 search replace fail
117 Implemented fast strspn() and strcspn(), traverse at O(n+m) thanks to Richard A. O'Keefe.
118 Remove useless cast
119 Updated feature list
120 C standard says default locale needs to have '-' as negative_sign for lconv.
121 Implemented getenv(), and envp[] for int main().
122 Update feature list
123 Implement en_AU locale.
124 Update feature list
125 Fixed locale issues. and strcmp().
126 return null on bail for locale from getenv("LANG") if not found after drastic search.
127 Slightly faster abs()
128 update feature list.
129 Implemented srand() and rand(), naive basic implementation, as well as a fast SSE2 optimized routine that inlines well.
130 Cleaner
131 branchless abs(), MIN() and MAX()
132 Protect the macros
133 whitespace
134 Cleanups
135 Updated feature list
136 Updated feature list
137 More errno code.
138 whitespace
139 Fixed branchless MIN/MAX
140 Use _mm_cvtsi128_si32 for SSE2 rand() instead of _mm_storeu_si128
141 Updated Makefile for optimizations. Updated feature list (now contains more information)
142 Implemented locale specific selection for ccaprice compile options. -DCCAPRICE_LOCALE_SET=en_US will set the locale to build ccaprice with ONLY en_US locale support. If CCAPRICE_LOCALE_SET is not found all locales implemented for ccaprice are compiled in with ccaprice (this could make the library really large, it's encouraged you specify a locale)
143 Fix MIN/MAX
144 Make platform neutral SIGNEXTEND
145 Modified makefile use -fno-strict-aliasing. Fixed clean: label, now removes all architecture object files regardless of the target set in enviroment.
146 fix brk() on freebsd attempt #1
147 Fix SIGPOLL issue on FreeBSD
148 Fix operand mismatch selection
149 Fixes
150 Remove manual segfault code.
151 Fixed freebsd runtime brk()
152 Whitespace
153 Fix missing $ for base 16 assembly constant.
154 Fix that
155 Fix FreeBSd attempt #3
156 Why did I not think of this before?
157 Er, forgot the address
158 haha
159 Thsi should fix FreeBSD once and for all.
160 SYS_BRK
161 more colons
162 0 > 1 on FreeBSD
163 Better compiletime assert?
164 Less macro confusion
165 0 goes to EAX anyways, no need to manual MOV it.
166 OOPS
167 whitespace
168 Fix Makefile to use $(CC) if on FreeBSD
169 Use $(CC) everywhere
170 Try this?
171 GLOBALIZE
172 BSD globalize ccaprice_syscall_bsd
173 WORK?
174 HERP
175 This might work?
176 How about this?
177 Implemented <math.h> functions [abs(), fabs(), finite(), isnan()] -- based on fdlibm.
178 Implemented frexp()
179 All x86/x86_64 cpu's are little endian.
180 Implemented __umoddi3 and __udivdi3 for i386 (64 bit modulo and division not supported by the hardware directly). Implemented primitive basic printf() for now. Rewrote test.c to actually do testing. also implemented ilogb() for <math.h>
181 HURRR
182 HURRR x2
183 Fixes BSD againz
184 Fixz the BSD demons.
185 use -DBSD for AFLAGS if system is FreeBSD
186 Implemented ceil().
187 Implemented floor()
188 Fixed %x and %u for printf()
189 Print assertion diagnostic on assertion expression failure.
190 Implemented atan() <math.h>
191 Whitespace.
192 Added M_1_PI, M_2_PI, M_E, M_EULER, M_PI, M_PI_2, M_PI_4 math constants.
193 Fix header inclusion issues
194 Fixed all headers to be more standard conformant (C standard says stdlib headers cannot include other stdlib headers). Doing this deemd troublesome for ctype.h where locale.h code heavily required interdeps; since the two pieces of code shared typenames defined by a structure. The solution to this required type transparency, and a map layout of how ctype.h functions would work (which locale alreay had well defined), the solution is highly simple in design, but complex by nature.
195 Rewrote brk() for BSD. This is per spec with BSD documents.
196 #include <sys/syscall.h> on BSD for runtime assembly so SYS_break is defined.
197 Fixes
198 redundant caprices
199 EH
200 Forgot to movl minbrk
201 Cast address to (unsigned long) for ccaprice_syscall_brk on BSD
202 Fixed sbrk() for BSD
203 FUNC
204 Basic attempt, might work.
205 runtime_sbrk() for BSD
206 Ooops
207 Try this?
208 Implemented strerror()
209 Fixed typo
210 The one and only C library with M_TAU.
211 Fixed file IO bug, fixed strerror include. Implemented remove(). Improved test output.
212 Pretty fly for a test guy.
213 Fixed implicit declration of function 'unlink' warnings.
214 Made Makefile more fancy.
215 Remove $(RED)
216 Fixed compile warning.
217 Added roadmap
218 Complicated Makefile voodoo magic.
219 Makefile fix
220 Implemented compile-time constants for CCAPRICE_BUILD_DATE, CCAPRICE_BUILD_INFO, CCAPRICE_BUILD_COMP (compiler used to build ccaprice). Made makefile smarter to allow more selection
221 Fixes
222 Implemented support for compiling with EkoPath/PathScale compilers. Implemented automatic architecture discovery so -DCCAPRICE_TARGET_X86 doesn't have to be passed whenc compiling with ccaprice.a
223 Lets not support tinyc compiler (It doesnt work right since it can't do clobered registers in inline asm)
224 Fixed issue with CCAPRICE_BUILD_COMP extension
225 Implemented strrchr. Implemented posix strings.h (bcmp, bcopy, bzero, ffs, index, rindex, strcasecmp, strncasecmp). Implemented ioctl syscall; <sys/ioctl.h> works out of the box with it.
226 Implements posix <cpio.h> and <tar.h>
227 Implemented strtok(). Rewrote entire test runner suite.
228 Updated features
229 Fix test suite runner warnings
230 Extensionize MIN/MAX (these are not part of the standard). Updated features. Closer matching terminal edge for test runner.
231 Standard headers can't include other standard headers (with exception to stddef.h for string.h)
232 Fix memcpy, and memchr.
233 Fixed all test failures. Added 'test' target to makefile.
234 Better makefile rules.
235 Fixed all type issues. We do not include any C standard header from the host machine anymore. All we rely on is <sys/types.h> now.
236 Smarter <stddef.h>
237 Fixes, better preprocessing, others.
238 Implemented offsetof().
239 Fix stupid include directive
240 Fix for inclusion molestation by system headers that ignore the rules.
241 Hardcoding macros.
242 Implemented support for selecting proper OS designation during compilation OS=[WIN/BSD/LINUX] ( Windows support doesnt exist, it's just there as a convience later ). Implemented CCAPRICE_BUILD_HOST ( returns a string literal of the OS the library was compiled on ).
243 Makefile color fix
244 Added posix tests. Fixed cross compilation issues. Makefile is getting smarter.
245 Implemented <stdint.h>. Cleanups, perliminary OSx and Windows support.
246 More Windows stuff.
247 Better makefile flags
248 Makefile fixes, stdarg fixes (some compiler toolchains like mingw insist on including stdarg.h out of the box)
249 Fixed clean target in makefile to delete ccaprice.lib (windows build) even if OS=WIN is not passed to make when invoking clean.
250 Removed Roadmap file
251 Windows LARCH is i386pe
252 $(OUT) for linking library.
253 Fix entry fiel for windows.
254 Smarter entry point for assembly code.
255 Implemented fast qsort() Generates a median-of-three decision tree to do sorting on base elements when they're in the upper eight-region, anything in the lower eight-region is sorted using insertion sort. median-of-three decision is used to determine pivot elements, this reduces the probability of selecting a bad pivot value or an already selected one (prevents extraneous comparisons). Stack space is used to speed up sorting. Large sub-partitions are pushed on to the stack before others to allow sorter to work on smaller (lower-eight) partitions first, this guarantees no more than O(1) stack space. All swapping and stack manipulation does not add function call overhead as these are implemented as macros for ensured inline-ability. To speed up insertion sort the smallest Nth element is found first, which is found by a pre-unrolled loop for optimal performance. All internal swapping carried out by the sorter is optimized using a fall-through switch statement for lower-eight region data, and a duffs-device for upper eight-region data. Space allocation is fast (stack space only), no dynamic memory allocation occurs PERIOD. Performance is better than tradition quicksort: worst case performance is O(n) best case performance is O(n) worse case space complexity O(1).
256 Implemented bsearch().
257 Faster memcpy for systems where rep movsb is not optimized to microcode. Linus Torvalds says that Intel Atoms don't like rep movsb at all, he also says that if you expect any performance out of an Atom you should get your head examined. We can take advantage of SSE here (sadly using intrinsics doesn't produce the same quality code as hand-optimized assembly). This implementation is mostly slower on desktops use -DSTRING_MEMCPY_MICROCODE to take advantage of microcode optimized path. I'm contemplating if SSE or microcode path be used as default.
258 Rewrote malloc, calloc to take advantage of SYS_brk instead of SYS_sbrk. Allocation is now done using the ccaprice_syscall_core instead of hand-wrote inline assembly. This fixes malloc on FreeBSD forever.
259 Fix malloc.
260 Implemented <float.h>
261 Implemented fully ISO conformant <fenv.h> feclearexcept, feraiseexcept, fegetexceptflag, fesetexceptflag, fetestexcept, fesetround, fefetround, fegetenv, feholdexcept, fesetenv, feupdateenv all implemented. Cleaned up some #define's for <string.h> functions like memcpy, and strlen. Reworked Makefile for src/fenv, added coments to explain how the build system works.
262 Some symlinks from inc/posix.
263 Implemented acos(double) [for softfpu] and sqrt(double) [builtin] for <math.h>. Optimized qsort slightly more via loop unrolling up to 16x.
264 Some more <math.h> changes. Makefile rewrite (this one is much stabler and more intellegent, it figures out your host architecture, and OS if one isn't specified, and allows you to override for cross compilation.)
265 s/SYS_brk/SYS_BRK/
266 Fix atoi()
267 fix window focus.
268 Fix udivdi3 for x86_32
269 Fix udivdi3
270 Fixed udivdi3
271 Smarter Makefile, now detects endianess and writes out info (during compilation) describing if the endianess is supported by the library.
272 Copyright update
273 Removed old targets.
274 Remove unrequired constants.
275 Implemented <limits.h>
276 LDBL_MIN, LDBL_MAX, LDBL_EPSILON, LDBL_MANT_DIG, LDBL_MIN_EXP, LDBL_MAX_ESP, LDBL_FIG, LDBL_MIN_10_EXP, LDBL_MAX_10_EXP, FLT_ROUNDS implemented for <float.h>
277 Cooler makefile stuff, fix _MM_MALLOC_H_INCLUDED stuff for my system (cannot gurantee others) ccaprice will provide it's own to combat this stupidity.
278 s/endiannes/endianness/
279 Makefile changes and a README
280 Make all headers and code namespace safe in accordance with ANSI C.
281 Better README, README->README-CODE (code README)
282 README fixes
283 README fixes
284 s/\t/ /
285 Indenting
286 Take note people, when using multiple editors indenting finds a way to make your code a mess :3
287 Fix 32bit ccaprice_syscall_core
288 Implemented C11 <stdnoreturn.h>
289 Update README
290 Merge branch 'master' of github.com:graphitemaster/ccaprice
291 More conformant signal.h code
292 s/\t/ /g on all files, implemented <mmintrin.h>, <xmmintrin.h> and <emmintrin.h> (MMX, SSE, and SSE2) headers (for clang and gcc)
293 Removed clutter
294 Update README-CODE
295 pathscale builds work, fixed all build issues, all works!
296 Basic changes (force limits.h to read as C header by ohloh)
297 More makefile awesomeness
298 auto-selection of $(CC) is CCC is not specified
299 make CC=? will now work since the $CC->$CCC override (think of $CCC as the internal magic) at least this way export CC=other-compiler will be caught, and make CC=* as well as make CCC=* will work.
300 derp
301 Proper stripping: dance, tease, take off clothing sensually, and volia hardlink
302 Implemented mm3dnow.h internal intrinsics for gcc/clang (also pathcc which is backwards compatible with gcc stuff)
303 Update README-CODE
304 hardlinks int/* inc/*
305 hardlinks to softlinks
306 s/inc./inc\//g rename
307 ohloh read this properly now
308 TYPO
309 Better fenv architecture code (faster for x86_64, more correct for all)
310 look good, but not in my editor :(
311 Implemented <setjmp.h> (longjmp, setjmp, jmp_buf) for x86_32, and x86_64
312 _mm_stream_si64 fix
313 Implemented fully functional, fully conformant, and fully threadsafe allocatorallowing multiple heaps. Some things need to be fixed around the corners but it's legal to say realloc(), calloc(), malloc(), and free() are functional and portable!
314 actually invoke the calloc test in the test runner
315
316Steven Braeger (1):
317 Fixed makefile