diff options
Diffstat (limited to 'src/base/abci')
-rw-r--r-- | src/base/abci/abcNpnSave.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/base/abci/abcNpnSave.c b/src/base/abci/abcNpnSave.c index 55603c6b..80ce10bc 100644 --- a/src/base/abci/abcNpnSave.c +++ b/src/base/abci/abcNpnSave.c @@ -50,14 +50,14 @@ static inline Npn_Obj_t * Npn_ManObj( Npn_Man_t * p, int i ) { a static inline int Npn_ManObjNum( Npn_Man_t * p, Npn_Obj_t * pObj ) { assert( p->pBuffer < pObj ); return pObj - p->pBuffer; } static word Truth[8] = { - 0xAAAAAAAAAAAAAAAA, - 0xCCCCCCCCCCCCCCCC, - 0xF0F0F0F0F0F0F0F0, - 0xFF00FF00FF00FF00, - 0xFFFF0000FFFF0000, - 0xFFFFFFFF00000000, - 0x0000000000000000, - 0xFFFFFFFFFFFFFFFF + ABC_CONST(0xAAAAAAAAAAAAAAAA), + ABC_CONST(0xCCCCCCCCCCCCCCCC), + ABC_CONST(0xF0F0F0F0F0F0F0F0), + ABC_CONST(0xFF00FF00FF00FF00), + ABC_CONST(0xFFFF0000FFFF0000), + ABC_CONST(0xFFFFFFFF00000000), + ABC_CONST(0x0000000000000000), + ABC_CONST(0xFFFFFFFFFFFFFFFF) }; static Npn_Man_t * pNpnMan = NULL; @@ -193,17 +193,17 @@ word Npn_TruthPadWord( word uTruth, int nVars ) if ( nVars == 6 ) return uTruth; if ( nVars <= 5 ) - uTruth = ((uTruth & 0x00000000FFFFFFFF) << 32) | (uTruth & 0x00000000FFFFFFFF); + uTruth = ((uTruth & ABC_CONST(0x00000000FFFFFFFF)) << 32) | (uTruth & ABC_CONST(0x00000000FFFFFFFF)); if ( nVars <= 4 ) - uTruth = ((uTruth & 0x0000FFFF0000FFFF) << 16) | (uTruth & 0x0000FFFF0000FFFF); + uTruth = ((uTruth & ABC_CONST(0x0000FFFF0000FFFF)) << 16) | (uTruth & ABC_CONST(0x0000FFFF0000FFFF)); if ( nVars <= 3 ) - uTruth = ((uTruth & 0x00FF00FF00FF00FF) << 8) | (uTruth & 0x00FF00FF00FF00FF); + uTruth = ((uTruth & ABC_CONST(0x00FF00FF00FF00FF)) << 8) | (uTruth & ABC_CONST(0x00FF00FF00FF00FF)); if ( nVars <= 2 ) - uTruth = ((uTruth & 0x0F0F0F0F0F0F0F0F) << 4) | (uTruth & 0x0F0F0F0F0F0F0F0F); + uTruth = ((uTruth & ABC_CONST(0x0F0F0F0F0F0F0F0F)) << 4) | (uTruth & ABC_CONST(0x0F0F0F0F0F0F0F0F)); if ( nVars <= 1 ) - uTruth = ((uTruth & 0x3333333333333333) << 2) | (uTruth & 0x3333333333333333); + uTruth = ((uTruth & ABC_CONST(0x3333333333333333)) << 2) | (uTruth & ABC_CONST(0x3333333333333333)); if ( nVars == 0 ) - uTruth = ((uTruth & 0x5555555555555555) << 1) | (uTruth & 0x5555555555555555); + uTruth = ((uTruth & ABC_CONST(0x5555555555555555)) << 1) | (uTruth & ABC_CONST(0x5555555555555555)); return uTruth; } @@ -220,12 +220,12 @@ word Npn_TruthPadWord( word uTruth, int nVars ) ***********************************************************************/ static inline int Npn_TruthCountOnes( word t ) { - t = (t & 0x5555555555555555) + ((t>> 1) & 0x5555555555555555); - t = (t & 0x3333333333333333) + ((t>> 2) & 0x3333333333333333); - t = (t & 0x0F0F0F0F0F0F0F0F) + ((t>> 4) & 0x0F0F0F0F0F0F0F0F); - t = (t & 0x00FF00FF00FF00FF) + ((t>> 8) & 0x00FF00FF00FF00FF); - t = (t & 0x0000FFFF0000FFFF) + ((t>>16) & 0x0000FFFF0000FFFF); - return (t & 0x00000000FFFFFFFF) + (t>>32); + t = (t & ABC_CONST(0x5555555555555555)) + ((t>> 1) & ABC_CONST(0x5555555555555555)); + t = (t & ABC_CONST(0x3333333333333333)) + ((t>> 2) & ABC_CONST(0x3333333333333333)); + t = (t & ABC_CONST(0x0F0F0F0F0F0F0F0F)) + ((t>> 4) & ABC_CONST(0x0F0F0F0F0F0F0F0F)); + t = (t & ABC_CONST(0x00FF00FF00FF00FF)) + ((t>> 8) & ABC_CONST(0x00FF00FF00FF00FF)); + t = (t & ABC_CONST(0x0000FFFF0000FFFF)) + ((t>>16) & ABC_CONST(0x0000FFFF0000FFFF)); + return (t & ABC_CONST(0x00000000FFFFFFFF)) + (t>>32); } /**Function************************************************************* @@ -258,11 +258,11 @@ static inline word Npn_TruthChangePhase( word t, int v ) static inline word Npn_TruthSwapAdjacentVars( word t, int v ) { static word PMasks[5][3] = { - { 0x9999999999999999, 0x2222222222222222, 0x4444444444444444 }, - { 0xC3C3C3C3C3C3C3C3, 0x0C0C0C0C0C0C0C0C, 0x3030303030303030 }, - { 0xF00FF00FF00FF00F, 0x00F000F000F000F0, 0x0F000F000F000F00 }, - { 0xFF0000FFFF0000FF, 0x0000FF000000FF00, 0x00FF000000FF0000 }, - { 0xFFFF00000000FFFF, 0x00000000FFFF0000, 0x0000FFFF00000000 } + { ABC_CONST(0x9999999999999999), ABC_CONST(0x2222222222222222), ABC_CONST(0x4444444444444444) }, + { ABC_CONST(0xC3C3C3C3C3C3C3C3), ABC_CONST(0x0C0C0C0C0C0C0C0C), ABC_CONST(0x3030303030303030) }, + { ABC_CONST(0xF00FF00FF00FF00F), ABC_CONST(0x00F000F000F000F0), ABC_CONST(0x0F000F000F000F00) }, + { ABC_CONST(0xFF0000FFFF0000FF), ABC_CONST(0x0000FF000000FF00), ABC_CONST(0x00FF000000FF0000) }, + { ABC_CONST(0xFFFF00000000FFFF), ABC_CONST(0x00000000FFFF0000), ABC_CONST(0x0000FFFF00000000) } }; assert( v < 6 ); return (t & PMasks[v][0]) | ((t & PMasks[v][1]) << (1 << v)) | ((t & PMasks[v][2]) >> (1 << v)); |