33static int Tt_BitCount8[256] = {
34 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
35 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
36 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
37 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
38 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
39 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
40 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
41 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8};
43static inline int Tt_BitCount16(
int i) {
44 return Tt_BitCount8[i & 0xFF] + Tt_BitCount8[i >> 8];
47static word ss_Truths6[6] = {
55static inline int Tt_HexDigitNum(
int n) {
56 return n <= 2 ? 1 : 1 << (n - 2);
60 int k, Digit, nDigits =
nWords * 16;
61 for (k = nDigits - 1; k >= 0; k--) {
62 Digit = (int)((
p[k / 16] >> ((k % 16) * 4)) & 15);
66 printf(
"%c",
'A' + Digit - 10);
71static inline int Tt_CountOnes(
word x) {
72 x = x - ((x >> 1) &
ABC_CONST(0x5555555555555555));
74 x = (x + (x >> 4)) &
ABC_CONST(0x0F0F0F0F0F0F0F0F);
78 return (
int)(x & 0xFF);
81static inline int Tt_CountOnes2(
word x) {
82 return x ? Tt_CountOnes(x) : 0;
85static inline int Tt_CountOnesVec(
word *x,
int nWords) {
87 for (w = 0; w <
nWords; w++)
88 Count += Tt_CountOnes2(x[w]);
92static inline int Tt_CountOnesVecMask(
word *x,
word *pMask,
int nWords) {
94 for (w = 0; w <
nWords; w++)
95 Count += Tt_CountOnes2(pMask[w] & x[w]);
99static inline void Tt_Clear(
word *pOut,
int nWords) {
101 for (w = 0; w <
nWords; w++)
105static inline void Tt_Fill(
word *pOut,
int nWords) {
107 for (w = 0; w <
nWords; w++)
113 for (w = 0; w <
nWords; w++)
117static inline void Tt_DupC(
word *pOut,
word *pIn,
int fC,
int nWords) {
120 for (w = 0; w <
nWords; w++)
123 for (w = 0; w <
nWords; w++)
129 for (w = 0; w <
nWords; w++)
135 for (w = 0; w <
nWords; w++)
136 pOut[w] = pIn1[w] & pIn2[w];
139static inline void Tt_Sharp(
word *pOut,
word *pIn,
int fC,
int nWords) {
142 for (w = 0; w <
nWords; w++)
145 for (w = 0; w <
nWords; w++)
151 for (w = 0; w <
nWords; w++)
152 pOut[w] |= pIn1[w] ^ pIn2[w];
157 for (w = 0; w <
nWords; w++)
158 pOut[w] |= (pIn1[w] ^ pIn2[w]) & pIn3[w];
161static inline int Tt_WordNum(
int n) {
162 return n > 6 ? (1 << (n - 6)) : 1;
165static inline void Tt_ElemInit(
word *pTruth,
int iVar,
int nWords) {
168 for (k = 0; k <
nWords; k++)
169 pTruth[k] = ss_Truths6[iVar];
171 for (k = 0; k <
nWords; k++)
172 pTruth[k] = (k & (1 << (iVar - 6))) ? ~(
word)0 : 0;
175static inline int Tt_IntersectC(
word *pIn1,
word *pIn2,
int fC,
int nWords) {
178 for (w = 0; w <
nWords; w++)
179 if (pIn1[w] & ~pIn2[w])
182 for (w = 0; w <
nWords; w++)
183 if (pIn1[w] & pIn2[w])
191 for (w = 0; w <
nWords; w++)
192 if (pIn1[w] != pIn2[w])
199 for (w = 0; w <
nWords; w++)
200 if (pCare[w] & (pIn1[w] ^ pIn2[w]))
205static inline int Tt_IsConst0(
word *pIn,
int nWords) {
207 for (w = 0; w <
nWords; w++)
213static inline int Tt_IsConst1(
word *pIn,
int nWords) {
215 for (w = 0; w <
nWords; w++)
216 if (pIn[w] != ~(
word)0)
222static inline int Tt_GetBit(
word *
p,
int k) {
223 return (
int)(
p[k >> 6] >> (k & 63)) & 1;
226static inline void Tt_SetBit(
word *
p,
int k) {
227 p[k >> 6] |= (((
word)1) << (k & 63));
230static inline void Tt_XorBit(
word *
p,
int k) {
231 p[k >> 6] ^= (((
word)1) << (k & 63));
#define ABC_CONST(number)
PARAMETERS ///.
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
unsigned __int64 word
DECLARATIONS ///.