Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
7a6cf9f4
Commit
7a6cf9f4
authored
Sep 06, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrated new fast semi-canonical form for Boolean functions up to 16 inputs.
parent
9c8be56c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
21 deletions
+23
-21
src/bool/lucky/luckyFast16.c
+15
-6
src/bool/lucky/luckyInt.h
+8
-15
No files found.
src/bool/lucky/luckyFast16.c
View file @
7a6cf9f4
...
...
@@ -19,6 +19,15 @@
ABC_NAMESPACE_IMPL_START
static
word
SFmask
[
5
][
4
]
=
{
{
0x8888888888888888
,
0x4444444444444444
,
0x2222222222222222
,
0x1111111111111111
},
{
0xC0C0C0C0C0C0C0C0
,
0x3030303030303030
,
0x0C0C0C0C0C0C0C0C
,
0x0303030303030303
},
{
0xF000F000F000F000
,
0x0F000F000F000F00
,
0x00F000F000F000F0
,
0x000F000F000F000F
},
{
0xFF000000FF000000
,
0x00FF000000FF0000
,
0x0000FF000000FF00
,
0x000000FF000000FF
},
{
0xFFFF000000000000
,
0x0000FFFF00000000
,
0x00000000FFFF0000
,
0x000000000000FFFF
}
};
////////////////////////////////////lessThen5/////////////////////////////////////////////////////////////////////////////////////////////
// there are 4 parts in every block to compare and rearrange - quoters(0Q,1Q,2Q,3Q)
...
...
@@ -177,9 +186,9 @@ inline void minimalSwapAndFlipIVar_superFast_lessThen5(word* pInOut, int iVar, i
if
(
DifStartMin
>=
DifStart1
&&
DifStartMin
>=
DifStart0
)
arrangeQuoters_superFast_lessThen5
(
pInOut
,
DifStartMin
/
100
,
M
[
min1
],
M
[(
min1
+
1
)
%
2
],
3
-
M
[(
min1
+
1
)
%
2
],
3
-
M
[
min1
],
iVar
,
nWords
,
pCanonPerm
,
pCanonPhase
);
else
if
(
DifStart0
>
DifStart1
)
arrangeQuoters_superFast_lessThen5
(
pInOut
,
m
ax
(
DifStartMin
/
100
,
DifStart0
/
100
),
M
[
0
],
M
[
1
],
3
-
M
[
1
],
3
-
M
[
0
],
iVar
,
nWords
,
pCanonPerm
,
pCanonPhase
);
arrangeQuoters_superFast_lessThen5
(
pInOut
,
luckyM
ax
(
DifStartMin
/
100
,
DifStart0
/
100
),
M
[
0
],
M
[
1
],
3
-
M
[
1
],
3
-
M
[
0
],
iVar
,
nWords
,
pCanonPerm
,
pCanonPhase
);
else
arrangeQuoters_superFast_lessThen5
(
pInOut
,
m
ax
(
DifStartMin
/
100
,
DifStart1
/
100
),
M
[
1
],
M
[
0
],
3
-
M
[
0
],
3
-
M
[
1
],
iVar
,
nWords
,
pCanonPerm
,
pCanonPhase
);
arrangeQuoters_superFast_lessThen5
(
pInOut
,
luckyM
ax
(
DifStartMin
/
100
,
DifStart1
/
100
),
M
[
1
],
M
[
0
],
3
-
M
[
0
],
3
-
M
[
1
],
iVar
,
nWords
,
pCanonPerm
,
pCanonPhase
);
}
else
{
...
...
@@ -337,9 +346,9 @@ inline void minimalSwapAndFlipIVar_superFast_iVar5(unsigned* pInOut, int nWords,
if
(
DifStartMin
>=
DifStart1
&&
DifStartMin
>=
DifStart0
)
arrangeQuoters_superFast_iVar5
(
pInOut
,
temp
,
DifStartMin
,
M
[
min1
],
M
[(
min1
+
1
)
%
2
],
3
-
M
[(
min1
+
1
)
%
2
],
3
-
M
[
min1
],
pCanonPerm
,
pCanonPhase
);
else
if
(
DifStart0
>
DifStart1
)
arrangeQuoters_superFast_iVar5
(
pInOut
,
temp
,
m
ax
(
DifStartMin
,
DifStart0
),
M
[
0
],
M
[
1
],
3
-
M
[
1
],
3
-
M
[
0
],
pCanonPerm
,
pCanonPhase
);
arrangeQuoters_superFast_iVar5
(
pInOut
,
temp
,
luckyM
ax
(
DifStartMin
,
DifStart0
),
M
[
0
],
M
[
1
],
3
-
M
[
1
],
3
-
M
[
0
],
pCanonPerm
,
pCanonPhase
);
else
arrangeQuoters_superFast_iVar5
(
pInOut
,
temp
,
m
ax
(
DifStartMin
,
DifStart1
),
M
[
1
],
M
[
0
],
3
-
M
[
0
],
3
-
M
[
1
],
pCanonPerm
,
pCanonPhase
);
arrangeQuoters_superFast_iVar5
(
pInOut
,
temp
,
luckyM
ax
(
DifStartMin
,
DifStart1
),
M
[
1
],
M
[
0
],
3
-
M
[
0
],
3
-
M
[
1
],
pCanonPerm
,
pCanonPhase
);
}
else
{
...
...
@@ -514,9 +523,9 @@ inline void minimalSwapAndFlipIVar_superFast_moreThen5(word* pInOut, int iVar, i
if
(
DifStartMin
>=
DifStart1
&&
DifStartMin
>=
DifStart0
)
arrangeQuoters_superFast_moreThen5
(
pInOut
,
temp
,
DifStartMin
,
M
[
min1
],
M
[(
min1
+
1
)
%
2
],
3
-
M
[(
min1
+
1
)
%
2
],
3
-
M
[
min1
],
iVar
,
pCanonPerm
,
pCanonPhase
);
else
if
(
DifStart0
>
DifStart1
)
arrangeQuoters_superFast_moreThen5
(
pInOut
,
temp
,
m
ax
(
DifStartMin
,
DifStart0
),
M
[
0
],
M
[
1
],
3
-
M
[
1
],
3
-
M
[
0
],
iVar
,
pCanonPerm
,
pCanonPhase
);
arrangeQuoters_superFast_moreThen5
(
pInOut
,
temp
,
luckyM
ax
(
DifStartMin
,
DifStart0
),
M
[
0
],
M
[
1
],
3
-
M
[
1
],
3
-
M
[
0
],
iVar
,
pCanonPerm
,
pCanonPhase
);
else
arrangeQuoters_superFast_moreThen5
(
pInOut
,
temp
,
m
ax
(
DifStartMin
,
DifStart1
),
M
[
1
],
M
[
0
],
3
-
M
[
0
],
3
-
M
[
1
],
iVar
,
pCanonPerm
,
pCanonPhase
);
arrangeQuoters_superFast_moreThen5
(
pInOut
,
temp
,
luckyM
ax
(
DifStartMin
,
DifStart1
),
M
[
1
],
M
[
0
],
3
-
M
[
0
],
3
-
M
[
1
],
iVar
,
pCanonPerm
,
pCanonPhase
);
}
else
{
...
...
src/bool/lucky/luckyInt.h
View file @
7a6cf9f4
...
...
@@ -82,7 +82,6 @@ typedef struct
}
permInfo
;
static
inline
void
TimePrint
(
char
*
Message
)
{
static
int
timeBegin
;
...
...
@@ -92,25 +91,19 @@ static inline void TimePrint( char* Message )
timeBegin
=
clock
();
}
static
word
SFmask
[
5
][
4
]
=
{
{
0x8888888888888888
,
0x4444444444444444
,
0x2222222222222222
,
0x1111111111111111
},
{
0xC0C0C0C0C0C0C0C0
,
0x3030303030303030
,
0x0C0C0C0C0C0C0C0C
,
0x0303030303030303
},
{
0xF000F000F000F000
,
0x0F000F000F000F00
,
0x00F000F000F000F0
,
0x000F000F000F000F
},
{
0xFF000000FF000000
,
0x00FF000000FF0000
,
0x0000FF000000FF00
,
0x000000FF000000FF
},
{
0xFFFF000000000000
,
0x0000FFFF00000000
,
0x00000000FFFF0000
,
0x000000000000FFFF
}
};
static
inline
int
CompareWords
(
word
x
,
word
y
)
static
inline
int
CompareWords
(
word
x
,
word
y
)
{
if
(
x
>
y
)
if
(
x
>
y
)
return
1
;
else
if
(
x
<
y
)
if
(
x
<
y
)
return
-
1
;
else
return
0
;
return
0
;
}
static
inline
int
luckyMin
(
int
x
,
int
y
)
{
return
(
x
<
y
)
?
x
:
y
;
}
static
inline
int
luckyMax
(
int
x
,
int
y
)
{
return
(
x
<
y
)
?
y
:
x
;
}
extern
inline
int
memCompare
(
word
*
x
,
word
*
y
,
int
nVars
);
extern
inline
int
Kit_TruthWordNum_64bit
(
int
nVars
);
extern
Abc_TtStore_t
*
setTtStore
(
char
*
pFileInput
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment