Thursday, 2022-07-28

lkclmarkos, yes, that makes sense.01:37
lkclprogrammerjake, the very first function from the Power ISA spec i started hand-converting the pseudo-code into python.01:37
lkcli quickly realised "this was nuts" (i could easily make a transcription mistake) and to instead add the fphelpers.mdwn01:38
lkclwhat i didn't do however was go back and redo (re-put) the pseudocode for SINGLE() from p144 4.6.3 into fphelpers.mdwn01:38
lkcl(because time)01:38
programmerjakeDOUBLE2SINGLE does not occur anywhere in the PowerISA spec. v3.1B01:41
programmerjakenot by that name, at least01:41
lkcl  6 <!-- Power ISA Book I Version 3.0B Section A.1 page 775-778 -->01:46
lkclthey fail to give it a function name.01:46
lkcllikewise A.201:46
programmerjakek01:47
programmerjakeit's specifically only used for frsp, why not just stick it in frsp's pseudo-code?01:48
lkclbecause that's not what has been done in frsp.01:48
lkclthe function is useful (and used, a lot) outside of frsp01:49
lkclsee the unit tests that i wrote.01:50
programmerjakefrsp just doesn't have any pseudocode ... probably because it's just too long, so they just reference the appendix instead.01:50
programmerjakewhere they put frsp's suggested pseudocode01:51
lkclagreed, likely.01:53
lkclturns out it can be used for other purposes01:53
lkcli was in a rush to get it working for lauri01:54
programmerjakek01:54
programmerjakeit's still broken tho01:54
lkclas he was held up as the instructions were missing01:54
lkclit's entirely missing the rounding modes (and i don't care at this immediate time, it "does the job" of demoing mp3)01:55
lkcli needed to get lauri up-and-running as quickly as possible, and did a hell of a lot of instructions in a very short amount of time01:56
programmerjakei can fix it, if you like01:58
programmerjakeshouldn't take long01:58
lkclsure go for it03:58
ghostmansd[m]lkcl, markos, are you done with new insns? Are they stable to be added into binutils?06:45
markosghostmansd, I think so10:28
markosI could add a few more tests tbh, to check for very large values, and inf/NaN values10:29
ghostmansd[m]This has nothing to do with binutils, though10:29
ghostmansd[m]I'm mostly worrying about the semantics, e.g. operands and XOP10:30
markosok then, in that case it should be considered done10:31
markossyntax/semantics is not expected to change10:31
ghostmansdmarkos, star!10:57
ghostmansdhttps://bugs.libre-soc.org/show_bug.cgi?id=845#c210:57
ghostmansdAlso, a question: any tips on the longest instruction name (including all possible qualifiers)? Without macros, obviously, just plain constants or well-known symbols.10:58
lkclghostmansd, those two fmvis and fishmv are "done"11:02
lkcleek. probably... ternlogi or crternlog11:03
lkclmarkos, did you appreciate the Iain Banks quote?11:05
lkcl    sv.ternlogi/sm=32/dm=32/pr=1<<%r3/vec2/sw=32/dw=16 *r120, *r100, 25511:12
lkclgrevlut *might* exceed that slightly11:14
programmerjakewell, I've had enough converting pseudo-code and fighting with the parser for one day...gn all11:15
lkclprogrammerjake, :)11:15
lkclyyeah considerable care has to be taken11:15
lkclhttps://libre-soc.org/openpower/isa/svfparith/11:15
lkclit's a one-pass so you have to create temporary variables by declaring them as empty (full of zeros)11:16
lkcl   tmp = [0] * 3211:16
lkclsorry11:16
lkcl   tmp <- [0] * 3211:17
lkclgaah11:17
lkclthen filling in any bits to be changed11:17
programmerjakein my case, considerable head bashing...imho when we have time, we should just rewrite the parser as a recursive descent parser...it'll be waay easier to understand and give better error messages.11:17
lkclcommit what you have, commented-out, i'll take a look11:17
programmerjakeone of the errors I was running into was a unexpected DEDENT at the end of the function, caused by using incorrect code near the beginning of the function...idk how it decided that was the error...11:18
programmerjakewhat I committed is the final fixed code...11:18
lkclahh ok11:18
programmerjakeimho using ply was a bad choice, LR parsers often have trouble giving good error messages11:19
lkclexcept you've just removed DOUBLE2SINGLE which terminates being able to run any of the unit tests11:19
programmerjakeplus, it's slow because it has to generate the parsing tables11:20
lkcl1 sec...11:20
programmerjakeno, it's added to helper.py11:20
lkclyes, ok i see a DOUBLE2SINGLE helper function11:20
lkclok brilliant11:21
lkclhmmm i didn't realise there's a "return" statement.11:21
lkclthat's not part of the IBM pseudocode.11:21
programmerjakeI had to fix the python2 ast usage for assigning to a tuple11:22
programmerjakeactually, the original doc used a Return statement in 1 func -- Done in the rest11:22
lkclbizarre. and then not documented i get the general impression people sort-of randomly used stuff as they felt like it11:23
lkclon the basis "nobody is ever going to do this as real executable code"11:23
programmerjakeit is an appendix...11:23
markoslkcl, sadly I am not familiar with Iain Banks :(11:23
lkclpaul even said that some of the modifications we've done were rejected "because you just read the english, dummy". sigh11:23
lkclmarkos, a book called Excession, in which a [not-AI, but so advanced it exceeds the capacity of human intelligence by several orders of magnitude]11:24
lkcla machine-consciousness plans for decades how to do a "sleeper" on its hyperdrive engines11:25
programmerjakettyl11:25
lkclconverting them on-the-fly in order to drop its pursuers11:25
lkclthx jacob11:25
programmerjakeyw11:25
lkcland over a period of a few hours, begins ramping up to a sustained speed of 238,000 times the speed of light11:25
markos"times"?11:26
lkclthe pursuer, its engines severely overtaxed and damaged, does the math and works out that it must have converted its entire 16x2x2 *miles* long cargo bay into hyperdrive engines11:26
lkclspeed of light times 230,000.11:26
markosah hyperdrive11:26
lkclin Star Trek terminology that would be approximately... Warp 10,00011:27
lkcl:)11:27
markoshahaha11:27
lkclat which point, it declares, "dear holy fucking shit, where's it thinking of going, Andromeda??"11:27
lkclso the quote is appropriate to apply to those intrinsic numbers.11:28
lkclRVV is *25,000*11:28
markoslol11:28
lkclhttps://raw.githubusercontent.com/riscv-non-isa/rvv-intrinsic-doc/master/intrinsic_funcs.md11:28
lkclthe joke's on us, though, because if done as 1-D we have 10^6 intrinsics11:29
lkclforrrrtunately....11:29
markosso much for RISC-V being "simple"11:29
markosyeah, I'm with you on that11:29
lkclif done in any conceivable way as {Prefix-Intrinsic}{Suffix-Intrinsic}11:29
markosit's ridiculous11:29
lkclthat drops down to {10^4} *plus* {10^2} appx order-of-magnitude11:30
markosit could/should be down to a prefix intrinsic to set the state for the next intrinsic11:30
markosbut as 2 different intrinsics used in combination11:31
lkclpotentially a hell of a lot less than that if you can consider elwidth and predicate mask to be arguments of the intrinsics11:31
lkclyes basically11:31
lkclthe only thing being that it is the prefix that specifies the register-augmentation, so there will be some interaction between the two11:31
markoswell, it will certainly be a very interesting challenge11:32
markosbut one that will change the SIMD programming paradigm11:33
lkclyou mean, stamp up and down on it until the hole's 10 ft deep?11:34
markospretty much11:36
markosor make all SIMD developers all over the world (incl. myself) shed tears of joy because their torment is over11:36
* lkcl rueful - yeah11:38
lkclyou will however sadly still see people banging their heads against the wall.11:38
lkcli witnessed that on comp.arch last week11:38
markoschange is hard11:39
markosfor me it's an easy choice11:39
octavius"paul even said that some of the modifications we've done were rejected "because you just read the english, dummy", lkcl what did he mean by that?11:40
markosI cannot see myself still coding SIMD in the next 10 years, mostly because it will be impossible for me to learn 100k instructions -by that time, at that rate SVE5, AVX16777216, will probably hold that many instructions11:41
lkclthe people who wrote the ISA docs still consider it "theirs"11:41
lkcland they wrote it mostly as an aide-memoire to themselves, as a reminder of what they already know11:42
markosyou will find it easier to convince new developers11:42
lkclit's pretty clear that they have absolutely no idea or appreciation (or, they're beginning to learn) how much it takes for newcomers11:42
lkclexample:11:42
markosold dinosaurs will find it very difficult to leave their bread & butter for something better11:42
markoswhich is actually understandable11:43
lkclmarkos, yes basically. that's exactly what happened11:43
markosbut good luck trying to convince new devs on how to program SIMD is extremely difficult11:43
lkcloctavius, so there's an instruction which needs a signed-comparison11:43
lkclsorry, needs an unsigned-comparison11:43
lkclbut in the pseudocode source code it uses "<"11:44
lkcland then says in the "english words" (below), "all operations in above pseudocode are unsigned"11:44
lkclwhich is bullshit11:44
lkclwhen we proposed fixing that, we were told, "but the pseudocode is not supposed to be executable, you're supposed to just read the english"11:44
octavius'<' means 'less than' in this case?11:44
lkclwhich is definitely bullshit11:45
lkclyes.11:45
lkclthere's also an "<u" operator11:45
octaviusAh, they still have the mindset of "this is just an aide"11:45
lkclif you compare a negative number against a positive number and use each of those operators "<" and "<u" you get *different* answers11:45
markosit's supposed to be just descriptive until it isn't11:45
markosas I learned11:45
lkcl:)11:46
octaviusThe thing I noticed when first joining libre-soc is the software engineering methodology to hardware, I'm afraid it'll take a while for this view to become mainstream11:46
markosin that aspect it's no different than eg. protobuf11:46
markosand just as making a stupid syntax error in protobuf will end up in destroying your communications protocol11:47
lkcloctavius, there are 10x more software engineers than hardware engineers in the world11:47
octaviusSo are they not planning to fix the pseudocode?11:47
markosyou will have the same effect here11:47
lkclao486 i believe actually compiles x86 spec pseudocode into verilog11:47
lkcloctavius, actually their attitude runs afoul of the Anti-Trust provisions set down by the OPF.11:48
lkclstrictly speaking11:48
octaviusYeah, the hardware engineers who understand will switch11:48
lkclwe're going to have to remind them, diplomatically and "appropriately assertively", that there are now other people working with Power ISA11:49
markosI see a trend in the industry in general11:49
lkclmarkos, it helps that Anton, Ben Herrenschmidt, Joel Shenki, Mikey and Paul are all software-engineer-trained11:49
markostoday's technology is overly complicated11:49
lkcl(those are the major contributors to microwatt)11:50
markosand people have started to actually step back a few years and rethink some of the changes11:50
markoss/changes/advances11:50
lkclyehyeh. both words work11:50
markoshence the need for RISC-V, or SVP64 or even the sudden love for retro computing11:51
lkclheh11:51
markosI know I prefer my retro computers much more than even my fastest Xeon11:51
octaviusdoes the '/s' notation only come from vim, or does it originate from somewhere else/11:51
lkcloctavius, sed11:51
markosbecause I can actually *understand* how they work11:51
markossadly I cannot work on those11:51
lkclsed, perl, ex, and i think perl11:52
octaviusah ok11:52
lkclsorry, awk11:52
markosbut if you have a simple yet powerful architecture that skips all this complexity and just gives you raw speed11:52
markosI honestly can't see how this can do anything but succeed11:52
lkclex was - is - a line-based editor (for when you only had say a single-line screen, a serial console, or even a line-at-a-time printer)11:53
lkclit's still one of the modes of vi (try typing :ex)11:53
lkcli really really want to move ahead onto the coherent scheduled distributed computing thing11:54
lkclbut there's still a loooong way to go yet11:54
octaviusAlso lkcl, which program do you use to edit pdf's?11:54
octaviusOther than proprietary rubbish11:54
lkcloctavius, i don't. never tried, so i don't know11:55
octaviusAh ok11:55
lkclsomeone else might.  libreoffice?11:55
lkclupload to google docs and convert it?11:55
octaviusthat's no better XD11:56
lkcli sent you the docx11:56
octaviusThanks11:56
lkclwhatever the hell that is11:56
* lkcl need breakfast11:56
lkclghostmansd, there's a reply to you several lines up. in case you missed it. sorry saw what you wrote last night but it was a bit late13:17
ghostmansd[m]lkcl, sorry, reply to what? About insns?14:00
ghostmansd[m]If so, I haven't missed, just looking at the different stuff now though (prefix)14:01
lkclyes, esp. the length17:21
lkclbasically any 32-bit scalar instructions they are completely stand-alone [but oh look need a corresponding sv_binutils-generated entry]17:22
lkclgiven that the opc-svp64.[ch] haven't been upstreamed yet i'd recommend considering waiting until they have17:23
lkclotherwise you have to replace the damn thing with a new patch-run17:23
ghostmansd[m]lkcl, I'm kinda confused. Could you, please, send me a link to irclog entry?19:21
ghostmansd[m]Usual 32-bit insns (w/o sv. prefix) do not need anything from sv_binutils.19:22
ghostmansd[m]In fact, they are no different than any other insns which already exist in binutils.19:22
ghostmansd[m]And, as such, go to the same table with mark "allow only when -mlibresoc is present".19:23
ghostmansd[m]So, we don't have to wait for generated files to be committed, because these do not belong to generated files (and binutils folks were pretty clear they want to have new instructions in the same table but with different flags).19:25
ghostmansd[m]Please, correct me if I'm wrong. I might be misinterpreting your messages.19:25
ghostmansd[m]Wasted the most part of the day with prefices, so my mind isn't particularly sharp now. :-)19:26
ghostmansdIt'd have been way better if IRC allowed to reply to concrete message as eg. Telegram does.19:27
programmerjakematrix allows replying to specific messages....19:41
programmerjakethough iirc that's just rendered in irc as a `> <replied-to-msg>` line before your message19:42
programmerjakeooh: https://www.phoronix.com/news/Google-SkyWater-90nm19:45
programmerjakemaybe libre-soc would fit now!19:45
tplatenI guess that this is incomplete. some parts are missing and/or non-free19:53
programmerjakehmm...maybe they haven't finished releasing everything?19:54
tplatenGodot 4 will be releases soon https://www.phoronix.com/news/Godot-4.0-Beta-Soon19:54
tplatenI hope to be able to test the libre-soc vulkan driver with that version on my Talos II. Since the POWER9 does not have SVP64, I'll need a different backend here.19:56
tplatenI've already ported embree to the POWER9 and I am currently porting other VR-related software too.19:58
programmerjakemy plan for kazan has always had support for traditional simd or just scalar cpus...that said kazan is nowhere close to ready to test19:58
programmerjakellvm handles all of the vector translation stuff19:59
tplatenthere is also a mesa driver, but that one is incomplete too20:00
tplatenSo I first test using AMD Vulkan or maybe PanVK20:01
lkclghostmansd, https://libre-soc.org/irclog/%23libre-soc.2022-07-28.log.html#t2022-07-28T11:12:4821:04
lkclthat was the original question i answered21:04
lkclyes, you are right in that 32-bit instructions without prefixing do not need sv_binutils, and would mark "allow only when -mlibresoc is present"21:05
lkclhowever the addition of say fmvis *has* also triggered an entry into SVP64 CSV files21:05
lkclso you *will* require a corresponding re-run of sv_binutils21:06
lkclactually, ha ha, irony, except there's a bug in sv_analysis.py, it *won't* end up in the SVP64 CSV files21:07
lkclfishmv on the other hand does21:08
lkclopenpower/isatables/RM-2P-1S1D.csv:fishmv,NORMAL,,2P,EXTRA3,TODO,0,0,0,FRS,0,0,FRS,0,0,021:08
lkclbecause it's been identified as an RM-2P-1S1D21:08
lkclbut fmvis hasn't yet got a register "profile identity type"21:09
lkclbecause it's only 1R (1-Read)21:10
lkcl    # mapping to old SVPrefix "Forms"21:10
lkcl    mapsto = {21:10
lkcl              '1R': 'non-SV',21:10
lkcl}21:10
lkclwark-wark21:10
ghostmansd[m]I'll check it, but likely after some experiments with prefices. First, I want to move a bit further with that task, and second, this might give FSF some time to finish this damn copyright assignment.21:25
lkclha.21:25
ghostmansd[m]Not sure of the latter, though. It seems that it's never enough. :-)21:25
lkcllast hoop was "sign-off by president" wasn't it?21:25
ghostmansd[m]I guess they have to approach Vladimir Putin, otherwise I have no explanation why it gets that much time.21:26
lkclhave you seen the series "Limitless"?21:27
ghostmansd[m]Nope21:27
lkclhttps://en.wikipedia.org/wiki/Limitless_(TV_series)#Episodes21:28
lkclEpisode 1821:28
lkclit's a really funny series. not too serious about itself. totally breaks the 4th wall21:28
ghostmansd[m]I just recalled an old Russian anecdote.21:30
ghostmansd[m]What does it take to fix a roof? Two guys, three meters of ruberoid, one bucket of tar. The only issue is that the two guys must be sent by the President.21:30
ghostmansd[m]Thanks Luke, will check! I like the genre of breaking the 4th wall. Wilfred, Deadpool, even Family Guy do it21:31
lkclfor context there's the film as well, although the series works even if you haven't seen the film of the same name21:32
lkclghostmansd[m], congratulations, you have a new SVP64 RM type RM-1P-1S21:33
lkclhttps://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=9fc4f5fd4ec2e3a3e52acacaf699f18d324b9f2d21:33
ghostmansd[m]I realized I'd seen the film21:34
lkclha!21:34
ghostmansd[m]Only realized when I saw the main actor's name21:34
ghostmansd[m]Never knew the name of the film, saw three or four times on TV :-)21:35
lkclok so the tv series is the continuation, a few weeks after that21:35
lkcldoh21:35
lkclyou have a TV??21:35
markoslkcl, just saw the email, could please explain why?21:35
lkclbecause it is an input.  FRS is.... i am stupid21:35
lkcli am very very stupid21:36
lkclthat's why21:36
markosI'm even more confused now21:36
lkcli have a mild form of dyslexia21:36
ghostmansd[m]> you have a TV??21:37
ghostmansd[m]Anytime I visit my parents21:37
markospretty sure that doesn't turn you into stupid :)21:37
markosbut in any case, do I have to fix it?21:38
lkclmarkos, nope21:38
* lkcl on it21:38
lkcl+++ b/openpower/isatables/RM-1P-1D.csv21:39
lkcl@@ -1,2 +1,3 @@21:39
lkcl insn,mode,CONDITIONS,Ptype,Etype,0,1,2,3,in1,in2,in3,out,CR in,CR out,out221:39
lkcl+fmvis,NORMAL,,1P,EXTRA3,d:FRS,0,0,0,0,0,0,FRS,0,0,021:39
lkclthat's more like it21:39
lkclghostmansd[m], nope.  there's only a new entry in RM-1P-1D21:39
lkclhttps://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=2ce11894505e4194904ef095ad6aa32ff36a3fbf21:42
markosah, right forgot to commit that file after running sv_analysis21:43
lkclmarkos, you'd not have had anything added because it was not recognised21:43
ghostmansd[m]All these exceptions in process_cvs look suspicious21:44
ghostmansd[m]Aren't there way too many of those?21:44
lkclthe profiling initially creates a key "unit-num(inregs)-num(inCRs)-num(outregs)-num(outCRs)-immediate(yes/no)"21:45
lkclwhich then gets turned into a string21:45
lkcl1R-1W-imm21:45
lkclor21:45
lkcl2R-1W-CRo21:45
lkclthe entry "1W-imm" which covers fmvis was entirely missing21:45
lkclwell... i mean, they have to go somewhere21:46
lkclrfid for example it has a register profile but is completely inappropriate to be Vectorised21:47
ghostmansd[m]Ok, fair enough21:59
ghostmansd[m]Still I have to admit that the naming looks kinda cryptic22:00
lkclit needs documenting, for sure. sv_analysis.py is basically part of the specification.22:27
lkclmarkos, https://gist.github.com/zingaburga/805669eb891c820bd220418ee3f0d6bd#file-sve2-md22:27
lkclfound ARM's SVE2 Matrix extension23:22
lkclhttps://developer.arm.com/documentation/ddi0602/2022-06/SME-Instructions/SMOPA--Signed-integer-sum-of-outer-products-and-accumulate-?lang=en23:22
lkclbased on "outer-product-and-accumulate"23:22

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