ChanServ changed the topic of #panfrost to: Panfrost - FLOSS Mali Midgard & Bifrost - Logs https://oftc.irclog.whitequark.org/panfrost - <macc24> i have been here before it was popular
camus has quit [Remote host closed the connection]
camus has joined #panfrost
atler is now known as Guest853
atler has joined #panfrost
wwilly has quit [Ping timeout: 480 seconds]
Guest853 has quit [Ping timeout: 480 seconds]
br has quit []
br has joined #panfrost
thecycoone has quit []
thecycoone has joined #panfrost
davidlt_ has joined #panfrost
davidlt_ has quit [Ping timeout: 480 seconds]
Danct12 has quit [Quit: Quitting]
Danct12 has joined #panfrost
wwilly has joined #panfrost
wwilly has quit [Remote host closed the connection]
camus1 has joined #panfrost
davidlt_ has joined #panfrost
camus has quit [Remote host closed the connection]
alpernebbi has joined #panfrost
warpme_ has joined #panfrost
rasterman has joined #panfrost
wwilly has joined #panfrost
mixfix41 has joined #panfrost
mixfix41_ has quit [Ping timeout: 480 seconds]
robmur01 has joined #panfrost
nlhowell has joined #panfrost
jkl has quit [Quit: ZNC 1.8.2 - https://znc.in]
jkl has joined #panfrost
jkl has quit [Quit: ZNC 1.8.2 - https://znc.in]
jkl has joined #panfrost
camus1 has quit [Ping timeout: 480 seconds]
camus has joined #panfrost
camus1 has joined #panfrost
camus has quit [Read error: Connection reset by peer]
camus has joined #panfrost
camus1 has quit [Ping timeout: 480 seconds]
camus1 has joined #panfrost
camus has quit [Ping timeout: 480 seconds]
camus1 has quit []
stan has quit [Ping timeout: 480 seconds]
stan has joined #panfrost
wwilly_ has joined #panfrost
wwilly has quit [Ping timeout: 480 seconds]
davidlt_ has quit [Ping timeout: 480 seconds]
Danct12 has quit [Quit: Quitting]
Danct12 has joined #panfrost
robmur01 has quit [Quit: Leaving]
megi has quit [Quit: WeeChat 3.2]
alpernebbi has quit [Quit: alpernebbi]
megi has joined #panfrost
atler has quit [Quit: atler]
macc241 has joined #panfrost
macc24 has quit [Read error: Connection reset by peer]
macc241 has quit []
macc24 has joined #panfrost
rasterman has quit [Quit: Gettin' stinky!]
alyssa has joined #panfrost
<alyssa> You don't want to know the lenghts I went to dump this table 😋
<macc24> wow
<macc24> what is this
<alyssa> macc24: A page from ~the~ my architecture specification for Valhall.
<macc24> huh
<alyssa> (It turns out writing docs is an excellent way to procrastinate on writing code!)
<macc24> bbl
<alyssa> I jest.
<alyssa> If a shader uses a constant value (e.g. `gl_FragColor = foo + 0.2345`), there are 3 possible ways that constant can be encoded in Valhall:
<alyssa> * Embedded in the command stream directly. This only works for addition. Otherwise you waste an instruction adding 0.
<alyssa> * Promoted to a uniform and then accessed as a uniform. This is 'free' except uniforms are limited, and this competes with the encoding used by actual uniforms.
<alyssa> * As a lookup into a fixed table of "common" constants. This is completely free, with the caveat that it only works for a small number of very special values... not that Arm tells us which they are!
<alyssa> Rather than trying to guess constants and see how the Arm compiler handles them, I wrote a program to dump the lookup table from the hardware itself.
<HdkR> Nice!
<alyssa> It's, uh, not pretty. But I started writing an assembler for Valhall, and this was an easy use ... bash script to generate programs that add zero to a given index into the LUT and store them to memory mapped by an OpenCL program, assemble those with my assembler, push it to the device of adb, replace the shader in vivo with panwrap LD_PRELOAD'd, and dump the resulting OpenCL memory to get the value.
<alyssa> Doing that gave me the 32 special values that are hardcoded into Valhall's silicon, which are in the "Value" column of the linked PDF.
<alyssa> But it's not enough to know _what_ the values are, we should also understand _why_ these values were picked.
<alyssa> We can't /know/ what Arm's hardware engineers were thinking, but we can make very firm guesses. So the last column of the table are my interpretations of the values.
<HdkR> All the integer ones are easy. Scale by N different ways
<alyssa> Yep.
<alyssa> Nothing here is terribly surprising :)
<alyssa> So I took all the data I dumped and stored it as XML with description attributes on the elements*
<robclark> adreno has a similar thing for encoding float immeds in instructions (or rather, the groups of instructions which can encode immeds).. I call it "FLUT".. I assume they (and arm) just collected a bunch of shaders of useful games/benchmarks and did some scripting to figure out which values show up more frequently
<HdkR> Loads of people must be multiplying by 0.1 :D
<robclark> (int immeds you can just directly encode, assuming they fit in the # of bits avail)
<alyssa> So then all the tooling I'm building up (assembler, disassembler, compiler encoding, and documentation generator) can get access to everything and nothing goes out of sync.
<alyssa> * the XMPP people are rubbing off
<alyssa> robclark: Yeah, presumably. Curious thing here is that Valhall doesn't let int immeds be encoded directly, which is why rows 5-15 are "needed" even though it's silly.
<alyssa> Apple represents the other extreme -- there is no LUT. Instead you only have 8-bit ints for your immediates ... with the twist that floating-point instructions interpret the int as a 3:5 minifloat :-)
<robclark> yeah, that is a bit silly
<alyssa> (This does means Apple needs a uniform slot for pi, 1/pi, log(2) ...)
<alyssa> robclark: You would think if Arm and Qcm were looking at useful games/benchmarks they'd come up with remotely similar lists.. ;-p
<robclark> from a quick look, there is *some* overlap..
nlhowell has quit [Ping timeout: 480 seconds]
<macc24> alyssa: maybe arm considers different usecase?
<anholt> v3d/vc4's small immediates are small integers and float powers of two, no pi or anything.
<anholt> kind of disappointing, given that their uniforms are so expensive