IRC channel logs
2021-11-13.log
back to list of logs
<stikonas>oriansj: hmm, maybe let's revert that last PR... <stikonas>it's behaviour is just too confusing right now <stikonas>at least with the assignments it either works or compilation error but here it's silently different behaviour <stikonas>the more I look at this, the more it looks like ++/-- are not easily implementable... <oriansj>stikonas: its ok, M2-Planet is a very thrown together sort of solution. <oriansj>a sort of rough prototype for cc_x86 which grew out of control <stikonas>I guess without AST it's hard to know what is lvalue and what is rvalue <oriansj>and It wasn't designed to be a proper C, despite how much one might want it to be <stikonas>as that is not immediately visible from type of expressions <stikonas>so my suggestion is to revert that last commit. I can still look at fixing up assignments <oriansj>yeah, its kinda embarassing how ad-hoc M2-Planet is. The Multi-arch support could have been so much cleaner <stikonas>oh I wouldn't be embarrased if I were you <oriansj>it is hard to maintain and update or expand or port <oriansj>but it kinda holds together just well enough <stikonas>ok, somewhat good news is that I've gotten += to work properly on AMD64 <stikonas>or at least better than before, so things like *b += 2; now work <stikonas>just need to extend this to other arches and other assignments <stikonas>and if possible, simplify emitted code a bit <Hagfish>a pity about ++/--, but i get what you mean about needing an AST <stikonas>Hagfish: haven't thought about it since yesterday <stikonas>first, I'll finish all compounds assignment operators <stikonas>but it's not the end of the world if we can't support ++/-- <stikonas>we might still be able to improve m2-planet to the point where required mes simplifications can be merged upstream <stikonas>especially since we have a preprocessor support for #ifdef __M2__ <stikonas>in any case ++ / -- are less useful if we don't have pointer arithmetic working <stikonas>as they would increment pointer address by 1 instead of by register size <oriansj>object size not register size. as if foo is a struct; foo++ increments it by the sizeof(struct) <stikonas>oriansj: I also need LOAD_INTEGER_rbx define. I'm not too familiar with x86 hex encoding, how do I get it? <stikonas>something like PUSH_ebx\nLOAD_INTEGER_ebx\nADD_ebx_to_eax\nPOP_ebx\nSTORE_INTEGER\n in expression function does work with += reasonably well <stikonas>definitelty better than what I did in preprocessor <oriansj>here is what I would do to look up the encoding: rasm2 -a x86 -b 64 "mov rbx, 0x1234567" <stikonas>maybe I should learn AMD assembly better :D <oriansj>which will return: 48c7c367452301 then remove the 67452301 <oriansj>it also can help sanity check your hex: rasm2 -a x86 -b 64 -d "48c7c3 00000000" <stikonas>oriansj: "get_machine --override" crashes <stikonas>well, we are supposed to provide what to override with, but we should not crash in any case