lkcl | programmerjake, https://github.com/tdene/synth_opt_adders | 06:55 |
---|---|---|
lkcl | love the ascii art you did. | 06:56 |
lkcl | works really well | 06:56 |
lkcl | it'll be interesting to see how well it combines with sphinx ascii-art rendering https://pypi.org/project/sphinxcontrib-asciiart/ | 06:57 |
lkcl | oh wait, not that one :) | 06:57 |
lkcl | https://pypi.org/project/sphinxcontrib-ditaa/ | 06:58 |
lkcl | that's more like it | 06:58 |
lkcl | although not that exact one, it's in java blegh | 06:59 |
ghostmansd | Hi folks, I need your advice on this bit: https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/sv/trans/svp64.py#l394 | 14:12 |
ghostmansd | Here we get register names from ISA, to use them in mapping at https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/sv/trans/svp64.py#l421 | 14:14 |
ghostmansd | We currently don't provide this information in files we generate in binutils... | 14:15 |
ghostmansd | ...and the closest thing binutils has is "operands" field, like https://git.libre-soc.org/?p=binutils-gdb.git;a=blob;f=opcodes/ppc-opc.c;h=ddb9c100c76bb846a618f3bda17eadf8b1a6a7cc;hb=refs/heads/svp64#l7295 | 14:17 |
ghostmansd | ...and each thingy there, be it RA, RB or whatever, is defined as some integer macro: https://git.libre-soc.org/?p=binutils-gdb.git;a=blob;f=opcodes/ppc-opc.c;h=ddb9c100c76bb846a618f3bda17eadf8b1a6a7cc;hb=refs/heads/svp64#l3237 | 14:19 |
lkcl | wotcha ghostmansd | 14:20 |
ghostmansd | and, whilst they mostly map to each other, and I even get a list of stuff... | 14:21 |
lkcl | ghostmansd: ah. deep joy. ok let me see ppc-opc to see if i can work out how to get them | 14:21 |
lkcl | {RT, RA, RB}}, | 14:22 |
lkcl | yeah that's it | 14:22 |
lkcl | that's the one | 14:22 |
ghostmansd | yeah yeah | 14:22 |
ghostmansd | https://pastebin.com/u9UQvuE1 | 14:22 |
ghostmansd | here's the list that we have from pagereader class | 14:22 |
lkcl | no idea what the RA_MASK is though | 14:22 |
ghostmansd | but I don't see all of them there, and some are named differently... IIRC darn | 14:23 |
ghostmansd | {"darn", X(31,755), XLRAND_MASK, POWER9, 0, {RT, LRAND}}, | 14:23 |
lkcl | 1 sec let's look at the spec on that one | 14:23 |
lkcl | (darn isn't implemented yet but has to be at some point) | 14:23 |
ghostmansd | and we have `darn [['RT', 'L3']]` | 14:23 |
ghostmansd | so at least names are different between binutils and us | 14:24 |
ghostmansd | I mean, I _could_ generate the stuff, no problems | 14:24 |
lkcl | well that's bloody stupid | 14:24 |
ghostmansd | but I have an impression binutils have this info | 14:24 |
lkcl | what the hell is a spec for?? sigh | 14:24 |
lkcl | ok darn is "darm RT,L" | 14:24 |
lkcl | according to Power ISA v3.0C p76 | 14:25 |
ghostmansd | so all I need is to call `svp64.opcode = (const struct powerpc_opcode *) str_hash_find (ppc_hash, opc);` and live happy | 14:25 |
ghostmansd | well, darn is just an example | 14:25 |
lkcl | ah yes | 14:25 |
lkcl | you know why? | 14:25 |
ghostmansd | ? | 14:25 |
lkcl | because L is defined *multiple* times at totally different bit-offsets | 14:25 |
lkcl | even within the same X-Form | 14:25 |
ghostmansd | sigh | 14:26 |
* lkcl facepalm / head-desk-bashing | 14:26 | |
ghostmansd | so that's indeed L3 | 14:26 |
ghostmansd | because it's third?... | 14:26 |
lkcl | https://libre-soc.org/openpower/isatables/ | 14:26 |
lkcl | it happens to be the 3rd-encountered "L" in the X-Form table, yes. | 14:26 |
ghostmansd | anyway | 14:26 |
ghostmansd | that's just an example | 14:27 |
ghostmansd | I'm thinking of how we map the registers like we do in Python | 14:27 |
ghostmansd | and I'd really like to re-use the information from binutils-gdb | 14:27 |
lkcl | makes sense | 14:27 |
lkcl | blergh! | 14:28 |
lkcl | i didn't realise you could put #defines smack in the middle of structs! | 14:29 |
lkcl | https://git.libre-soc.org/?p=binutils-gdb.git;a=blob;f=opcodes/ppc-opc.c;h=ddb9c100c76bb846a618f3bda17eadf8b1a6a7cc;hb=refs/heads/svp64#l2734 | 14:29 |
lkcl | i mean it makes sense, i've seen #ifdefs and #endifs | 14:29 |
ghostmansd | yeah, they also confused me for start | 14:30 |
ghostmansd | because I initially assumed, when I found some such record by grep, that they define a structure entry | 14:30 |
ghostmansd | Let's consider `sv.add./m=r3 5.v, 2.v, 1.v` line | 14:30 |
lkcl | ya | 14:31 |
ghostmansd | opregfields mapping (fields : v30b_regs) is (('5.v', 'RT'), ('2.v', 'RA'), ('1.v', 'RB')) | 14:31 |
lkcl | yep | 14:31 |
ghostmansd | I already parsed fields (or, well, at least mostly) | 14:32 |
lkcl | and ppc-opc.c is 7295 {"add.", XO(31,266,0,1), XO_MASK, PPCCOM, 0, {RT, RA, RB}}, | 14:32 |
ghostmansd | and I think https://git.libre-soc.org/?p=binutils-gdb.git;a=blob;f=opcodes/ppc-opc.c;h=ddb9c100c76bb846a618f3bda17eadf8b1a6a7cc;hb=refs/heads/svp64#l7295 | 14:32 |
ghostmansd | yeah | 14:32 |
ghostmansd | we're talking the same | 14:32 |
ghostmansd | so I can simply take the `operands` field from vanilla PPC, right? | 14:32 |
lkcl | if you can't then we're in trouble :) | 14:33 |
ghostmansd | and shouldn't bother generating more crap | 14:33 |
lkcl | not unless it's really stupidly-difficult to parse/interpret that {RT, RA, RB} | 14:33 |
ghostmansd | ok then | 14:35 |
ghostmansd | so the only problem we have are different names | 14:35 |
lkcl | at least you have a path here | 14:35 |
ghostmansd | and I guess it won't be a real issue, anyway | 14:35 |
lkcl | it's like in spiderman where the ferry gets cut into two halves | 14:35 |
lkcl | you can either use a bunch o webs and go "heeeeeeavve" | 14:36 |
lkcl | or use self-propelled AI-controlled jet engines :) | 14:36 |
lkcl | there's only... what... about... mmm... 18 regnames? | 14:37 |
lkcl | RA RB RC RS RT | 14:37 |
lkcl | FRA... FRT | 14:37 |
lkcl | CR0-1 | 14:37 |
lkcl | BA BB BC BF BFA BI BO BT | 14:37 |
ghostmansd | I don't quite get the reference about spiderman, been there only as fan of 1994 series :-) | 14:37 |
lkcl | lol it was the err... one with the latest spiderman, DC Universe | 14:38 |
lkcl | Bad Guy blows up a ferry with laaasers, cuts it in half. spiderman tries joining it back together | 14:39 |
lkcl | the analogy: you're joining 2 halves together :) | 14:39 |
lkcl | with veeery thin webs | 14:40 |
lkcl | oh i know how you could do it. very simple | 14:40 |
lkcl | #define a simple table with the SVP64-thing and the {RT} or {RA} on the other | 14:41 |
lkcl | you could almost certainly autogenerate it | 14:41 |
ghostmansd[m] | I think we should lookup PPC opcode | 14:54 |
ghostmansd[m] | All these giant arrays end up in hash table anyway | 14:54 |
ghostmansd[m] | (and, in fact, vanilla PPC binutils do it anyway) | 14:55 |
ghostmansd[m] | I'm thinking of re-using PPC instead of generation because we might need other crap from powerpc_opcode struct... | 14:55 |
ghostmansd[m] | Anyway, I'll yet have to see how it goes | 14:56 |
lkcl | what i mean is, a (short) mapping table between the svp64 #defines and the ppc-opc.c #defines | 15:20 |
lkcl | but hey | 15:20 |
Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!