aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/KnownBitsTest.cpp
diff options
context:
space:
mode:
authorAtousa Duprat <atousa.p@gmail.com>2024-04-02 09:07:56 -0700
committerGitHub <noreply@github.com>2024-04-02 17:07:56 +0100
commit4aba595f092e8e05e92656b23944ce6619465a78 (patch)
tree43a6bd03da4dc3fdd66519e47f579b16e8f67128 /llvm/unittests/Support/KnownBitsTest.cpp
parente12a1f8b325a72191c261b4f11726a9c58f84817 (diff)
downloadllvm-4aba595f092e8e05e92656b23944ce6619465a78.zip
llvm-4aba595f092e8e05e92656b23944ce6619465a78.tar.gz
llvm-4aba595f092e8e05e92656b23944ce6619465a78.tar.bz2
[ADT] Add signed and unsigned mulh to APInt (#84719)
Fixes #84207
Diffstat (limited to 'llvm/unittests/Support/KnownBitsTest.cpp')
-rw-r--r--llvm/unittests/Support/KnownBitsTest.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/unittests/Support/KnownBitsTest.cpp b/llvm/unittests/Support/KnownBitsTest.cpp
index 48de088..027d637 100644
--- a/llvm/unittests/Support/KnownBitsTest.cpp
+++ b/llvm/unittests/Support/KnownBitsTest.cpp
@@ -553,17 +553,11 @@ TEST(KnownBitsTest, BinaryExhaustive) {
checkCorrectnessOnlyBinary);
testBinaryOpExhaustive(
KnownBits::mulhs,
- [](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); },
checkCorrectnessOnlyBinary);
testBinaryOpExhaustive(
KnownBits::mulhu,
- [](const APInt &N1, const APInt &N2) {
- unsigned Bits = N1.getBitWidth();
- return (N1.zext(2 * Bits) * N2.zext(2 * Bits)).extractBits(Bits, Bits);
- },
+ [](const APInt &N1, const APInt &N2) { return APIntOps::mulhu(N1, N2); },
checkCorrectnessOnlyBinary);
}