[llvm] add power function to APFloat and APInt (PR #122788)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 13 21:19:56 PST 2025


================
@@ -3108,3 +3108,22 @@ APInt APIntOps::mulhu(const APInt &C1, const APInt &C2) {
   APInt C2Ext = C2.zext(FullWidth);
   return (C1Ext * C2Ext).extractBits(C1.getBitWidth(), C1.getBitWidth());
 }
+
+APInt APIntOps::pow(const APInt &X, int64_t N) {
----------------
arsenm wrote:

The int and float cases have little do do with each other. Can you add unit tests and separate PR for each? 

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


More information about the llvm-commits mailing list