Saturday, 2022-07-30

lkclghostmansd[m], for when you're awake - i'm going to start tackling Pack/Unpack which means a new "/thing" - "/vp" for pack and "/vu" for unpack and "/pu" for both flags05:29
lkclyes it's a pair of RM.EXTRA mode-bits05:30
lkcli'll have to work out which instructions it applies to, so and will need to know about that05:31
lkcli really didn't want to start this until everthing else is upstream but it's taking too long05:31
ghostmansd[m]lkcl, perfect, ping me when these concepts are established. Adding new flags to binutils is extremely simple, thanks to the callbacks table I introduced.06:40
lkclghostmansd[m], okaaay i've added one range of ops, LD/ST-with-immediate such as lwz, stz18:59 now adds an extra column, "PU" which stands for pack/unpack19:00
lkclwhen set, then /vp or /pu will set bit 14 of RM.EXTRA19:01
lkcland /vu or /pu will set bit 15 of RM.EXTRA19:01
lkcli still have to put that into sv/trans/svp64.py19:12
lkclbut at least you know what to expect19:12
lkcland now for a relaxing evening watching funny kittens on youtube. until i get bored19:12
* lkcl graduated from funny kittens to "whose line is it anyway"...19:39
ghostmansd[m]Fuck. I've just found we need another mapping, where we map the opcode to the SVP64 description (the structure with the bits we need).20:30
ghostmansd[m]We already have a mapping between name and desc... But this is available only in assembler's source code.20:31
ghostmansd[m]And disassembler needs a mapping between opcode and desc. We already can retrieve the "original" name from the suffix, but we cannot re-use this name in _disassembler's_ sources to lookup the entry in _assembler's_ sources.20:33
ghostmansd[m]Fuck fucking fuck.20:34
ghostmansd[m]Binutils split the "usual" insns (including prefixes) into so called segments. And then from opcode they retrieve the segment and iterate over subarray.20:35
ghostmansd[m]Basically they have large arrays split into buckets. Kind of a hash table, but splitting a contiguous array into chunks. When an instruction is proceeded, its major opcode is converted into the segment, and this segment just knows where the subsection of array starts (and the next segment shows where it ends).20:37
ghostmansd[m]And guess what? We don't have the opcodes. We only have name:desc mapping.20:38
ghostmansd[m]Basically we haven't needed these, since for suffix we re-use the opcode from vanilla instruction, and for prefix we calculate the stuff on the fly. And, well, we only needed name here.20:39
ghostmansd[m]I need to think about it with a fresh head. Storing a vanilla opcode could be one option; perhaps there might be some caveats with VLE/SPE2 instructions.20:41
ghostmansd[m]Anyway, once we have something to be used as bucket, we'll re-use the same approach binutils use.20:43
ghostmansd[m]We have opcodes in our CSV tables, even though these are not used for
ghostmansd[m]I recall someone mentioning we won't ever be needing the opcodes... ;-)20:54
ghostmansd[m]OK, at least I had some code in binutils regarding this stuff, so I can restore it. As usual, the first idea which comes to mind is likely the right one (unless it's terribly wrong).20:57
ghostmansd[m]Anyway, enough for today.20:57
lkclnooo plans to do Vectorised VLE.21:42
lkclnot without at least 3-4 months study of it, 3+ months analysis of it, 4 months implementation time in the Simulator...21:43
lkclit'll be about a year's work all-in.21:44
lkclon top of that it would punish multi-issue execution by forcing a need to hunt for 16 *and* 32 *and* 48 *and* 64-bit instruction boundaries.21:45
lkclright now we can use a Carry-Lookahead algorithm (thanks to jacob on that one) right in the decode phase, which is O(log N)21:45
lkclto detect beginnings of multi-issue 32/6421:46

Generated by 2.17.1 by Marius Gedminas - find it at!