lkcl | sadoon, apparently not (i just checked, i hadn't before), slightly bizarre. | 11:22 |
---|---|---|
ghostmansd | hooray folks, almost two days, and I've finally implemented the automatic generation for "remapped fields" | 20:42 |
ghostmansd | excerpts are here: https://pastebin.com/A7CYHTmG | 20:43 |
ghostmansd | this actually is split in two files, all these declarations and definitions, but I've been too lazy to create two pastes | 20:43 |
ghostmansd | note that, unlike the previous approach, this relies on macros with masks and shifts, so the calculations should be as fast as they can be | 20:44 |
lkcl | whoopie-t-doo-dahh | 20:45 |
lkcl | that looks pretty damn good | 20:46 |
lkcl | binutils-devs are so going to be either jealous or totally freak out | 20:47 |
lkcl | this is auto-generated code? moo? | 20:47 |
lkcl | :) | 20:47 |
lkcl | SVP64_RM_EXTRA3_1, | 20:49 |
lkcl | there should be an SVP64_RM_EXTRA3_2 | 20:49 |
lkcl | at bits 18,17,16 -> 0,1,2 | 20:50 |
ghostmansd | that's auto-generated | 20:50 |
ghostmansd | sorry for delay, did some tuning :-) | 20:50 |
lkcl | i mean, for EXTRA2 there's QTY 4of 2-bit indices | 20:51 |
lkcl | and for EXTRA3 there's QTY 3of 3-bit indices | 20:51 |
lkcl | so somewhere in the data structure that defines/generates the fields | 20:51 |
lkcl | an EXTRA3[2] is missing | 20:51 |
ghostmansd | hm, let me check | 20:51 |
lkcl | https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/consts.py;h=4ec670eba8dbc1110808a85877970c560c54e51e;hb=53681596f91014af0122e9239902859722477045#l209 | 20:52 |
lkcl | it's the same indices as SMASK | 20:53 |
ghostmansd | yehyeh | 20:53 |
ghostmansd | I know :-) | 20:53 |
lkcl | because the same bits... okok :) | 20:53 |
ghostmansd | seems like that was lost in generator | 20:53 |
lkcl | intriguing | 20:53 |
ghostmansd | that's good, because at least SelectableIntMappingMeta works | 20:53 |
lkcl | hoo-ya | 20:54 |
ghostmansd | dogshit | 20:54 |
ghostmansd | I think I know | 20:54 |
ghostmansd | fricking Python enums | 20:54 |
ghostmansd | I'll demonstrate | 20:54 |
* lkcl cackles | 20:54 | |
lkcl | urr the underlying indices are the same, aren't they? | 20:55 |
ghostmansd | aha | 20:55 |
ghostmansd | that's the issue :-) | 20:55 |
ghostmansd | Python considers these to be aliases | 20:55 |
ghostmansd | and, sigh, considers only one of them | 20:55 |
lkcl | ngggh | 20:55 |
ghostmansd | dammit | 20:55 |
ghostmansd | OK, here's __members__ | 20:55 |
lkcl | you mean, the default implementation of enum considers them aliases | 20:56 |
ghostmansd | aha | 20:56 |
lkcl | goodbye Enum? | 20:56 |
lkcl | unless the information is accessible via some other way... | 20:57 |
ghostmansd | here's what happens: https://pastebin.com/BkzgDR5A | 21:00 |
ghostmansd | only __members__ work correctly | 21:00 |
ghostmansd | and, of course, I already had to use this trick with power.consts, but this behavior is so counter-intuitive that I forgot it, and yet another enum uses tuple(enum) instead of enum.__members__ | 21:01 |
lkcl | that's *so* going to need documenting | 21:01 |
ghostmansd | it's buried somewhere in Python official docs :-) | 21:01 |
lkcl | for goodness sake put a one-line comment in each time | 21:02 |
lkcl | "use __members__.items() due to aliases being dropped" or something | 21:02 |
ghostmansd | OK, I finally did it | 21:28 |
ghostmansd | I think in the future I'll refactor the code so that we won't have aliases in the child classes | 21:28 |
ghostmansd | bit, rather, will augment the key with, for example, enumerate function | 21:29 |
ghostmansd | so two keys which originally had the same value would end up with different values, thanks to enumerate() call upon iteration | 21:29 |
ghostmansd | anyway, that'll be later | 21:30 |
ghostmansd | it's been about 12 hours of work, so I'll rest | 21:30 |
ghostmansd | https://git.libre-soc.org/?p=binutils-gdb.git;a=blob;f=opcodes/ppc-svp64-opc.c;h=a461a92c5571bd0f1eb048e7ba34eb3f417cbd8d;hb=refs/heads/svp64 | 21:32 |
ghostmansd | sorry, here's the URL with correct line | 21:32 |
ghostmansd | C code: https://git.libre-soc.org/?p=binutils-gdb.git;a=blob;f=opcodes/ppc-svp64-opc.c;h=a461a92c5571bd0f1eb048e7ba34eb3f417cbd8d;hb=refs/heads/svp64#l9715 | 21:32 |
ghostmansd | C header: https://git.libre-soc.org/?p=binutils-gdb.git;a=blob;f=include/opcode/ppc-svp64.h;h=18f70ab078b368b2b6b909d6f381b93d8b626f41;hb=refs/heads/svp64#l159 | 21:33 |
ghostmansd | That's how it looks | 21:33 |
ghostmansd | Only 32-bit integers are supported, though it won't be difficult to adopt it for bit vectors of arbitrary size | 21:34 |
lkcl | ghostmansd[m], fantastic | 23:30 |
Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!