Saturday, 2022-04-09

lkcllove the ascii art you did.06:56
lkclworks really well06:56
lkclit'll be interesting to see how well it combines with sphinx ascii-art rendering
lkcloh wait, not that one :)06:57
lkclthat's more like it06:58
lkclalthough not that exact one, it's in java blegh06:59
ghostmansdHi folks, I need your advice on this bit:;a=blob;f=src/openpower/sv/trans/
ghostmansdHere we get register names from ISA, to use them in mapping at;a=blob;f=src/openpower/sv/trans/
ghostmansdWe 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;a=blob;f=opcodes/ppc-opc.c;h=ddb9c100c76bb846a618f3bda17eadf8b1a6a7cc;hb=refs/heads/svp64#l729514:17
ghostmansd...and each thingy there, be it RA, RB or whatever, is defined as some integer macro:;a=blob;f=opcodes/ppc-opc.c;h=ddb9c100c76bb846a618f3bda17eadf8b1a6a7cc;hb=refs/heads/svp64#l323714:19
lkclwotcha ghostmansd14:20
ghostmansdand, whilst they mostly map to each other, and I even get a list of stuff...14:21
lkclghostmansd: ah. deep joy. ok let me see ppc-opc to see if i can work out how to get them14:21
lkcl{RT, RA, RB}},14:22
lkclyeah that's it14:22
lkclthat's the one14:22
ghostmansdyeah yeah14:22
ghostmansdhere's the list that we have from pagereader class14:22
lkclno idea what the RA_MASK is though14:22
ghostmansdbut I don't see all of them there, and some are named differently... IIRC darn14:23
ghostmansd{"darn",    X(31,755),    XLRAND_MASK, POWER9,    0,        {RT, LRAND}},14:23
lkcl1 sec let's look at the spec on that one14:23
lkcl(darn isn't implemented yet but has to be at some point)14:23
ghostmansdand we have `darn [['RT', 'L3']]`14:23
ghostmansdso at least names are different between binutils and us14:24
ghostmansdI mean, I _could_ generate the stuff, no problems14:24
lkclwell that's bloody stupid14:24
ghostmansdbut I have an impression binutils have this info14:24
lkclwhat the hell is a spec for?? sigh14:24
lkclok darn is "darm RT,L"14:24
lkclaccording to Power ISA v3.0C p7614:25
ghostmansdso all I need is to call `svp64.opcode = (const struct powerpc_opcode *) str_hash_find (ppc_hash, opc);` and live happy14:25
ghostmansdwell, darn is just an example14:25
lkclah yes14:25
lkclyou know why?14:25
lkclbecause L is defined *multiple* times at totally different bit-offsets14:25
lkcleven within the same X-Form14:25
* lkcl facepalm / head-desk-bashing14:26
ghostmansdso that's indeed L314:26
ghostmansdbecause it's third?...14:26
lkclit happens to be the 3rd-encountered "L" in the X-Form table, yes.14:26
ghostmansdthat's just an example14:27
ghostmansdI'm thinking of how we map the registers like we do in Python14:27
ghostmansdand I'd really like to re-use the information from binutils-gdb14:27
lkclmakes sense14:27
lkcli didn't realise you could put #defines smack in the middle of structs!14:29
lkcli mean it makes sense, i've seen #ifdefs and #endifs14:29
ghostmansdyeah, they also confused me for start14:30
ghostmansdbecause I initially assumed, when I found some such record by grep, that they define a structure entry14:30
ghostmansdLet's consider `sv.add./m=r3 5.v, 2.v, 1.v` line14:30
ghostmansdopregfields mapping (fields : v30b_regs) is (('5.v', 'RT'), ('2.v', 'RA'), ('1.v', 'RB'))14:31
ghostmansdI already parsed fields (or, well, at least mostly)14:32
lkcland ppc-opc.c is 7295 {"add.",        XO(31,266,0,1), XO_MASK,     PPCCOM,    0,              {RT, RA, RB}},14:32
ghostmansdand I think;a=blob;f=opcodes/ppc-opc.c;h=ddb9c100c76bb846a618f3bda17eadf8b1a6a7cc;hb=refs/heads/svp64#l729514:32
ghostmansdwe're talking the same14:32
ghostmansdso I can simply take the `operands` field from vanilla PPC, right?14:32
lkclif you can't then we're in trouble :)14:33
ghostmansdand shouldn't bother generating more crap14:33
lkclnot unless it's really stupidly-difficult to parse/interpret that {RT, RA, RB}14:33
ghostmansdok then14:35
ghostmansdso the only problem we have are different names14:35
lkclat least you have a path here14:35
ghostmansdand I guess it won't be a real issue, anyway14:35
lkclit's like in spiderman where the ferry gets cut into two halves14:35
lkclyou can either use a bunch o webs and go "heeeeeeavve"14:36
lkclor use self-propelled AI-controlled jet engines :)14:36
lkclthere's only... what... about... mmm... 18 regnames?14:37
lkclRA RB RC RS RT14:37
lkclFRA... FRT14:37
ghostmansdI don't quite get the reference about spiderman, been there only as fan of 1994 series :-)14:37
lkcllol it was the err... one with the latest spiderman, DC Universe14:38
lkclBad Guy blows up a ferry with laaasers, cuts it in half. spiderman tries joining it back together14:39
lkclthe analogy: you're joining 2 halves together :)14:39
lkclwith veeery thin webs14:40
lkcloh i know how you could do it. very simple14:40
lkcl#define a simple table with the SVP64-thing and the {RT} or {RA} on the other14:41
lkclyou could almost certainly autogenerate it14:41
ghostmansd[m]I think we should lookup PPC opcode14:54
ghostmansd[m]All these giant arrays end up in hash table anyway14: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 goes14:56
lkclwhat i mean is, a (short) mapping table between the svp64 #defines and the ppc-opc.c #defines15:20
lkclbut hey15:20

Generated by 2.17.1 by Marius Gedminas - find it at!