[Mlir-commits] [mlir] [mlir][spirv] Add definition for GL Fract (PR #132921)

Jakub Kuderski llvmlistbot at llvm.org
Tue Mar 25 07:17:50 PDT 2025


================
@@ -1161,4 +1161,29 @@ def SPIRV_GLFindUMsbOp : SPIRV_GLUnaryArithmeticOp<"FindUMsb", 75, SPIRV_Int32>
   }];
 }
 
+// ----
+
+def SPIRV_GLFractOp : SPIRV_GLUnaryArithmeticOp<"Fract", 10, SPIRV_Float> {
+  let summary = "Returns the x - floor(x) of the operand";
+
+  let description = [{
+    Result is x - floor x.
+
+    fract(±0) = +0.
+
+    fract(±Inf) = NaN.
----------------
kuhar wrote:

We could wrap this in a code block maybe to make the formatting nicer to read on the website -- it doesn't have to be 1:1 import from the spirv spec

https://github.com/llvm/llvm-project/pull/132921


More information about the Mlir-commits mailing list