<davidrysk[m]>
hthh_: those special registers seem similar to the grid/thread/block stuff that cuda and other gpu compute frameworks use
<davidrysk[m]>
I would not be surprised if they're used for that, e.g. threadgroup_position_in_grid.x always returns the appropriate value for the block in which you are currently executing in
danb91 has joined #asahi-re
taziden has quit [Ping timeout: 264 seconds]
danb91 has quit [Ping timeout: 256 seconds]
<hthh_>
yeah, i think that's how it works - the SRx names are from mtl-gpu-asmcheck, and the other names are my attempt at mapping the attributes in the metal shading language back to them - not sure if it actually stands for "special register" though
Necrosporus_ has joined #asahi-re
Necrosporus is now known as Guest10337
Guest10337 has quit [Read error: Connection reset by peer]
danb91 has joined #asahi-re
taziden has joined #asahi-re
<davidrysk[m]>
it's possible that the runtime populates them as needed
<davidrysk[m]>
but yeah more likely that the hardware does
<davidrysk[m]>
are there other instructions than those?
danb91 has quit [Remote host closed the connection]
danb91 has joined #asahi-re
danb91 has quit [Ping timeout: 246 seconds]
<hthh_>
oh so many - unfortunately llvm considers each combination of opcode and output sizes to be a distinct instruction, so the reversing process is still very manual, either getting the compiler to generate opcodes from known code, or constructing it myself to run on the gpu and check its behavior
<hthh_>
(the hope is the operands stay pretty consistent and i can just write hardware tests to automate verification of my assumptions)
<marcan>
hthh_: make sure the documentation strictly documents the instructions, and not anything about what llvm does
<marcan>
as long as you write clean docs that we can use to write a clean-room implementation, this is valuable work
<marcan>
but if LLVMisms from Apple's implementation leak into the docs, that can taint them
danb91 has joined #asahi-re
<marcan>
alyssa has been doing this completely black-box up to this point, without any internal APIs; we ban outright decompilation of the GPU stack because it's just not needed; using internal APIs to get more information about the ISA is more of a grey area, but if it goes through clean-room docs that should be fine. let's keep it that way.
danb91 has quit [Ping timeout: 264 seconds]
<hthh_>
sure, yeah, clean-room docs is my goal - i currently document what the compiler outputs in a few places, which isn't "just the instructions" but is what alyssa is looking at too - but yeah, i intend to clean it up a bit in that respect. (i'm also considering register names to be "facts" - lots of grey areas)
<marcan>
register names are OK
<marcan>
things like uX / srX are not a problem
<marcan>
for long-form register names, I would encourage you to make up your own interpretation about what they do and use that name
<marcan>
this does mean that you should stay on that side of the clean room, so no contributing to Mesa please :)
<marcan>
(code, I mean)
<marcan>
I've asked Alyssa what she thinks about this approach
dumenci has joined #asahi-re
<hthh_>
sounds good, yeah - i won't be contributing code, and that's exactly what i've been doing for long-form names (mnemonics are also completely made up)
dumenci has quit [Quit: Leaving]
Tokamak has quit [Ping timeout: 264 seconds]
browzing_ has joined #asahi-re
browzing has quit [Ping timeout: 246 seconds]
randohacker[m] has joined #asahi-re
_whitelogger has joined #asahi-re
maor26 has joined #asahi-re
DanB91 has joined #asahi-re
DanB91 has quit [Ping timeout: 256 seconds]
tiagom has joined #asahi-re
tiagom has quit [Quit: leaving]
tiagom has joined #asahi-re
ohnx has quit [Remote host closed the connection]
ohnx has joined #asahi-re
tiagom has quit [Quit: leaving]
tiagom has joined #asahi-re
Tokamak has joined #asahi-re
ohnx has quit [Read error: Connection reset by peer]
citruscitrus[m] has quit [*.net *.split]
liur[m] has quit [*.net *.split]
hypergenesis[m] has quit [*.net *.split]
thecake21[m] has quit [*.net *.split]
clayfreeman has quit [*.net *.split]
clayfreeman has joined #asahi-re
hypergenesis[m] has joined #asahi-re
liur[m] has joined #asahi-re
citruscitrus[m] has joined #asahi-re
thecake21[m] has joined #asahi-re
bakk[m] has quit [Ping timeout: 244 seconds]
wolf511[m] has quit [Ping timeout: 244 seconds]
hwatwasthat[m] has quit [Ping timeout: 244 seconds]
brentr123[m] has quit [Ping timeout: 244 seconds]
ah-[m] has quit [Ping timeout: 244 seconds]
fl35[m] has quit [Ping timeout: 240 seconds]
TellowKrinkle[m] has quit [Ping timeout: 240 seconds]
bjornjulander[m] has quit [Ping timeout: 240 seconds]
skillfulman23[m] has quit [Ping timeout: 240 seconds]
asmon[m] has quit [Ping timeout: 240 seconds]
nhlism[m] has quit [Ping timeout: 240 seconds]
Jamie[m] has quit [Ping timeout: 240 seconds]
jamesmunns[m] has quit [Ping timeout: 240 seconds]
redbluescreen[m] has quit [Ping timeout: 240 seconds]
svenpeter has quit [Ping timeout: 240 seconds]
rootspring[m] has quit [Ping timeout: 243 seconds]
fried_dede[m] has quit [Ping timeout: 243 seconds]
reispflanze[m] has quit [Ping timeout: 243 seconds]
jinen[m] has quit [Ping timeout: 243 seconds]
rockinrobstar[m] has quit [Ping timeout: 243 seconds]
khronokernel[m] has quit [Ping timeout: 243 seconds]
shawnj2[m] has quit [Ping timeout: 243 seconds]
bastilian has quit [Ping timeout: 243 seconds]
DrGit[m] has quit [Ping timeout: 243 seconds]
hipboi[m] has quit [Ping timeout: 243 seconds]
ConeOfAttack[m] has quit [Ping timeout: 260 seconds]
smist08[m] has quit [Ping timeout: 260 seconds]
mellotron1[m] has quit [Ping timeout: 260 seconds]
tarik02[m] has quit [Ping timeout: 260 seconds]
emily has quit [Ping timeout: 243 seconds]
blazra has quit [Ping timeout: 260 seconds]
os[m] has quit [Ping timeout: 246 seconds]
jevinskie[m] has quit [Ping timeout: 246 seconds]
sumoon[m] has quit [Ping timeout: 246 seconds]
ts170[m] has quit [Ping timeout: 246 seconds]
mcnight[m] has quit [Ping timeout: 246 seconds]
flokk[m] has quit [Ping timeout: 246 seconds]
winocm has quit [Ping timeout: 246 seconds]
nutmanja[m] has quit [Ping timeout: 246 seconds]
josiahmendes[m] has quit [Ping timeout: 246 seconds]
jrmuizel[m] has quit [Ping timeout: 265 seconds]
ronyrus[m] has quit [Ping timeout: 265 seconds]
mofux[m] has quit [Ping timeout: 265 seconds]
nufflee[m] has quit [Ping timeout: 265 seconds]
Bastian[m] has quit [Ping timeout: 265 seconds]
davidrysk[m] has quit [Ping timeout: 260 seconds]
Jasper[m] has quit [Ping timeout: 260 seconds]
randohacker[m] has quit [Ping timeout: 268 seconds]
iparaskev[m] has quit [Ping timeout: 268 seconds]
delroth[m] has quit [Ping timeout: 268 seconds]
xerpi[m] has quit [Ping timeout: 268 seconds]
enverb[m] has quit [Ping timeout: 268 seconds]
bylaws has quit [Ping timeout: 268 seconds]
_alice has quit [Ping timeout: 268 seconds]
konradybcio has quit [Ping timeout: 265 seconds]
citruscitrus[m] has quit [Ping timeout: 258 seconds]
hypergenesis[m] has quit [Ping timeout: 258 seconds]