]> git.unchartedbackwaters.co.uk Git - francis/stp.git/commitdiff
Improvement. Patch ABC to replace the standard popcount with a partialy unrolled...
authortrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Thu, 26 Jan 2012 13:14:41 +0000 (13:14 +0000)
committertrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Thu, 26 Jan 2012 13:14:41 +0000 (13:14 +0000)
git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@1529 e59a4935-1847-0410-ae03-e826735625c1

src/extlib-abc/aig/dar/darCut.c

index 6b91ae1f50fa879695bda5741489987bc201c698..0c13b51283ee35787aa07fb948e4b2078253b324 100644 (file)
@@ -48,6 +48,20 @@ static inline int Dar_WordCountOnes( unsigned uWord )
     return  (uWord & 0x0000FFFF) + (uWord>>16);\r
 }\r
 \r
+// This doesn't count the 1-bits, just strips\r
+// off the trailing 1-bit four times. If it's not zero,\r
+// then there are >4 1-bits.\r
+static inline unsigned Dar_FiveOrMoreBits( unsigned uWord )\r
+{\r
+   uWord = (uWord-1)&uWord;\r
+   uWord = (uWord-1)&uWord;\r
+   uWord = (uWord-1)&uWord;\r
+   uWord = (uWord-1)&uWord;\r
+\r
+  return uWord; // non-zero if >=5 ones.\r
+}\r
+\r
+\r
 /**Function*************************************************************\r
 \r
   Synopsis    [Compute the cost of the cut.]\r
@@ -627,8 +641,13 @@ Dar_Cut_t * Dar_ObjComputeCuts( Dar_Man_t * p, Aig_Obj_t * pObj )
     {\r
         p->nCutsAll++;\r
         // make sure K-feasible cut exists\r
-        if ( Dar_WordCountOnes(pCut0->uSign | pCut1->uSign) > 4 )\r
-            continue;\r
+\r
+        //  if (Dar_WordCountOnes(pCut0->uSign | pCut1->uSign) > 4)\r
+          //  continue;\r
+\r
+        if (0 != Dar_FiveOrMoreBits(pCut0->uSign | pCut1->uSign))\r
+          continue;\r
+\r
         // get the next cut of this node\r
         pCut = Dar_CutFindFree( p, pObj );\r
         // create the new cut\r