#asahi-gpu · 2024-08-08 15:36
alyssakarolherbst: ook. so what I realized is real funny is that CL CTS is going to hit libclc for frcp#asahi-gpu · 2024-08-08 15:09
karolherbst(which gets real funny real quick when you also need fma lowering)#asahi-gpu · 2024-08-08 15:07
karolherbstlibclc be like: https://github.com/llvm/llvm-project/blob/main/libclc/generic/lib/math/acos.cl#L128#asahi-gpu · 2024-08-08 15:05
alyssamaybe not#asahi-gpu · 2024-08-08 15:04
alyssaI'm also wondering if there's a way to make lower idiv tolerate the error, for faster overall#asahi-gpu · 2024-08-08 15:04
karolherbstyeah...#asahi-gpu · 2024-08-08 15:04
alyssaneeds to be in-tree for idiv lowering anyhow#asahi-gpu · 2024-08-08 15:03
karolherbstmaybe not#asahi-gpu · 2024-08-08 15:03
karolherbstsomewhere#asahi-gpu · 2024-08-08 15:03
karolherbstthere is a good thing about this.. I think libclc already has the code for the lowering... but...#asahi-gpu · 2024-08-08 15:02
alyssamy aborted math degree came in handy!#asahi-gpu · 2024-08-08 15:02
alyssa:P#asahi-gpu · 2024-08-08 15:01
alyssagot it in 2#asahi-gpu · 2024-08-08 15:01
alyssaok#asahi-gpu · 2024-08-08 15:01
alyssalolz#asahi-gpu · 2024-08-08 15:01
karolherbstthat one#asahi-gpu · 2024-08-08 15:01
karolherbstyep#asahi-gpu · 2024-08-08 15:01
alyssa----wait is that a newton raphson step#asahi-gpu · 2024-08-08 15:01
karolherbsthow is that called#asahi-gpu · 2024-08-08 15:01
karolherbstthat's uhhh#asahi-gpu · 2024-08-08 15:01
karolherbstI've seen that one#asahi-gpu · 2024-08-08 15:01
karolherbstohh wait#asahi-gpu · 2024-08-08 15:01
alyssarcp := fma(fma(-input, rcp, 1.0), rcp, rcp)#asahi-gpu · 2024-08-08 15:01
alyssaunder a certain condition it'll adjust the output as#asahi-gpu · 2024-08-08 15:00
alyssathe other part though I don't quite understand yet#asahi-gpu · 2024-08-08 15:00
alyssa*denominators#asahi-gpu · 2024-08-08 15:00
alyssaone part is a scaling like scale_fdiv, to reduce the domain for large denomintaors#asahi-gpu · 2024-08-08 15:00
alyssathere are two parts to the lowering#asahi-gpu · 2024-08-08 15:00
alyssathis is... subtle#asahi-gpu · 2024-08-08 14:50
alyssamore complex, gimme a few mins#asahi-gpu · 2024-08-08 14:49
karolherbstjust some scaling like nir_scale_fdiv or something more complex?#asahi-gpu · 2024-08-08 14:48
karolherbst:3#asahi-gpu · 2024-08-08 14:48
alyssacute.#asahi-gpu · 2024-08-08 14:48
alyssakarolherbst: frcp with -no-fast-math has lowering indeed. ughhh. #asahi-gpu · 2024-08-08 14:48
alyssaoh, jeez, ugh!#asahi-gpu · 2024-08-08 14:45
alyssabut AGX gives 32A60001#asahi-gpu · 2024-08-08 14:45
alyssashould be 32A60000#asahi-gpu · 2024-08-08 14:44
alyssafrcp(0x4C4565C8)#asahi-gpu · 2024-08-08 14:44
alyssayeah..#asahi-gpu · 2024-08-08 14:42
alyssahm no that should be ok#asahi-gpu · 2024-08-08 14:41
alyssaer wait#asahi-gpu · 2024-08-08 14:40
alyssayes#asahi-gpu · 2024-08-08 14:40
karolherbstand we can safely assume they emit it directly without any funky lowering?#asahi-gpu · 2024-08-08 14:40
alyssaalthough Metal's docs claim that 1.0 / x is correctly rounded#asahi-gpu · 2024-08-08 14:40
karolherbstor just the hw not being precise enough#asahi-gpu · 2024-08-08 14:39
alyssaI mean I'm just plumbing through the hardware frcp here#asahi-gpu · 2024-08-08 14:39
alyssaplausible#asahi-gpu · 2024-08-08 14:37
karolherbstmaybe something with rounding?#asahi-gpu · 2024-08-08 14:37
alyssaIDK if this is an AGX backend bug or a nir_lower_idiv bug, strictly#asahi-gpu · 2024-08-08 14:37
karolherbstfunky