Commit graph

19 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
38c4fc8812 [buddy] fix bdd_noderesize
* src/kernel.c: Fix error introduced by 5a862295.
Report from Tomáš Babiak.
2016-11-19 16:46:10 +01:00
Alexandre Duret-Lutz
5a862295d3 [buddy] improve initialization of bddnode
* src/kernel.c, src/kernel.h: Here.
2016-11-08 19:03:08 +01:00
Alexandre Duret-Lutz
63818a3e69 [buddy] Fix several PVS-Studio warnings
For #192.

* src/bddio.c, src/cppext.cxx, src/kernel.c: Fix printf formats, calls
to new, and simplify one check in bdd_delref_nc().
2016-10-28 17:12:21 +02:00
Alexandre Duret-Lutz
4c1147e497 [buddy] speedup bdd_init and bdd_noderesize
* src/kernel.c: The initialization code of the BDD cache was
awfully slow due to multiple references to global variables.
2016-10-19 10:51:38 +02:00
Alexandre Duret-Lutz
1ffdd57383 [buddy] backport some fixes from upstream
* src/fdd.c, src/imatrix.c, src/kernel.c, src/reorder.c: Here.
2015-03-11 23:45:00 +01:00
Alexandre Duret-Lutz
e7a46e10e2 [buddy] Reduce the size of bddNode to improve cache efficiency.
The unicity table was mixed with the bddNode table for now
apparent reason.  After the hash of some node is computed,
bddnodes[hash] did only contain some random node (not the one
looked for) whose .hash member would point to the actual node with
this hash.  So that's a two step lookup.  With this patch, we sill
have a two step lookup, but the .hash member have been moved to a
separate array.  A consequence is that bddNode is now 16-byte long
(instead of 20) so it will never span across two cache lines.

* src/kernel.h (bddNode): Remove the hash member, and move it...
(bddhash): ... as this new separate table.
* src/kernel.c, src/reorder.c: Adjust all code.
2012-06-19 21:52:03 +02:00
Alexandre Duret-Lutz
1d1872ab90 [buddy] Inline the "is bdd constant" check performed in copies/constructors.
This avoids a library call to bdd_addref or bdd_delref.

* src/kernel.c (bdd_delref_nc, bdd_addref_nc): New function,
that work only on BDD that are not constant.
* src/cpext.cxx (bdd::operator=): Move...
* src/bdd.hh (bdd::operator=): ... here.
(bdd::bdd, bdd::~bdd, bdd::operator=): Inline the "is bdd constant"
check and call bdd_delref_nc/bdd_addref_nc only otherwise.
2011-04-30 13:37:53 +02:00
Alexandre Duret-Lutz
2b58fb90c4 [buddy] Hint gcc about likely/unlikely branches.
* src/bdd.h (__likely, __unlikely): Introduce these two macros.
* src/bddop.c, src/kerner.c: Use them in many situations.
2011-04-30 13:30:13 +02:00
Alexandre Duret-Lutz
e5f35dea48 [buddy]
Fix some warnings reported by gcc.

* buddy/src/kernel.c (errorstrings): Mark these as const.
* buddy/src/reorder.c (reorder_gbc): Fix prototype.
(siftTestCmp): Add missing const in cast.
(bdd_reorder_auto): Actually call bdd_reorder_ready().
2011-04-10 22:12:25 +02:00
Alexandre Duret-Lutz
61d9e721a0 [buddy]
Remove more sanity checks when NDEBUG is set.

* src/kernel.h (CHECKnc): New macro.
* src/kernel.c (bdd_var, bdd_low, bdd_high, bdd_ithvar,
bdd_nithvar): Use it.
2011-04-04 19:10:06 +02:00
Alexandre Duret-Lutz
197019ea62 [buddy]
* buddy/src/kernel.c (bdd_addref, bdd_delref): Disable sanity
checks when compiled with NDEBUG.
2011-04-03 10:49:35 +02:00
Alexandre Duret-Lutz
0fe5403956 Revert inlining of bdd_addref() and bdd_delref().
This reverts commit d462f50b59.

Conflicts:

	buddy/ChangeLog
2010-01-22 15:55:08 +01:00
Alexandre Duret-Lutz
d462f50b59 [buddy]
Inline bdd_addref() and bdd_delref() to speedup BDD operations.

* src/kernel.c, src/kernel.h (bdd_addref, bdd_delref): Move these
functions and there associated global variables...
* src/bdd.c (bdd_error): ... and this function ...
* src/bdd.h (bdd_addref, bdd_delref, bdd_error): ...here so that
they can be inlined.
2009-12-09 14:05:54 +01:00
Alexandre Duret-Lutz
894c864fd5 * src/kernel.c (bdd_default_gbchandler): Log garbage collection to
stderr, not stdout.  Reported by Kristin Yvonne Rozier
<kyrozier@cs.rice.edu>.
2008-02-25 14:37:54 +01:00
Alexandre Duret-Lutz
10f634d91d * src/pairs.c (bdd_mergepairs): New function.
(bdd_copypair): Revert 2003-05-20's change.  Use bdd_addref
to copy result variables.
2003-05-22 15:07:26 +00:00
Alexandre Duret-Lutz
42782f3a83 * src/pairs.c (bdd_setbddpair): Fix prototype in documentation. 2003-05-20 08:22:35 +00:00
Alexandre Duret-Lutz
a49c69555e * src/kernel.c (bdd_default_errhandler): Call abort(), not exit(1). 2003-05-12 09:30:18 +00:00
Alexandre Duret-Lutz
605dce2aac * configure.ac, Makefile.am, src/Makefile.am, doc/Makefile.am,
examples/Makefile.am, examples/Makefile.def,
examples/adder/Makefile.am, examples/calculator/Makefile.am,
examples/cmilner/Makefile.am, examples/fdd/Makefile.am,
examples/internal/Makefile.am, examples/milner/Makefile.am,
examples/money/Makefile.am, examples/queen/Makefile.am,
examples/solitar/Makefile.am, m4/debug.m4, m4/gccwarns.m4,
ChangeLog, INSTALL: New files.
* config, makefile, src/makefile, doc/makefile,
examples/adder/makefile, examples/calculator/makefile
examples/cmilner/makefile, examples/fdd/makefile,
examples/internal/makefile, examples/milner/makefile,
examples/money/makefile, examples/queen/makefile,
examples/solitare/makefile : Delete.
* examples/adder/adder.cxx, examples/fdd/statespace.cxx,
examples/internal/bddtest.cxx, examples/milner/milner.cxx,
examples/money/money.cxx, examples/queen/queen.cxx,
examples/solitare/solitare.cxx: Include iostream.
* examples/calculator/parser.y: Rename as ...
* examples/calculator/parser.yxx: ... this.  Remove spurious
comas in %token, %right, and %left arguments.
* examples/calculator/parser.h: Rename as ...
* examples/calculator/parser_.h: ... this, because the bison
rule with output parser.h (not tokens.h) from parser.y.
* examples/calculator/lexer.l: Rename as ...
* examples/calculator/lexer.lxx: ... this.  Include parser.h
instead of tokens.h.
* examples/calculator/slist.h
(voidSList::voisSListElem, SList::ite): Fix friend usage.
* src/kernel.h (DEFAULT_CLOCK): Default to 60 if not already
defined.
* README: Update build instruction, and file listing.
2003-05-05 13:44:49 +00:00
Alexandre Duret-Lutz
cf5dd46350 Initial revision 2003-05-05 10:57:53 +00:00