]> git.unchartedbackwaters.co.uk Git - francis/stp.git/commitdiff
Improvement to cbipt. Run unsigned division propagagtor instead of the signed divisio...
authortrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Tue, 3 Apr 2012 15:08:25 +0000 (15:08 +0000)
committertrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Tue, 3 Apr 2012 15:08:25 +0000 (15:08 +0000)
git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@1621 e59a4935-1847-0410-ae03-e826735625c1

src/simplifier/constantBitP/ConstantBitP_Division.cpp

index 34da917bd8e3a86d81c5e5fa2ee9a5729bb4d8a0..bb485a809a67ae81a24f395a0df6f7070fccc68c 100644 (file)
@@ -1119,8 +1119,12 @@ Result bvSignedDivisionBothWays(vector<FixedBits*>& children,
         return NO_CHANGE;
     }
 
-
-       return bvSignedDivisionRemainderBothWays(children, output, bm,
+  // unsigned division propagates much better than signed division does!
+  const int top = children[0]->getWidth();
+  if ((*children[0])[top-1] == '0' && (*children[1])[top-1] == '0')
+    return bvUnsignedDivisionBothWays(children, output, bm);
+  else
+    return bvSignedDivisionRemainderBothWays(children, output, bm,
                        bvUnsignedDivisionBothWays, SIGNED_DIVISION);
 }
 }