Monday, 2022-08-29

*** ghostmansd[m] <ghostmansd[m]!~ghostmans@91.205.170.135> has quit IRC00:02
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@176.59.172.86> has joined #libre-soc00:04
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@176.59.172.86> has quit IRC00:19
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@91.205.170.135> has joined #libre-soc00:22
*** lxo <lxo!~lxo@gateway/tor-sasl/lxo> has joined #libre-soc00:22
*** lxo <lxo!~lxo@gateway/tor-sasl/lxo> has quit IRC00:51
*** lxo <lxo!~lxo@gateway/tor-sasl/lxo> has joined #libre-soc00:52
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@91.205.170.135> has quit IRC04:47
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@176.59.42.207> has joined #libre-soc04:58
*** lxo <lxo!~lxo@gateway/tor-sasl/lxo> has quit IRC05:12
*** lxo <lxo!~lxo@gateway/tor-sasl/lxo> has joined #libre-soc05:17
programmerjakelkcl: afaict the comment here is no longer needed, it already works for doing load/store ops of smaller width: https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/decoder/isa/mem.py;h=c41e436e5e5133a6bebaf76b9df81d4d60baa51c;hb=HEAD#l8208:12
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@176.59.42.207> has quit IRC08:27
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@176.59.42.207> has joined #libre-soc08:32
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@176.59.42.207> has quit IRC08:37
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@broadband-188-32-220-156.ip.moscow.rt.ru> has joined #libre-soc08:37
lkclprobably :)10:14
lkclprogrammerjake, i fixed "sv.addi." several days ago10:40
lkcldo be really careful with sv/trans/svp64.py - check that "sv.ffmadds." is still decoded10:40
programmerjakesv.addi. -- thx! sv.fmadds. -- replied via email10:42
programmerjakebasically i'm fixing it tomorrow and will add tests (assuming i remember), so i didn't check if it's broken now. all existing tests passed on my pc10:43
lkclyep, it's broken.  "        ffmadds. 1, 0, 1, 110:43
lkcl" is placed directly into the assembler10:43
lkclwhich of course does not exist10:43
lkclbut ffmadds is correctly converted to a ".long"10:44
programmerjakeoh, btw, you might want to watch the SLS rocket launch in 2-3hr10:46
*** octavius <octavius!~octavius@146.90.27.39> has joined #libre-soc10:47
lkclprogrammerjake, btw (appreciate it's late) do you want to do [scalar] transcendentals, next?10:58
lkclblast through them10:59
lkclsome EUR budget for ghostmansd[m] for adding to binutils10:59
lkclit'll be things like atan / atan2 (sin/cos is already there), and log1p exp1m etc.11:00
programmerjakeif we're doing them properly it will take quite a while...we'd need something like crlibm for python11:02
programmerjakeand all the fp exception flags and rounding modes, etc.11:03
lkclno, not doing them "properly".11:03
lkclno exceptions no rounding modes11:03
lkcland using python math11:03
lkcltime-budget absolute max of about... 8 days.  so *real* fast - 3 to 4 opcodes a day, minimum.11:04
programmerjakek, yeah, i can work on that11:04
lkclthere's a follow-up EUR 100,000 NLnet grant with no time-pressure to do "cleanup"11:05
programmerjakecleanup in general or fp specifically?11:05
lkcl(and corresponding separate EUR 100k standards one because all of the FP-flags modes esp. what happens on sin(inf) etc. hasn't even been defined yet)11:06
lkclboth the standard proposal and then correspondingly the simulator (to make sure the standard's correctly adhered to)11:07
programmerjakeiirc the ieee754 standard specifies fp exceptions for all those ops (and if not, we shouuld be able to easily extrapolate from other ops it does specify)11:07
lkcli'm certain sin(inf) etc are all listed in the IEEE754.... yes.11:07
lkclthe simulator doesn't have FP modes at all at the moment, all the sin/cos (etc.) were added in a rush to get DCT/FFT and mp3 working in the bare minimum amount of time11:08
*** ghostmansd <ghostmansd!~ghostmans@broadband-188-32-220-156.ip.moscow.rt.ru> has joined #libre-soc11:26
ghostmansd[m]Fuck. My laptop ran out of battery and I ended up with some broken objects in git. Now I have to resort to some combinations of git fsck and similar dark magic.11:27
ghostmansd[m]Hopefully nothing that unrepairable, but still pretty depressing.11:28
programmerjakewhat fun...at least it's not fat32...11:31
programmerjakethat's how I lost the source for the quickbasic compiler i wrote11:32
lkclngggh11:57
lkclthere's... there's some options in fstab which help with that.11:58
*** lxo <lxo!~lxo@gateway/tor-sasl/lxo> has quit IRC12:04
*** lxo <lxo!~lxo@gateway/tor-sasl/lxo> has joined #libre-soc12:06
*** octavius <octavius!~octavius@146.90.27.39> has quit IRC12:57
lkclghostmansd[m], i thought of a solution to the issue of overlapping patterns13:24
lkclas to how to do disasm, that is13:24
lkclor is it asm, i have difficulty working out which13:25
lkclbasically you collate a list13:25
lkclthen you go through the 1st bit of every element of that list, and if they're the same, you put that into bit 1 of the output13:26
ghostmansd[m]What's the issue with overlapping patterns? You mean instructions with the same name, right?13:26
lkclif *any* of them are *not* the same you put a "-" into the bit 1 output13:26
lkclyes.13:26
lkcllike the rldicr used to have, before they were replaced with a single pattern13:26
lkcli _need_ to add 13 identical patterns with 4 bits almost the same13:27
lkcl1 of those patterns is reserved13:27
lkcland 2 more are a *different instruction*13:27
lkclsvshape213:27
ghostmansd[m]But how these end up having the same name?13:27
lkclbecause they are the same13:27
ghostmansd[m]Is it like, different patterns are allowed for the same instruction?13:28
lkcla *later* decode - on those 4 bits - will decide...13:28
lkclthere's a sub-field (SVRM) which as of right now is decoded within the instruction13:28
lkclit is 4 bits long13:28
ghostmansd[m]Sorry, I'm lacking the context. Could we take some specific example from say some CSV?13:28
lkcltherefore there are 16 options13:28
lkclhttps://libre-soc.org/openpower/sv/remap/#svshape13:29
lkcl0.56.1011.1516..2021..252526..31name13:29
lkclOPCDSVxdSVydSVzdSVRMvfXOsvshape13:29
lkclbits 21-25 (SVRM) are at present decoded by the svshape instruction, entirely13:30
lkclbut13:30
lkclsee the two entries13:30
lkcl0b1000reserved13:30
lkcl0b1001reserved13:30
lkcl?13:30
lkcli want to use those for svshape2 *with an entirely different Form*13:30
lkclso13:31
lkclinstead of13:31
lkcl-----011001,VL,OP_SVSHAPE,N13:31
lkclwhich is what is there at present13:31
lkclwe must add13:31
lkcl0000-011001,VL,OP_SVSHAPE,    # 0b0000Matrix 1/2/3D13:32
lkcl0001-011001,VL,OP_SVSHAPE,    # 0b0001FFT Butterfly13:32
lkcl...13:32
lkcl....13:32
lkcl1000-011001,VL,OP_SVSHAPE2,    # 0b1000COMPLETELY DIFFERENT ENCODING FORM FOR SVSHAPE213:33
lkcl1001-011001,VL,OP_SVSHAPE2,    # 0b1001COMPLETELY DIFFERENT ENCODING FORM FOR SVSHAPE213:33
lkcl...13:33
lkcl1111-011001,VL,OP_SVSHAPE,    # 0b1111FFT half-swap13:33
lkclsorry13:35
ghostmansdI still don't get. These are different patterns.13:35
lkclthat svshape2 one can be13:35
ghostmansdHow do different opcodes end up having the same mnemonic?13:35
lkcl100--011001,VL,OP_SVSHAPE2,13:35
lkclbecause they go through to a Decoder which reads the bits *again*, as one of the sub-fields13:36
lkclswitch(XO)13:36
lkcl   case 0b10000:13:36
ghostmansdFrom what I see in binutils, they expect different mnemonics.13:36
lkcl    case 0b10001:13:36
lkclthese could actually just be13:36
lkclswitch(XO)13:37
ghostmansdOr well... are there examples of such behavior in OpenPower ISA already?13:37
lkcl   case 0b100-13:37
lkclit's nothing to do with Power ISA13:37
lkclit's to do with decoding13:37
ghostmansdIt has to do with opcode decoding.13:37
lkclyes.13:37
lkclso it is a decision of the implementor, not an actual "hard actual requirement of the Power ISA specification"13:38
ghostmansdWe're talking of minor_22, right?13:38
ghostmansdDo you have a WiP to share?13:38
ghostmansdSo that I could take a look.13:38
lkclyes13:38
lkclno, because the moment i add those 13 patterns disasm will break13:39
lkcland when sv/trans/svp64.py is adapted, that will break too13:39
lkclso this is really important to add the list-handling13:40
ghostmansdopcode,unit,internal op,in1,in2,in3,out,CR in,CR out,inv A,inv out,cry in,cry out,ldst len,BR,sgn ext,upd,rsrv,32b,sgn,rc,lk,sgl pipe,comment,form,CONDITIONS,unofficial,comment213:40
ghostmansd-----011001,VL,OP_SVSHAPE,NONE,NONE,NONE,NONE,NONE,NONE,0,0,ZERO,0,NONE,0,0,0,0,0,0,NONE,0,0,svshape,SVM,,1,unofficial until submitted and approved/renumbered by the opf isa wg13:40
lkclyes.13:40
lkclthat becomes13:40
lkcl0000-011001,VL,OP_SVSHAPE,13:40
lkcl0001-011001,VL,OP_SVSHAPE,13:40
lkcl...13:40
lkcl....13:40
lkcl1111-011001,VL,OP_SVSHAPE,13:40
lkcl13 entries.13:41
lkclthey *will* (have to be) identical13:41
lkcland a rule set, "if the other fields do not match throw a runtime assertion"13:41
ghostmansdand all these share the same name/comment?13:45
ghostmansdand, well, instead of a single per-record opcode, we'd rather should have _list_ of opcodes?13:45
lkclyes. all fields except for the pattern it is critical that they be the same13:46
lkclurrr.... yyeees... except if you think that through visually it'll be awful13:46
lkcli mean, yes, it's a solution.  something like [NN NN NN]13:47
lkclbut here's the thing: the patterns must *ONLY* be added to cover one of the fields that is to be further decoded elsewhere/elsewhen13:48
lkclyou can NOT do this:13:48
lkcl0000-01100113:49
lkcl-00010110113:49
lkclsorry13:49
lkcl0000-01100113:49
lkcl-000101100113:49
lkclor worse13:49
lkcl0000-01100113:49
lkcl0010-01101113:49
lkclor bullshit like that13:49
*** lxo <lxo!~lxo@gateway/tor-sasl/lxo> has quit IRC13:50
lkclwhat this scheme is declaring is:13:50
lkcl* i respect the XO of the instruction13:50
*** lxo <lxo!~lxo@gateway/tor-sasl/lxo> has joined #libre-soc13:50
lkcl* i have a sub-field which i am in control of... mostly13:50
lkcl* i want *SOME* encodings of that sub-field to be handed over to a *different* instruction13:51
lkcl* therefore i am declaring what those sub-fields are, explicitly13:51
*** lxo <lxo!~lxo@gateway/tor-sasl/lxo> has quit IRC13:52
ghostmansd[m]Couldn't we hash not only name but both opcode and name?13:55
ghostmansd[m]Because currently the issue is caused by the fact that I hash by name.13:56
lkclthat's perfectly fine13:59
lkcli worked out how to "get" the actual XO out of the thing13:59
lkcloh13:59
lkcli know13:59
lkcla *sub-pattern* as a list (new field)14:00
lkclkeep the "-----011001,VL,OP_SVSHAPE,NO"14:00
lkcl....14:00
lkclbut add an *EXTRA* pattern that must be laid on top14:00
lkcl[0000---------,14:00
lkcl 0001-------,14:00
lkcl 0010-------,14:01
lkcl....14:01
lkcl...14:01
lkcl 1111-------]14:01
lkcleurgh that means altering PowerDecoder14:02
lkclah wait i know a way to do it14:02
ghostmansdI'll think about it14:02
ghostmansdI'm now dealing with switching binutils to new fields14:02
lkclfun14:02
ghostmansdIncluding the disassembler bits14:02
ghostmansdFrankly it became a lot clearer14:02
lkclgreat!14:03
ghostmansdThere are no longer stuff like custom structures for each field which then have to be combined or decoupled here and there.14:03
ghostmansdOnly one 64-bit integer, with many getters and setters.14:03
lkclahh way better14:04
ghostmansdhttps://pastebin.com/aubfJ6ZG14:04
lkclthat sounds like for cavatools it's going to be laughably easy14:04
ghostmansdWell the part I already done was remarkably hard... :-)14:05
lkcl:)14:05
ghostmansdProbably the hardest yet, TBH.14:05
ghostmansdTwo weeks I spent completely buried in metaclasses crap.14:05
ghostmansdI think I knew more than I ever wanted to.14:05
ghostmansdBut the outcome is nice, so hey, who cares.14:06
lkcl:)14:06
lkclif i had time and great enthusiasm i'd ask, "oo yes, _please_ explain metaclasses to me, i really want to know everything about them"14:07
ghostmansd...that'd take two weeks more. :-)14:08
ghostmansdThis a really arcane magic.14:08
*** lxo <lxo!~lxo@gateway/tor-sasl/lxo> has joined #libre-soc14:08
ghostmansdNot only metaclasses but also descriptors which I also had to use.14:08
ghostmansdNo, just kidding. It can be done faster.14:08
ghostmansdBut still as one who almost never used these I really had to investigate many concepts.14:09
lkclhonestly i am astounded, impressed, and slightly scared.14:10
ghostmansdI'm still scared. But I guess soon the fear will go away to be replaced with the Stokholm syndrome.14:15
ghostmansdlkcl, speaking of opcodes. Am I right that stuff like sradi., extswsli are also affected?14:42
ghostmansdAlso mulhw and mulhd.14:43
lkclif there are double-entries? yes.14:57
lkclbasically imagine that those CSV files *literally* generate case-statement entries in a giant switch14:58
lkclif there are multiple entries you Just Don't Care (tm) because the multiple entries do PRECISELY and EXACTLY what is required:14:58
lkclall go through to the EXACT same instruction14:58
lkclwhere that goes to hell in a handbasket is the reverse-mapping14:59
lkcland it comes down to the fact that the multiple-entries are in fact matching against **TWO** fields15:00
lkcl1) the XO15:00
lkcl2) some-other-field-somewhere-else-in-the-binary15:00
lkclwhen reconstructing the assembly (disasm) you want the **XO**15:01
lkclyou do **NOT* want the some-other-fields-somewhere15:01
lkclhence15:01
lkclthe idea of splitting out (2) into a new CSV column.15:01
ghostmansdyield ".long 0x%08x # %s" % (svp64_prefix.insn.value, insn)17:03
ghostmansdGuys you broke it :-)17:03
ghostmansd`sv.bc 2, 9, 8`17:04
ghostmansd...will lead to disassembly `.long 0x05400000 # sv.bc 2, 9, 8; bc 2, 9, 8 # sv.bc 2, 9, 8`17:04
ghostmansdAh well, rather this code17:07
ghostmansdlst = '; '.join(lst)17:07
ghostmansdoutfile.write("%s%s # %s\n" % (ws, lst, op))17:07
ghostmansdYou now output a lonely long and a large comment17:07
ghostmansdsubmitted a fix17:14
ghostmansdhttps://git.libre-soc.org/?p=openpower-isa.git;a=commit;h=1be3f54265d04ded28343c16614bee9c797b44ca17:14
ghostmansdnow the comment goes last: `.long 0x05400000; bc 2, 9, 8; # sv.bc 2, 9, 8 # sv.bc 2, 9, 8`17:15
ghostmansdLuke, out of curiosity, why did you dropped the way to start pysvp64asm from __main__?17:15
ghostmansdIMHO if we want to have a unit test covering it, this should go to a separate file.17:16
*** ghostmansd <ghostmansd!~ghostmans@broadband-188-32-220-156.ip.moscow.rt.ru> has quit IRC17:20
*** ghostmansd <ghostmansd!~ghostmans@broadband-188-32-220-156.ip.moscow.rt.ru> has joined #libre-soc17:41
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@broadband-188-32-220-156.ip.moscow.rt.ru> has quit IRC18:06
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@176.59.41.172> has joined #libre-soc18:38
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@176.59.41.172> has quit IRC18:56
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@broadband-188-32-220-156.ip.moscow.rt.ru> has joined #libre-soc18:57
lkclghostmansd, because if you want to run stdin/stdout or pass in options at the commandline that should be "pysvp64asm < filename"19:30
lkclnot19:30
lkcl"python3 sv/trans/svp64.py < filename"19:30
lkclghostmansd, the addition of the comment is programmerjake who has not used pysvp64asm before (or written any svp64 unit tests)19:31
lkclghostmansd, i feel it's definitely time to cut over the pysvp64dis branch19:36
lkclextended periods of non-merging makes me very jumpy19:37
* lkcl running tests now19:41
lkcltest_caller_svp64_[predication/dct/fft/matrix/logical/mapreduce/fp/alu] all good so far19:43
ghostmansd[m]Yep, fine with me19:45
lkclghostmansd[m], excellent19:45
lkcljust running test_issuer.py as well19:45
ghostmansd[m]I'll rest for today, seems I caught a flu19:45
lkclah joy19:45
lkcli'll do the merge19:45
ghostmansd[m]Thanks!19:46
ghostmansd[m]I recently rebased it IIRC19:46
lkclyes i saw19:46
ghostmansd[m]So a simple git rebase pysvp64dis should do the trick19:46
ghostmansd[m]In master19:46
lkclcommit b8539167b55f815e719:46
lkclok whew19:46
lkcli like easy19:46
ghostmansd[m]Perhaps, I'm AFK, so can neither confirm nor deny it :-)19:46
lkcl:19:46
lkcl:)19:46
*** octavius <octavius!~octavius@146.90.27.39> has joined #libre-soc19:49
lkclprogrammerjake, adding the instruction as a comment completely fucks things up20:45
lkclokaaay re-running everything, test_issuer.py nosvp6420:46
*** lxo <lxo!~lxo@gateway/tor-sasl/lxo> has quit IRC20:57
*** lxo <lxo!~lxo@gateway/tor-sasl/lxo> has joined #libre-soc20:58
lkcland every unit test in decoder/isa21:00
lkclnggggh....21:01
lkclokaay the majority of tests pass (enough), pysvpdisasm branch is merged, all good22:49
*** lxo <lxo!~lxo@gateway/tor-sasl/lxo> has quit IRC23:02
*** lxo <lxo!~lxo@gateway/tor-sasl/lxo> has joined #libre-soc23:03
lkclprogrammerjake, maxu you'll need to resolve, i had to back out the changes you made as they damaged ISACaller23:15
*** octavius <octavius!~octavius@146.90.27.39> has quit IRC23:34

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