#asahi-gpu · 2021-04-11 03:45
bloomseems a very natural translation#asahi-gpu · 2021-04-11 03:45
bloomwhile(x) { ... } ---> start: icmpsel r0l, x, #0, #1; pop_exec 0; jmp_exec_none end; ....; jmp_exec_any start; pop_exec 0;#asahi-gpu · 2021-04-11 03:43
bloomI still don't see what while_*cmp is for#asahi-gpu · 2021-04-11 03:36
bloom^ indeed, and more aggressively than any other gpu i've played with#asahi-gpu · 2021-04-11 03:35
bloomThis doesn't really prove anything since the latter compile is always legal, just not always optimal.#asahi-gpu · 2021-04-11 03:33
bloomif (uniform) { expensive() } ----> if_icmp / jmp_exec_none * / expensive() / * pop_exec#asahi-gpu · 2021-04-11 03:33
bloomif (varying) { expensive() } ----> if_icmp / expensive() / pop_exec#asahi-gpu · 2021-04-11 03:32
bloomAlthough I'm not actually seeing a good way to use that info here, hm.#asahi-gpu · 2021-04-11 03:32
bloom(Most obvious case is "if (uniform) { .. }" but also less obviously "if (ballot(..)) { ... }"#asahi-gpu · 2021-04-11 03:31
bloomBut if we can prove at compile-time that all the threads in a given SIMD group will branch together, there's often optimizations to be had#asahi-gpu · 2021-04-11 03:30
bloomAll the silliness is needed for divergent (data-dependent) branches "if (some_varying) { ... }"#asahi-gpu · 2021-04-11 03:30
bloom"Divergence analysis" ~~calculates the sums of partial derivatives of a vector field~~ determines what values might differ across threads in a SIMD gorup#asahi-gpu · 2021-04-11 03:28
bloomtries to come up with example#asahi-gpu · 2021-04-11 03:28
bloom(I think)#asahi-gpu · 2021-04-11 03:27
bloomsomething else that may be either obvious or confusing -- for optimal perf, the compiler needs to do full divergence analysis#asahi-gpu · 2021-04-11 03:25
bloomall of this seems both intuitively obvious and completely impossible to wrap my head around :-p#asahi-gpu · 2021-04-11 03:25
bloomcan it be both obvious and confusing?#asahi-gpu · 2021-04-11 03:23
bloomoh, you can update r0l directly, right :p#asahi-gpu · 2021-04-11 03:20
bloomloop { ... } I guess is just `*: ...; jmp_exec_any *`#asahi-gpu · 2021-04-11 03:19
bloomif { ..} corresponds naturally to if_cmp/pop_exec.. the other 3 not so much#asahi-gpu · 2021-04-11 03:18
bloom(Basically we get `if { ... }` `loop { .. }` `break` and `continue` and that's it. while loops become things like `loop { if not cond { break } .. }`#asahi-gpu · 2021-04-11 03:17
bloomThe CFG we get from NIR is very simple, which is great for normal hw with actual branch instructions, but...#asahi-gpu · 2021-04-11 03:17
bloomI expect this will have big implications on how the IR will be structured#asahi-gpu · 2021-04-11 03:16
bloomnods#asahi-gpu · 2021-04-11 03:13
bloomoh!#asahi-gpu · 2021-04-11 03:11
bloomtries to wrap her head around apple control flow#asahi-gpu · 2021-04-11 03:10
bloomsrs :(#asahi-gpu · 2021-04-11 03:08
bloom"i like less magic, i like declarative descriptions," unfortunately writing in languages designed in the 70s means these are mutually ^#asahi-gpu · 2021-04-11 03:04
bloomthere's likely a healthy balance..#asahi-gpu · 2021-04-11 02:58
bloomfor hw with an active r/e effort, that may backfire. otoh, being bale to add instructions easily matters far more for r/e!#asahi-gpu · 2021-04-11 02:57
bloomfor the compilers at work, I have full visibility into the ISA so I can do proper top-down design.. so having one master ISA.xml that everything is generated from works well#asahi-gpu · 2021-04-11 02:56
bloomthere's also a question of what level of magic is appropraite#asahi-gpu · 2021-04-11 02:48
bloombut not sure if there's much point in defining an intermediate XML schema for the sake of it, or trying to wire up robclark's isaspec (which will have impedance mismatches of its own)#asahi-gpu · 2021-04-11 02:47
bloomJust want the actual encoding details, so then we can spit out C code to do what we need#asahi-gpu · 2021-04-11 02:47
bloomI suspect we don't want emulation, or the Python disasm/asm stack, in Mesa.#asahi-gpu · 2021-04-11 02:46
bloomnod#asahi-gpu · 2021-04-11 02:39
bloomI suspect whatever I did today is Not it#asahi-gpu · 2021-04-11 02:39
bloomdougall: yeah, still trying to figure out the Right way to approach it is#asahi-gpu · 2021-04-11 01:52
bloomNIR to real code, yes#asahi-gpu · 2021-04-11 01:45
bloomhave most of the big ideas sketched in my head, we'll see how long it takes me to get to simple shaders#asahi-gpu · 2021-04-11 01:45
bloomI started writing the compiler#asahi-gpu · 2021-04-11 01:45
bloomAnyway uhm#asahi-gpu · 2021-04-11 01:36
bloomI guess#asahi-gpu · 2021-04-11 01:27
bloomI thought we were just having fun :)#asahi-gpu · 2021-04-11 01:27
bloomDuplicating effort?#asahi-gpu · 2021-04-11 01:23
bloomOkey dokey#asahi-gpu · 2021-04-11 01:16
bloomNothing is set in stone yet#asahi-gpu · 2021-04-11 01:16
bloomstill experimenting