IRC channel logs
2025-03-13.log
back to list of logs
<matrix_bridge><gtker> oriansj: If raw bytes wrapped in '' should be used for u8s, and % for u32s what would be the correct way of outputting an array of u16s? <matrix_bridge><Andrius Štikonas> Hmm, I guess we don't have a way that works for both normal arches and word based... <matrix_bridge><gtker> stikonas: It's not required for the current bootstrap target (tcc_1_7) but it might become relevant at some point <ekaitz>stikonas: m2-planet release with switch/case support? <stikonas>yeah, last release should support switch/case <stikonas>well, there are lots of new things in git master <ekaitz>i'm using it, so if you bump it, please let me know! <ekaitz>hmm looks like 1.11.0 doesn't support it because it's failing <matrix_bridge><gtker> We don't have a release with switches, but the current master does <stikonas>hmm, should we make one after I merge current PR? <matrix_bridge><gtker> stikonas: I don't have anything urgent to get in before the release, so we could do one now <stikonas>gtker: do you think it's reasonably stable now? <stikonas>see if live-bootstrap works at least on x86 <stikonas>hmm, interesting, we did have stage0-posix release in Sep 2024 <stikonas>but I guess there was no standalone release <ekaitz>hm! i'm trying it and it's not working <ekaitz>is there any obvious limitation in the switch statement i'm missing? <ekaitz>my code is simpler than that testcase <ekaitz>but maybe it's just me fighting against the buildsystem <ekaitz>it's failing in kaem --strict -f kaem.run <ekaitz>src/reader.c:460:switch is not a defined symbol <ekaitz>i'm not sure if this is giving me the proper m2 <ekaitz>isn't it legal to make assignments inside a switch? <ekaitz>ah! haha! it's a commit body, those - lines mean the line is removed <ekaitz>it's not working yet... and I refreshed the commit with the last one you did <ekaitz>i'm surely doing something wrong <matrix_bridge><Andrius Štikonas> Hmm, we should sort this out before release... <ekaitz>it's probably the guix packaging here that is wrong <matrix_bridge><Andrius Štikonas> Your error suggests that it is switch statement itself that is unrecognised <ekaitz>and i think guix is using the M2 of a previous environment and not this <stikonas>anyway, let us know if you figure this out <stikonas>if we make a new release, bettter fix this <ekaitz>i'm pretty sure it's guix but i don't know why <ekaitz>do i need other mescc-tools if I change m2-planet? <stikonas>though we had some breaking change, but it might be fine <stikonas>well, the pointer arithmetic now works for += and -= operators <ekaitz>stikonas: scaffold/main.M1:7 :Received invalid other; xor_eax,eax <ekaitz>but I don't have the switch issue anymore <stikonas>but yeah, that's something I forgot about <stikonas>cause any codegen changes in M2-Planet that need new defines <stikonas>well, "fix" is easy, just need to add those to mes <stikonas>but then need to wait for a new release of mes... <ekaitz>i don't know why mes doesn't get them from M2lib <stikonas>since that list of defines is now basically complete <ekaitz>and what are all these: DEFINE RETURN C3 <stikonas>before M2-Planet switched to newer style (more similar to GAS) defines <stikonas>especially once mes depends on newer features of M2-Planet <ekaitz>and it didn't complain because of it <ekaitz>src/reader.c:462:src/reader.c:462:ERROR in process_switch <ekaitz>but it complained about that instead <stikonas>hmm, I guess MISSING } means it saw something unexpected? <stikonas>ekaitz: that's with the same switch statement from your pastebin? <ekaitz>i have a magnet for these things <stikonas>ekaitz: I think switch can accept char but not case <ekaitz>okay so if I write a number instead it should work? <ekaitz>can we improve M2planet to support chars? <stikonas>gtker: can we used constant_expression here? <stikonas>ekaitz: as for enums, yes, new one has support for enums <ekaitz>yeah...that would make my work in mes way easier <ekaitz>how hard do you think it is to add chars there? <ekaitz>i tried to read the code and it doesn't look impossible <stikonas>but in the meantime I guess you could do something like case 0x61: // 'a' <stikonas>well, I have a hacky commit that goes most of the way <stikonas>needs a space between case expression and : <stikonas>oh, that's because of some label hacks in M2-Planet tokenizer... <stikonas>oh I guess that was previously dealt with if(':' == global_token->s[0]) <stikonas>so needs more thought on how to cleanly do it... <stikonas>but maybe gtker can take over this patch :) <oriansj>stikonas: just a thought but $ isn't used by word based architectures yet; what if we do a little shift to give word based architectures a standard 16bit symbol (as the byte based architectures are using @0x1234) <oriansj>one meaning in M1 (for immediates) and one meaning in hex2 (for jumps and calls) <stikonas>but we don't want to implement that in M0... <oriansj>you don't have to implement it in M0 <oriansj>or we just take a day or two to backport it