From: trevor_hansen Date: Sat, 7 May 2011 12:02:20 +0000 (+0000) Subject: Signed division now returns what is should. Signed division is defined by unsigned... X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=2cdca48ad034a018b75b0b3462bcd40a9935700c;p=francis%2Fstp.git Signed division now returns what is should. Signed division is defined by unsigned division. Unsigned division returns 1, if the flag is set, now signed division returns 1 or -1 as appropriate. git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@1313 e59a4935-1847-0410-ae03-e826735625c1 --- diff --git a/src/simplifier/consteval.cpp b/src/simplifier/consteval.cpp index 1bdafbb..e9acd55 100644 --- a/src/simplifier/consteval.cpp +++ b/src/simplifier/consteval.cpp @@ -307,7 +307,12 @@ namespace BEEV if (k==SBVREM) OutputNode = children[0]; else - OutputNode = _bm->CreateOneConst(outputwidth); + { + if (CONSTANTBV::BitVector_bit_test(tmp0, inputwidth-1)) + OutputNode = _bm->CreateMaxConst(inputwidth); + else + OutputNode = _bm->CreateOneConst(inputwidth); + } CONSTANTBV::BitVector_Destroy(remainder); CONSTANTBV::BitVector_Destroy(quotient);