[llvm] [llvm] Add KnownBits implementations for avgFloor and avgCeil (PR #86445)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 12 15:00:30 PDT 2024


================
@@ -559,6 +559,18 @@ TEST(KnownBitsTest, BinaryExhaustive) {
       KnownBits::mulhu,
       [](const APInt &N1, const APInt &N2) { return APIntOps::mulhu(N1, N2); },
       checkCorrectnessOnlyBinary);
+
+  testBinaryOpExhaustive(KnownBits::avgFloorS, APIntOps::avgFloorS,
+                         checkCorrectnessOnlyBinary);
+
+  testBinaryOpExhaustive(KnownBits::avgFloorU, APIntOps::avgFloorU,
+                         checkCorrectnessOnlyBinary);
+
+  testBinaryOpExhaustive(KnownBits::avgCeilU, APIntOps::avgCeilU,
+                         checkCorrectnessOnlyBinary);
+
+  testBinaryOpExhaustive(KnownBits::avgCeilS, APIntOps::avgCeilS,
+                         checkCorrectnessOnlyBinary);
----------------
goldsteinn wrote:

Which cases are not optimal?

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


More information about the llvm-commits mailing list