diff options
author | Nhat Nguyen <nhat7203@gmail.com> | 2024-05-19 10:57:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-19 10:57:11 -0400 |
commit | eab92cb7f33be16a6a17549182e9237112b7a183 (patch) | |
tree | 33da508b5ec68d1c0b0f3e5010529b044fc1ec78 /llvm/unittests/Support/KnownBitsTest.cpp | |
parent | 9e4ef0dee18c0c99325e8d56f16c149020e89d37 (diff) | |
download | llvm-eab92cb7f33be16a6a17549182e9237112b7a183.zip llvm-eab92cb7f33be16a6a17549182e9237112b7a183.tar.gz llvm-eab92cb7f33be16a6a17549182e9237112b7a183.tar.bz2 |
[llvm] Add KnownBits implementations for avgFloor and avgCeil (#86445)
This PR is to address the issue #84640
Diffstat (limited to 'llvm/unittests/Support/KnownBitsTest.cpp')
-rw-r--r-- | llvm/unittests/Support/KnownBitsTest.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/unittests/Support/KnownBitsTest.cpp b/llvm/unittests/Support/KnownBitsTest.cpp index d740707..824cf75 100644 --- a/llvm/unittests/Support/KnownBitsTest.cpp +++ b/llvm/unittests/Support/KnownBitsTest.cpp @@ -501,6 +501,18 @@ TEST(KnownBitsTest, BinaryExhaustive) { "mulhu", KnownBits::mulhu, [](const APInt &N1, const APInt &N2) { return APIntOps::mulhu(N1, N2); }, /*CheckOptimality=*/false); + + testBinaryOpExhaustive("avgFloorS", KnownBits::avgFloorS, APIntOps::avgFloorS, + false); + + testBinaryOpExhaustive("avgFloorU", KnownBits::avgFloorU, APIntOps::avgFloorU, + false); + + testBinaryOpExhaustive("avgCeilU", KnownBits::avgCeilU, APIntOps::avgCeilU, + false); + + testBinaryOpExhaustive("avgCeilS", KnownBits::avgCeilS, APIntOps::avgCeilS, + false); } TEST(KnownBitsTest, UnaryExhaustive) { |