User Tools

Site Tools


sd:runtime_library_notes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
sd:runtime_library_notes [2026/06/11 02:59] – created appledogsd:runtime_library_notes [2026/06/16 02:51] (current) appledog
Line 17: Line 17:
  
 == Prep Work == Prep Work
-Helper scripts were created this time: ''c2sda'', ''c2ll'', ''ll2sda'' and ''runtests''.+Helper scripts were created this time: ''c2sda'', ''c2ll'', ''ll2sda'' and ''runtests''
 +* Next I had to modify VC-4 to take .sda files at the command line (to speed the dev cycle). 
 +* Next I created the above directory. 
 +* I will have to modify vc4 to look in ~/.vc4 if the files it needs are not in the pwd. 
 + 
 +== Fleshing it out 
 +Many standard implementations reveal deficiencies in instrinfo and iseltargetlowering. 
 + 
 +== Test Suite 
 +I collected all the tests into one file. 
 + 
 +== Roadmap 
 +* putchar.sda (the only assembly only file so far -- similar to tinyc v1) 
 +* print_str 
 +* print_dec 
 +* lib1 (stuff for missing instructions) 
 +* libctype 
 +* libstr 
 +* libstdlib 
 + 
 +then 
 + 
 +* stdint.h, limits.h, stddef.h, stdbool.h 
 +* stdalign/stdnoreturn/iso646 
 +* finish string.h (memchr, strncat, strpbrk, strspn, strcspn, strtok) 
 +* safe-string extras (strlcpy/strlcat, strcasecmp/strncasecmp, memmem), 
 +* div/ldiv, rand/srand, qsort/bsearch, assert.h 
 +* official puts/getchar. 
 + 
 +Roadmap which requires additional development: 
 + 
 +* malloc/free/calloc/realloc 
 +* then strdup/strndup 
 + 
 +Phase III 
 +* stdarg.h for varargs and formatted output. very high value target (enables printf) 
 +* printf/sprintf/snprintf/vsnprintf and sscanf. 
 + 
 +Later: 
 +* compiler-facing primitives LEA, MOVSX, CMOV, get CASETAB to emit. 
 +* 64-bit integers. __muldi3, __udivdi3/__umoddi3, __divdi3/__moddi3. 
 + 
 +Floating Point Roadmap: 
 +* Start writing math.h and see what happens. 
 +* strtod/atof, %f for printf. 
 + 
 +File IO Roadmap: 
 +* fopen/fread/fwrite/fseek/fclose and FILE* streams wrapping *(see INT 15h/OPFS/FCB) 
 + 
 +Other: 
 +* time.h, calendar math, binding time() to the hardware clock 
 + 
 +* Graphics and Sound libraries 
 +* access to PPU and ASU 
 + 
 +== Arena Allocator 
 +"A growable, chunked, monotonic region allocator." 
 + 
 +This is very similar to the NVAR system I wrote for BASIC. Hanson uses "arena" in C Interfaces and Implementations; the academic literature says "region". "Bump allocator" is the name of the mechanism, advancing a pointer within a chunk, but the whole structure, with chunked growth and free-everything-at-once teardown, is the arena.
  
sd/runtime_library_notes.1781146763.txt.gz · Last modified: by appledog

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki