[clang] [llvm] [DirectX] Add isinf f16 emulation for SM6.8 and lower (PR #156932)

Farzon Lotfi via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 5 09:11:59 PDT 2025


================
@@ -51,6 +51,43 @@ static bool resourceAccessNeeds64BitExpansion(Module *M, Type *OverloadTy,
   return ScalarTy->isDoubleTy() || ScalarTy->isIntegerTy(64);
 }
 
+static Value *expand16BitIsInf(CallInst *Orig) {
+  Module *M = Orig->getModule();
+  if (M->getTargetTriple().getDXILVersion() >= VersionTuple(1, 9))
+    return nullptr;
+
+  Value *Val = Orig->getOperand(0);
+  Type *ValTy = Val->getType();
+  if (!(ValTy->isHalfTy() ||
----------------
farzonl wrote:

yeah maybe that would be better `getScalarType` I think also works on matricies.

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


More information about the llvm-commits mailing list