From 2cdca48ad034a018b75b0b3462bcd40a9935700c Mon Sep 17 00:00:00 2001 From: trevor_hansen Date: Sat, 7 May 2011 12:02:20 +0000 Subject: [PATCH] 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 --- src/simplifier/consteval.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- 2.47.3