[llvm] [ADT] Add implementations for mulhs and mulhu to APInt (PR #84609)
Jakub Kuderski via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 9 12:26:56 PST 2024
================
@@ -537,19 +537,13 @@ TEST(KnownBitsTest, BinaryExhaustive) {
[](const KnownBits &Known1, const KnownBits &Known2) {
return KnownBits::mulhs(Known1, Known2);
},
- [](const APInt &N1, const APInt &N2) {
- unsigned Bits = N1.getBitWidth();
- return (N1.sext(2 * Bits) * N2.sext(2 * Bits)).extractBits(Bits, Bits);
- },
+ [](const APInt &N1, const APInt &N2) { return APIntOps::mulhs(N1, N2); },
----------------
kuhar wrote:
Could these be:
```suggestion
&APIntOps::mulhs,
```
?
https://github.com/llvm/llvm-project/pull/84609
More information about the llvm-commits
mailing list