Elektrine lite

← Feed

@timotimo@peoplemaking.games

Post #2168699

2026-04-24 21:45 UTC

So I have a question about #C and I guess indirectly about #clang since clang is the compiler that has both musttail and the preserve_none attribute / calling convention that are used together for the purpose I'm looking at; the thing I'm trying to do is translate #MoarVM's interpreter loop from a compile-time switchable "loop with a switch in it" and "function with computed GOTO inside it" to also have a variant where each little opcode implementation becomes its own function, they all have the same call signature, and going from one to another uses a return goto (that's probably what a future C standard will call it; for now you can get it with [[clang::musttail]]). I've already got it working apparently, but performance isn't stellar. I think that's because the variables I'm passing around are four pointers to pointers. I do this because until now the interpreter loop frame had local variables that were used by all ops and the addresses of these variables were also stored for functions to change

Replies (0)

No replies.