Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Spell of Mastery Progress

Name: Anonymous 2020-09-17 20:05

Ok. The new voxel rendering algorithm performs 1.4 times faster. Not much, but voxel models can also be split into 16-bit chunks, which locally use only 16-bit addressing. That should speedup the algorithm further, if the bottleneck is with the memory bandwidth.

I've also discovered that GCC's __builtin_popcount is slower than a lookup table, since it branches into subroutine __popcountdi2. Why GCC doesnt use the x86 popcnt opcode? No idea. No idea. But it probably would be easier to answer why Stallman molests little children.

Name: Anonymous 2020-09-21 16:49

Surprisingly the hardest part of working with lex/yacc was location tracking, which is a bit obscure. Even more surprising was discovering that simple SEXP lists from Lisp can be used to hold C/C++ parsed code, although one will have to add a bit of metainfo for holding the locations. At least for my purposes, since I want to modify them. But during writing the actual compiler, one will still need locations to report errors. Like, well, syntax errors. While C++ syntax is notorious for its monstrosity (surpassing even Haskell in difficulty), even the plain C is not context free, since the parser needs access to the context to properly create the aforementioned SEXP.


Anyway, now I can parse structs, typedefs and functions, while skipping the rest of the syntax. That should be just enough to mod the C for my purposes.

$ cat example.c
int foo(int n, int m) {
return n*m+1;
}

enum russia {govna,poesh,suka};

int bar(int n) {
return n+1;
}


$ cat example.c | ../lib/cext
function:
row,col: 1,0
type: int
name: foo
arg0: int n
arg1: int m
function:
row,col: 7,0
type: int
name: bar
arg0: int n



No. I don't need enums.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List