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-10-12 22:40

Implemented auto keyword. Which make declaration type be the type of its initializer.

Here is the code handling auto vars:
static void pg_decl(cnode_t *n) {
cnode_t *type = n->head;
cnode_t *vars = n->tail;
cnode_t *s = is_struct(type);
if (s) {
pg_struct(s, type, vars);
} else {
indent(); log("vars:\n");
if (type->id==N_TYPE_STOR && type->head->id == (AUTO|N_TERM)) {
cnode_t *expr = vars->head->tail;
sym_t *s = pg_declof(expr);
if (!s) goto normal;
int ptrc = ptr_level(s->decl)+pg_declof_ptr_lv;
if (ptrc < 0) ptrc = 0;
char *tname = pg_typename(s->type);
char *ps = malloc(ptrc+1);
for (int i = 0; i < ptrc; i++) ps[i] = '*';
ps[ptrc] = 0;
char *ts = sjoin(tname,ps);
free(ps);
patch_t *p = new_patch(P_AUTO, n->sofs);
p->as[0].s = ts;
p->as[1].i = type->eofs;
type = s->type;
return;
}
normal:
pg_vars(type, vars);
}
}


It doesn't allow more than one auto var inside single statement, because that is a rewriter, not a true compiler. So all other vars get the type of the first one.

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