#
#asahi-gpu · 2023-04-26 00:37
alyssa---
#asahi-gpu · 2023-04-26 00:35
alyssaI would like to have cycle count estimates in my shader-db stats, but meh, I don't think we know enough about the uarch to do that accurately yet.
#asahi-gpu · 2023-04-26 00:30
alyssaPerformance of shifts by 10 is not of any importance whatsoever to me. But it's a nice test case for reasoning about the uarch.
#asahi-gpu · 2023-04-26 00:29
alyssaPossibly there are battling latency and i-cache concerns here, this might be a heuristic it has
#asahi-gpu · 2023-04-26 00:29
alyssaThat is, it will use 2 iadds to save a bfi, but will not use 3 iadds
#asahi-gpu · 2023-04-26 00:29
alyssaIn reality, Apple's compiler chooses to use bfi for 9 and above, but x << 8 is chained iadds
#asahi-gpu · 2023-04-26 00:28
alyssathat suggests x << 12 would be implemented with chained iadds, but x << 13 is a toss up, but x << 17 would be real bitwise
#asahi-gpu · 2023-04-26 00:27
alyssameaning from a raw throughput instruction, using 3 adds (with lsl) to save a real shift would still be a win
#asahi-gpu · 2023-04-26 00:27
alyssawith int32 addition and basic bitwise ops on the SCIB unit, but the variable barrel shifters on the IC unit
#asahi-gpu · 2023-04-26 00:26
alyssaI haven't done any benchmarking myself, but comparing Philip Turner's notes with dougall's, I guess there are 4 SCIB units per 1 IC unit on Apple M1
#asahi-gpu · 2023-04-26 00:23
alyssa(different ALUs)
#asahi-gpu · 2023-04-26 00:23
alyssa(those are functional units, in the perf counters)
#asahi-gpu · 2023-04-26 00:23
alyssaalthough, if there are a lot more SCIB than IC units than it makes sense
#asahi-gpu · 2023-04-26 00:21
alyssai fail to see why that would be a win
#asahi-gpu · 2023-04-26 00:21
alyssathen, weirdly, <<5 is implemented by chaining iadd(lsl 1) with iadd(lsl 4)
#asahi-gpu · 2023-04-26 00:21
alyssaup to lsl 4 for a single iadd
#asahi-gpu · 2023-04-26 00:20
alyssa(and will optimize isub lsl to imad, weirdly)
#asahi-gpu · 2023-04-26 00:20
alyssabut not in lieu of imad
#asahi-gpu · 2023-04-26 00:19
alyssait does use isub lsl
#asahi-gpu · 2023-04-26 00:18
alyssaoh, this is interesting, it uses iadd+lsl instead of bfi for small shifts
#asahi-gpu · 2023-04-26 00:17
alyssaimad for * -7
#asahi-gpu · 2023-04-26 00:17
alyssaimad for * 7
#asahi-gpu · 2023-04-26 00:17
alyssaimad for * 33
#asahi-gpu · 2023-04-26 00:17
alyssa* 17 too
#asahi-gpu · 2023-04-26 00:16
alyssaapple's compiler implements * 9 with iadd lsl
#asahi-gpu · 2023-04-23 18:23
alyssapass type punchtrough
#asahi-gpu · 2023-04-23 18:23
alyssalines or points is true
#asahi-gpu · 2023-04-23 18:23
alyssano colour output is false
#asahi-gpu · 2023-04-23 18:22
alyssafragment properties: unk 2, discard 1/2 set, unk3=0xf, unk4=2
#asahi-gpu · 2023-04-23 18:22
alyssashared is 32x16 sample count 1 stride 8 bytes per threadgroup 4096
#asahi-gpu · 2023-04-23 18:22
alyssawith no colour attachments but a sample mask write, no depth stencil
#asahi-gpu · 2023-04-23 17:18
alyssaand some code review https://gitlab.freedesktop.org/asahi/mesa/-/merge_requests
#asahi-gpu · 2023-04-23 17:18
alyssalina: for next time you work on asahi stuff, got some regressions https://gitlab.freedesktop.org/asahi/mesa/-/issues
#asahi-gpu · 2023-04-16 02:12
TellowKrinkleHere's the color + depth clear shader that manages to take up 1/5 of all time spent rendering that dff https://gist.github.com/TellowKrinkle/9e9f1f56a2756864c3814471f45ff064
#asahi-gpu · 2023-04-16 01:58
TellowKrinkleThere's a few more around 200µs, and the rest take up pretty much nothing
#asahi-gpu · 2023-04-16 01:57
TellowKrinkle400µs in a full screen pass that just seems to add a shadow for Mario. 55 instructions, 8 registers.
#asahi-gpu · 2023-04-16 01:53
TellowKrinkle500µs in an alpha-only EFB copy shader
#asahi-gpu · 2023-04-16 01:50
TellowKrinkle700µs in some shader that does an alpha-blended distortion effect. Samples an EFB copy, so might be memory bound. 231 instructions, 16 registers.
#asahi-gpu · 2023-04-16 01:43
TellowKrinkleAnother 1ms making another EFB copy, same as above
#asahi-gpu · 2023-04-16 01:42
TellowKrinkle1ms spent making an EFB copy to VRAM, this one's most likely memory bound
#asahi-gpu · 2023-04-16 01:40
TellowKrinkle1.2ms spent drawing the ground, 163 instructions, 12 registers.
#asahi-gpu · 2023-04-16 01:39
TellowKrinkle1.4ms spent drawing lava, our first actually useful draw. 219 instructions, 16 registers.
#asahi-gpu · 2023-04-16 01:35
TellowKrinkle1.5ms spent in a fullscreen depth clear (color writes are masked), which also samples that 4x4 all-white texture. 76 instructions, 12 registers.
#asahi-gpu · 2023-04-16 01:34
TellowKrinkle2ms spent in a fullscreen color clear, which samples a 4x4 all-white texture for who knows what reason. 83 instructions, 12 registers for the fragment shader.
#asahi-gpu · 2023-04-16 01:33
TellowKrinkleLooking at melty molten galaxy in a Metal GPU trace and most of the time is spent on the dumbest things, and it looks like they may actually be ALU bound.
#asahi-gpu · 2023-04-16 00:56
TellowKrinkleLooks like runs 10 render passes per frame, and gets nearly full occupancy throughout most of it
#asahi-gpu · 2023-04-16 00:56
TellowKrinkleBTW here's the gpu activity chart for one frame of specialized 4K in Metal: https://tellowkrinkle.com/img/DolphinMeltyMoltenGalaxyMetal6xInstruments.png
#asahi-gpu · 2023-04-16 00:42
alyssa(43% of the way there :^)
#asahi-gpu · 2023-04-16 00:41
alyssaso a big chunk of the gap seems to be register pressure
#asahi-gpu · 2023-04-16 00:40
alyssa---

plus ›