[llvm] [ADT] Add signed and unsigned mulHi and mulLo to APInt (PR #84719)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 02:35:34 PDT 2024


================
@@ -3094,3 +3094,19 @@ void llvm::LoadIntFromMemory(APInt &IntVal, const uint8_t *Src,
     memcpy(Dst + sizeof(uint64_t) - LoadBytes, Src, LoadBytes);
   }
 }
+
+APInt APIntOps::mulhs(const APInt &C1, const APInt &C2) {
+  assert(C1.getBitWidth() >= C2.getBitWidth());
----------------
RKSimon wrote:

The DivisionByConstantTest code allows different bitwidths - which isn't great - we should probably drop the DivisionByConstantTest diff and assert for `==` - we could then fix DivisionByConstantTest in a future patch?

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


More information about the llvm-commits mailing list