Saturday, 2022-01-29

lkclurrr fiinally i think i've found the bug in dcache10:21
lkcltwo stores one after the other in the same page has a special case in microwatt dcache, and the address was getting corrupted10:22
lkclfrickin ellfire that was a pig to track down10:40
ghostmansdHi folks, want to ask your opinion. Would that be a completely awful and forbidden hack in binutils?15:04
ghostmansdhttps://pastebin.com/sGuLZ04j15:04
ghostmansdI'd like to drop -Wno-missing-initializers and at the same time avoid calling `malloc` to allocate a bigger structure. First, allocating stuff we already have for granted is already dubious; second, I then have to cleanup it (at least to be a good citizen), and cleanup routine in binutils is a somewhat messy stuff (basically I'll have to touch several files to make it work, in form of macro).15:07
ghostmansdTo me this idea looks like a bit dubious, frankly speaking; at the same time, I'd like to touch vanilla binutils as less as possible so that thing is really kept as an extension.15:08
ghostmansdAlso, to be entirely honest, using `uint64_t` is _also_ a non-standard, but at least it's lesser evil than `#pragma`, eh?15:09
lkclyyeah don't do that :)15:49
lkcluse & of the struct or *(&ppc->svp64_thing) = y15:50
lkclor, better, create a union and assign to the uint64_t15:50
ghostmansdAll variants but that would require a new field to be initialized...16:00
ghostmansdThat's why I ever suggested this.16:00
ghostmansdcf. lines 103, 104 and 112 at https://pastebin.com/sGuLZ04j16:01
lkclurr16:02
ghostmansdHere we have an array of powerpc_opcodes: https://sourceware.org/git/?p=binutils.git;a=blob;f=opcodes/ppc-opc.c;h=82f4f1297cc2cbe7892043964193b0e3ea480609;hb=HEAD#l277916:03
ghostmansdAh wait, that's not the recent16:05
ghostmansdhttps://git.libre-soc.org/?p=binutils-gdb.git;a=blob;f=opcodes/ppc-opc.c;h=a424dd924dec28d173a4abfc85ae134ba83ad863;hb=HEAD#l435316:05
lkcland also gives "XML Parsing error" :)16:05
ghostmansdAlso there are more entries, e.g. prefix_opcodes, vle_opcodes, et al.16:06
ghostmansdThese all are merged into ppc_hash16:06
ghostmansdOf course as static elements, w/o allocation involved16:06
ghostmansdor, to be exact, the hash itself allocates, but entries are mapped as is16:07
lkclthe file's so large it's taking several minutes to load on my internet connection16:07
ghostmansdOK, don't really bother, the essense is that it's a damn huge pack of powerpc_opcodes :-)16:08
lkclok yes, ah ha!16:08
ghostmansdBasically all insns that PPC has16:08
lkclif there are some extensions like that already it would be kinda ok to do the same thing16:09
ghostmansdThey all re-use the same structure layout16:09
ghostmansdwe're the only ones who need yet another 64 bits :-(16:09
ghostmansdand, of course, since we change the structure layout...16:09
ghostmansdthe whole thing just breaks at compilation when I add a new field16:10
ghostmansddue to the fact that some weirdo (me) doesn't want to update that huge file to add an empty uint64 to each entry of each damned array16:10
ghostmansd(and, of course, I think we shouldn't)16:10
ghostmansdat the same time, whilst I don't want to update records...16:11
lkclsounding like a separate hashtable to e16:11
lkclme16:11
ghostmansdwould that be OK?16:11
ghostmansdI mean, that's what I wanted to do initially16:11
ghostmansdhttps://sourceware.org/git/?p=binutils.git;a=blob;f=gas/config/tc-ppc.c;h=6b54f5ad8ebcb979abe24e9428d65246a6631c8e;hb=HEAD#l250716:12
ghostmansdthat's the place we want to hack16:12
ghostmansdcf. `opcode = (const struct powerpc_opcode *) hash_find (ppc_hash, str);`16:12
ghostmansdthe code we build atop keeps the stuff working the same, and we _can_ re-use the same hash, if the structure is updated to incorporate the svp64 field16:13
ghostmansdbut, if not, we have to check another hash16:13
ghostmansdif that's OK, I can update the code so that we have another hash entry16:14
lkclyeah i'd do a 2nd hash, keep it completely separte16:14
ghostmansdI think it won't be the issue: as I mentioned before, we anyway suck at cache there, so having another hash'd be OK16:14
ghostmansdOK, got it, let's proceed with the original plan then :-)16:14
lkcldoh :)16:15
ghostmansdIn csvs, do we have an option to understand which insns might have a dot there?16:26
ghostmansdI mean, we have only `add` entry, but not `add.`; I'd like to output both, though, but at the same time avoid crap like `addg6s.`.16:27
ghostmansdOr well, I'm wrong. Not CSVs, but, rather, openpower.decoder.power_svp64.SVP64RM, since we use it.16:28
ghostmansdThe entries would be the same if I'm not mistaken; however, I'd not need to add the C code which drops the dot, and simply will look the name up as is.16:30
ghostmansdWell, CSVs, after all: `ISA = _SVP64RM(); for record in ISA.get_svp64_csv(path): generate_c_code(record)`16:34
ghostmansdFWIW, separating to standalone struct looks real cool: `str_hash_insert (svp64_hash, svp64->name, &svp64->record, 0)` is damn well evident.16:46
lkclthere's an RC field in the csv16:52
lkclit identifies when you can add 'o' or '.' or 'o.'16:52
lkcllook at ISACaller.get_assembly_name()16:53
lkclthere is also similar reconstruction based on the LK field16:54
lkcland also the AA field16:54
ghostmansd[m]Thanks lkcl! This is exactly what I need.17:44

Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!