[llvm] [SPIR-V] Implement SPV_KHR_float_controls2 (PR #146941)

Marcos Maronas via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 8 04:14:50 PDT 2025


================
@@ -995,6 +1012,22 @@ unsigned getArrayComponentCount(const MachineRegisterInfo *MRI,
   return foldImm(ResType->getOperand(2), MRI);
 }
 
+size_t computeFPFastMathDefaultInfoVecIndex(size_t BitWidth) {
+  switch (BitWidth) {
+  case 16: // half
+    return 0;
+  case 32: // float
+    return 1;
+  case 64: // double
+    return 2;
+  default:
+    report_fatal_error("Expected BitWidth to be 16, 32, 64", false);
+  }
+  assert(false && "Unreachable code");
+  // This return is just to avoid compiler warnings.
+  return 0;
----------------
maarquitos14 wrote:

Done in https://github.com/llvm/llvm-project/pull/146941/commits/f2aefbf502e6a48a5f8b251bdfbeb7ed8d412041.

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


More information about the llvm-commits mailing list