[Mlir-commits] [mlir] [mlir][spirv] Add definition for GL Pack/UnpackHalf2x16 (PR #143889)

Jakub Kuderski llvmlistbot at llvm.org
Thu Jun 12 07:41:50 PDT 2025


================
@@ -1317,4 +1317,88 @@ def SPIRV_GLFractOp : SPIRV_GLUnaryArithmeticOp<"Fract", 10, SPIRV_Float> {
   }];
 }
 
+// -----
+
+def SPIRV_GLPackHalf2x16Op : SPIRV_GLOp<"PackHalf2x16", 58, [Pure]> {
+  let summary = "Pack two-component vector of 32-bit floats into a 32-bit integer";
+
+  let description = [{
+    Result is the unsigned integer obtained by converting the components of a
+    two-component floating-point vector to the 16-bit OpTypeFloat, and then packing
+    these two 16-bit integers into a 32-bit unsigned integer. The first vector
----------------
kuhar wrote:

sidenote: This seems like a very clumsy way to define an op -- they don't say how the initial f32 -> f16 conversion is done. I assume it's the same as `OpFConvert`, but the language does not really specify.

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


More information about the Mlir-commits mailing list