[llvm] [NVPTX] designate fabs and fneg as free (PR #121513)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 17:18:00 PST 2025


================
@@ -261,6 +261,9 @@ class NVPTXTargetLowering : public TargetLowering {
     return true;
   }
 
+  bool isFAbsFree(EVT VT) const override { return true; }
+  bool isFNegFree(EVT VT) const override { return true; }
----------------
Artem-B wrote:

GPU instructions with predicate math, operand negation, and modulus are fun:
```
FSETP.NEU.AND P0, PT, |R3|, -R0, PT 
```

Too bad that we have no way to access those features in a deterministic way via PTX, and have to second-guess what would get ptxas to produce good SASS. :-(

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


More information about the llvm-commits mailing list