diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-02-10 17:18:52 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-02-10 17:18:52 -0800 |
commit | d8b4d8dfbb4abcf773a812d8daede4543d95f6b3 (patch) | |
tree | a883c8e3323d1be5f7d310e7b02428c1960bf6c5 /src/misc | |
parent | 3e212582853b0abc567682c4c8b9e4ae9ab91de9 (diff) | |
download | abc-d8b4d8dfbb4abcf773a812d8daede4543d95f6b3.tar.gz abc-d8b4d8dfbb4abcf773a812d8daede4543d95f6b3.tar.bz2 abc-d8b4d8dfbb4abcf773a812d8daede4543d95f6b3.zip |
Fix in represneting constants in a platform-independent way.
Diffstat (limited to 'src/misc')
-rw-r--r-- | src/misc/util/utilTruth.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/misc/util/utilTruth.h b/src/misc/util/utilTruth.h index 28646fc4..c6937b40 100644 --- a/src/misc/util/utilTruth.h +++ b/src/misc/util/utilTruth.h @@ -1261,24 +1261,24 @@ static inline int Abc_Tt6FirstBit( word t ) { int n = 0; if ( t == 0 ) return -1; - if ( (t & 0x00000000FFFFFFFF) == 0 ) { n += 32; t >>= 32; } - if ( (t & 0x000000000000FFFF) == 0 ) { n += 16; t >>= 16; } - if ( (t & 0x00000000000000FF) == 0 ) { n += 8; t >>= 8; } - if ( (t & 0x000000000000000F) == 0 ) { n += 4; t >>= 4; } - if ( (t & 0x0000000000000003) == 0 ) { n += 2; t >>= 2; } - if ( (t & 0x0000000000000001) == 0 ) { n++; } + if ( (t & ABC_CONST(0x00000000FFFFFFFF)) == 0 ) { n += 32; t >>= 32; } + if ( (t & ABC_CONST(0x000000000000FFFF)) == 0 ) { n += 16; t >>= 16; } + if ( (t & ABC_CONST(0x00000000000000FF)) == 0 ) { n += 8; t >>= 8; } + if ( (t & ABC_CONST(0x000000000000000F)) == 0 ) { n += 4; t >>= 4; } + if ( (t & ABC_CONST(0x0000000000000003)) == 0 ) { n += 2; t >>= 2; } + if ( (t & ABC_CONST(0x0000000000000001)) == 0 ) { n++; } return n; } static inline int Abc_Tt6LastBit( word t ) { int n = 0; if ( t == 0 ) return -1; - if ( (t & 0xFFFFFFFF00000000) == 0 ) { n += 32; t <<= 32; } - if ( (t & 0xFFFF000000000000) == 0 ) { n += 16; t <<= 16; } - if ( (t & 0xFF00000000000000) == 0 ) { n += 8; t <<= 8; } - if ( (t & 0xF000000000000000) == 0 ) { n += 4; t <<= 4; } - if ( (t & 0xC000000000000000) == 0 ) { n += 2; t <<= 2; } - if ( (t & 0x8000000000000000) == 0 ) { n++; } + if ( (t & ABC_CONST(0xFFFFFFFF00000000)) == 0 ) { n += 32; t <<= 32; } + if ( (t & ABC_CONST(0xFFFF000000000000)) == 0 ) { n += 16; t <<= 16; } + if ( (t & ABC_CONST(0xFF00000000000000)) == 0 ) { n += 8; t <<= 8; } + if ( (t & ABC_CONST(0xF000000000000000)) == 0 ) { n += 4; t <<= 4; } + if ( (t & ABC_CONST(0xC000000000000000)) == 0 ) { n += 2; t <<= 2; } + if ( (t & ABC_CONST(0x8000000000000000)) == 0 ) { n++; } return 63-n; } static inline int Abc_TtFindFirstBit( word * pIn, int nVars ) |