IRC channel logs
2025-03-02.log
back to list of logs
<oriansj>gtker: well I was planning on doing a platform independent codegen in M2-Planet v2.0 (and a binutils assembly compatible assembler+linker) but as M2-Planet got more features, it became harder to think of how to budget time to do that work. <oriansj>it is definitely possible and could be done incrementally if one is willing to take a small performance hit. <oriansj>mihi: yeah M2-Planet doesn't sanity check function calls (it assumes you did all the checking using a real C compiler with better checking support) <matrix_bridge><gtker> stikonas: I think in the short term the code will get less efficient but in the long term it'll become more efficient since we'll have greater liberty in using more registers. I'm not sure what the actual performance penalty is of doing 3x addi rather than one, but IMO there's a significant clarity increase in the platform independent abstraction <matrix_bridge><gtker> oriansj: I considered doing that too but I'm not sure it's worth the effort. The current M1 back end is IMO good enough and if we start creating more utilities that's just more code that would need to be checked for hostile intent. I obviously can't know for sure but I have a good feeling that we'll be able to build tcc (or at least the cut down tccs) with the current backend. I'm more worried that the... <stikonas>gtker: well, in the long term we will win if we can bootstrap let's say tcc directly even if we have performance loss in M2-Planet <stikonas>gtker: there migth be a way to adjust emit_push/emit_pop to be smarter, but that would need passing 2 extra integers... <stikonas>(something like stack was preallocated already, put it in this location...) <matrix_bridge><gtker> Yeah, we might in the future add more specific "primitives" for optimizations, but for now I think we should just try to make things work correctly, and then focus on speed in the future. IMO we would probably have bigger speed increases from things like constant propagation and inlining than keyhole optimizations on pop/push <matrix_bridge><gtker> But I would rather like to avoid too many optimizations right now since it complicates codegen and debugging of the generated code 🙂 <oriansj>gtker: agreed. There are many cheap optimizations that M2-Planet currently leaves on the table as just making it bootstrappable and easy to reason about was the primary goal. <stikonas>gtker: could you remind me what is the status of variables in a loop now? <stikonas>all working or are we missing something? <stikonas>just asking because I've pushed update to stage0-posix now