[Mlir-commits] [mlir] [mlir][SPIR-V] Add GL atan2 op (PR #201927)
Igor Wodiany
llvmlistbot at llvm.org
Mon Jun 8 01:53:51 PDT 2026
================
@@ -862,6 +862,31 @@ def SPIRV_GLAtanhOp : SPIRV_GLUnaryArithmeticOp<"Atanh", 24, SPIRV_Float16or32>
// -----
+def SPIRV_GLAtan2Op : SPIRV_GLBinaryArithmeticOp<"Atan2", 25, SPIRV_Float16or32> {
----------------
IgWod wrote:
I'm not sure we should use `SPIRV_GLBinaryArithmeticOp` in here as it makes the operation `Pure`, however I don't think it is, since `atan2` is undefined for x and y equal to 0. Having said that it looks like there are other operations (`acos`, `asin`) that are also made `Pure`, but probably shouldn't.
I think the cleanest solution would be to remove `Pure` from `SPIRV_GLBinaryOp` and add it manually where it applies. Alternatively we could have a separate class for non-pure ops. Either way that's a separate patch. I'll try to sort it out in the next few days and then we can merge this patch.
https://github.com/llvm/llvm-project/pull/201927
More information about the Mlir-commits
mailing list