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
8bc4894c
Commit
8bc4894c
authored
Aug 01, 2016
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compiler errors on Windows.
parent
f59788f6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
39 deletions
+50
-39
src/opt/fxch/Fxch.c
+13
-10
src/opt/fxch/Fxch.h
+3
-0
src/opt/fxch/FxchMan.c
+16
-13
src/opt/fxch/FxchSCHashTable.c
+18
-16
No files found.
src/opt/fxch/Fxch.c
View file @
8bc4894c
...
@@ -37,7 +37,8 @@ ABC_NAMESPACE_IMPL_START
...
@@ -37,7 +37,8 @@ ABC_NAMESPACE_IMPL_START
void
Fxch_CubesGruping
(
Fxch_Man_t
*
pFxchMan
)
void
Fxch_CubesGruping
(
Fxch_Man_t
*
pFxchMan
)
{
{
Vec_Int_t
*
vCube
;
Vec_Int_t
*
vCube
;
int
iCube
;
int
iCube
,
nOutputs
,
SizeOutputID
;
Hsh_VecMan_t
*
pCubeHash
;
/* Identify the number of Outputs and create the translation table */
/* Identify the number of Outputs and create the translation table */
pFxchMan
->
vTranslation
=
Vec_IntAlloc
(
32
);
pFxchMan
->
vTranslation
=
Vec_IntAlloc
(
32
);
...
@@ -49,30 +50,31 @@ void Fxch_CubesGruping(Fxch_Man_t* pFxchMan)
...
@@ -49,30 +50,31 @@ void Fxch_CubesGruping(Fxch_Man_t* pFxchMan)
if
(
iTranslation
==
-
1
)
if
(
iTranslation
==
-
1
)
Vec_IntPush
(
pFxchMan
->
vTranslation
,
Id
);
Vec_IntPush
(
pFxchMan
->
vTranslation
,
Id
);
}
}
int
nOutputs
=
Vec_IntSize
(
pFxchMan
->
vTranslation
);
nOutputs
=
Vec_IntSize
(
pFxchMan
->
vTranslation
);
/* Size of the OutputID in number o ints */
/* Size of the OutputID in number o ints */
int
SizeOutputID
=
(
nOutputs
>>
5
)
+
(
(
nOutputs
&
31
)
>
0
);
SizeOutputID
=
(
nOutputs
>>
5
)
+
(
(
nOutputs
&
31
)
>
0
);
/* Initialize needed structures */
/* Initialize needed structures */
pFxchMan
->
vOutputID
=
Vec_IntAlloc
(
4096
);
pFxchMan
->
vOutputID
=
Vec_IntAlloc
(
4096
);
pFxchMan
->
pTempOutputID
=
ABC_CALLOC
(
int
,
SizeOutputID
);
pFxchMan
->
pTempOutputID
=
ABC_CALLOC
(
int
,
SizeOutputID
);
pFxchMan
->
nSizeOutputID
=
SizeOutputID
;
pFxchMan
->
nSizeOutputID
=
SizeOutputID
;
Hsh_VecMan_t
*
pCubeHash
=
Hsh_VecManStart
(
1024
);
pCubeHash
=
Hsh_VecManStart
(
1024
);
/* Identify equal cubes */
/* Identify equal cubes */
Vec_WecForEachLevel
(
pFxchMan
->
vCubes
,
vCube
,
iCube
)
Vec_WecForEachLevel
(
pFxchMan
->
vCubes
,
vCube
,
iCube
)
{
{
int
Id
=
Vec_IntEntry
(
vCube
,
0
);
int
Id
=
Vec_IntEntry
(
vCube
,
0
);
int
iTranslation
=
Vec_IntFind
(
pFxchMan
->
vTranslation
,
Id
);
int
iTranslation
=
Vec_IntFind
(
pFxchMan
->
vTranslation
,
Id
);
int
i
,
iCubeNoID
,
Temp
,
*
pEntry
;
Vec_IntWriteEntry
(
vCube
,
0
,
0
);
// Clear ID, Outputs will be identified by it later
Vec_IntWriteEntry
(
vCube
,
0
,
0
);
// Clear ID, Outputs will be identified by it later
i
nt
i
CubeNoID
=
Hsh_VecManAdd
(
pCubeHash
,
vCube
);
iCubeNoID
=
Hsh_VecManAdd
(
pCubeHash
,
vCube
);
int
Temp
=
(
1
<<
(
iTranslation
&
31
)
);
Temp
=
(
1
<<
(
iTranslation
&
31
)
);
if
(
iCubeNoID
==
Vec_IntSize
(
pFxchMan
->
vOutputID
)
/
SizeOutputID
)
if
(
iCubeNoID
==
Vec_IntSize
(
pFxchMan
->
vOutputID
)
/
SizeOutputID
)
{
{
for
(
i
nt
i
=
0
;
i
<
SizeOutputID
;
i
++
)
for
(
i
=
0
;
i
<
SizeOutputID
;
i
++
)
pFxchMan
->
pTempOutputID
[
i
]
=
0
;
pFxchMan
->
pTempOutputID
[
i
]
=
0
;
pFxchMan
->
pTempOutputID
[
iTranslation
>>
5
]
=
Temp
;
pFxchMan
->
pTempOutputID
[
iTranslation
>>
5
]
=
Temp
;
...
@@ -81,7 +83,7 @@ void Fxch_CubesGruping(Fxch_Man_t* pFxchMan)
...
@@ -81,7 +83,7 @@ void Fxch_CubesGruping(Fxch_Man_t* pFxchMan)
else
else
{
{
Vec_IntClear
(
vCube
);
Vec_IntClear
(
vCube
);
int
*
pEntry
=
Vec_IntEntryP
(
pFxchMan
->
vOutputID
,
(
iCubeNoID
*
SizeOutputID
)
+
(
iTranslation
>>
5
)
);
pEntry
=
Vec_IntEntryP
(
pFxchMan
->
vOutputID
,
(
iCubeNoID
*
SizeOutputID
)
+
(
iTranslation
>>
5
)
);
*
pEntry
|=
Temp
;
*
pEntry
|=
Temp
;
}
}
}
}
...
@@ -111,11 +113,12 @@ void Fxch_CubesUnGruping(Fxch_Man_t* pFxchMan)
...
@@ -111,11 +113,12 @@ void Fxch_CubesUnGruping(Fxch_Man_t* pFxchMan)
assert
(
Vec_WecSize
(
pFxchMan
->
vCubes
)
==
(
Vec_IntSize
(
pFxchMan
->
vOutputID
)
/
pFxchMan
->
nSizeOutputID
)
);
assert
(
Vec_WecSize
(
pFxchMan
->
vCubes
)
==
(
Vec_IntSize
(
pFxchMan
->
vOutputID
)
/
pFxchMan
->
nSizeOutputID
)
);
Vec_WecForEachLevel
(
pFxchMan
->
vCubes
,
vCube
,
iCube
)
Vec_WecForEachLevel
(
pFxchMan
->
vCubes
,
vCube
,
iCube
)
{
{
int
*
pOutputID
,
nOnes
;
if
(
Vec_IntSize
(
vCube
)
==
0
||
Vec_IntEntry
(
vCube
,
0
)
!=
0
)
if
(
Vec_IntSize
(
vCube
)
==
0
||
Vec_IntEntry
(
vCube
,
0
)
!=
0
)
continue
;
continue
;
int
*
pOutputID
=
Vec_IntEntryP
(
pFxchMan
->
vOutputID
,
iCube
*
pFxchMan
->
nSizeOutputID
);
pOutputID
=
Vec_IntEntryP
(
pFxchMan
->
vOutputID
,
iCube
*
pFxchMan
->
nSizeOutputID
);
int
nOnes
=
0
;
nOnes
=
0
;
for
(
i
=
0
;
i
<
pFxchMan
->
nSizeOutputID
;
i
++
)
for
(
i
=
0
;
i
<
pFxchMan
->
nSizeOutputID
;
i
++
)
nOnes
+=
Fxch_CountOnes
(
(
unsigned
int
)
pOutputID
[
i
]
);
nOnes
+=
Fxch_CountOnes
(
(
unsigned
int
)
pOutputID
[
i
]
);
...
...
src/opt/fxch/Fxch.h
View file @
8bc4894c
...
@@ -28,6 +28,9 @@
...
@@ -28,6 +28,9 @@
ABC_NAMESPACE_HEADER_START
ABC_NAMESPACE_HEADER_START
typedef
unsigned
char
uint8_t
;
typedef
unsigned
int
uint32_t
;
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// TYPEDEF DECLARATIONS ///
/// TYPEDEF DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
...
...
src/opt/fxch/FxchMan.c
View file @
8bc4894c
...
@@ -67,16 +67,17 @@ static inline int Fxch_ManDivSingleCube( Fxch_Man_t* pFxchMan,
...
@@ -67,16 +67,17 @@ static inline int Fxch_ManDivSingleCube( Fxch_Man_t* pFxchMan,
Vec_IntForEachEntryStart
(
vCube
,
Lit0
,
i
,
1
)
Vec_IntForEachEntryStart
(
vCube
,
Lit0
,
i
,
1
)
Vec_IntForEachEntryStart
(
vCube
,
Lit1
,
k
,
(
i
+
1
)
)
Vec_IntForEachEntryStart
(
vCube
,
Lit1
,
k
,
(
i
+
1
)
)
{
{
int
*
pOutputID
,
nOnes
,
j
,
z
;
assert
(
Lit0
<
Lit1
);
assert
(
Lit0
<
Lit1
);
Vec_IntClear
(
pFxchMan
->
vCubeFree
);
Vec_IntClear
(
pFxchMan
->
vCubeFree
);
Vec_IntPush
(
pFxchMan
->
vCubeFree
,
Abc_Var2Lit
(
Abc_LitNot
(
Lit0
),
0
)
);
Vec_IntPush
(
pFxchMan
->
vCubeFree
,
Abc_Var2Lit
(
Abc_LitNot
(
Lit0
),
0
)
);
Vec_IntPush
(
pFxchMan
->
vCubeFree
,
Abc_Var2Lit
(
Abc_LitNot
(
Lit1
),
1
)
);
Vec_IntPush
(
pFxchMan
->
vCubeFree
,
Abc_Var2Lit
(
Abc_LitNot
(
Lit1
),
1
)
);
int
*
pOutputID
=
Vec_IntEntryP
(
pFxchMan
->
vOutputID
,
iCube
*
pFxchMan
->
nSizeOutputID
);
pOutputID
=
Vec_IntEntryP
(
pFxchMan
->
vOutputID
,
iCube
*
pFxchMan
->
nSizeOutputID
);
int
nOnes
=
0
;
nOnes
=
0
;
for
(
int
j
=
0
;
j
<
pFxchMan
->
nSizeOutputID
;
j
++
)
for
(
j
=
0
;
j
<
pFxchMan
->
nSizeOutputID
;
j
++
)
nOnes
+=
Fxch_CountOnes
(
pOutputID
[
j
]
);
nOnes
+=
Fxch_CountOnes
(
pOutputID
[
j
]
);
if
(
nOnes
==
0
)
if
(
nOnes
==
0
)
...
@@ -84,13 +85,13 @@ static inline int Fxch_ManDivSingleCube( Fxch_Man_t* pFxchMan,
...
@@ -84,13 +85,13 @@ static inline int Fxch_ManDivSingleCube( Fxch_Man_t* pFxchMan,
if
(
fAdd
)
if
(
fAdd
)
{
{
for
(
int
z
=
0
;
z
<
nOnes
;
z
++
)
for
(
z
=
0
;
z
<
nOnes
;
z
++
)
Fxch_DivAdd
(
pFxchMan
,
fUpdate
,
fSingleCube
,
fBase
);
Fxch_DivAdd
(
pFxchMan
,
fUpdate
,
fSingleCube
,
fBase
);
pFxchMan
->
nPairsS
++
;
pFxchMan
->
nPairsS
++
;
}
}
else
else
{
{
for
(
int
z
=
0
;
z
<
nOnes
;
z
++
)
for
(
z
=
0
;
z
<
nOnes
;
z
++
)
Fxch_DivRemove
(
pFxchMan
,
fUpdate
,
fSingleCube
,
fBase
);
Fxch_DivRemove
(
pFxchMan
,
fUpdate
,
fSingleCube
,
fBase
);
pFxchMan
->
nPairsS
--
;
pFxchMan
->
nPairsS
--
;
}
}
...
@@ -396,6 +397,7 @@ static inline void Fxch_ManExtractDivFromCubePairs( Fxch_Man_t* pFxchMan,
...
@@ -396,6 +397,7 @@ static inline void Fxch_ManExtractDivFromCubePairs( Fxch_Man_t* pFxchMan,
int
j
,
Lit
,
int
j
,
Lit
,
RetValue
,
RetValue
,
fCompl
=
0
;
fCompl
=
0
;
int
*
pOutputID0
,
*
pOutputID1
;
Vec_Int_t
*
vCube
=
NULL
,
Vec_Int_t
*
vCube
=
NULL
,
*
vCube0
=
Fxch_ManGetCube
(
pFxchMan
,
iCube0
),
*
vCube0
=
Fxch_ManGetCube
(
pFxchMan
,
iCube0
),
...
@@ -410,8 +412,8 @@ static inline void Fxch_ManExtractDivFromCubePairs( Fxch_Man_t* pFxchMan,
...
@@ -410,8 +412,8 @@ static inline void Fxch_ManExtractDivFromCubePairs( Fxch_Man_t* pFxchMan,
pFxchMan
->
nLits
-=
Vec_IntSize
(
pFxchMan
->
vDiv
)
+
Vec_IntSize
(
vCube1
)
-
2
;
pFxchMan
->
nLits
-=
Vec_IntSize
(
pFxchMan
->
vDiv
)
+
Vec_IntSize
(
vCube1
)
-
2
;
/* Identify type of Extraction */
/* Identify type of Extraction */
int
*
pOutputID0
=
Vec_IntEntryP
(
pFxchMan
->
vOutputID
,
iCube0
*
pFxchMan
->
nSizeOutputID
);
pOutputID0
=
Vec_IntEntryP
(
pFxchMan
->
vOutputID
,
iCube0
*
pFxchMan
->
nSizeOutputID
);
int
*
pOutputID1
=
Vec_IntEntryP
(
pFxchMan
->
vOutputID
,
iCube1
*
pFxchMan
->
nSizeOutputID
);
pOutputID1
=
Vec_IntEntryP
(
pFxchMan
->
vOutputID
,
iCube1
*
pFxchMan
->
nSizeOutputID
);
RetValue
=
1
;
RetValue
=
1
;
for
(
j
=
0
;
j
<
pFxchMan
->
nSizeOutputID
&&
RetValue
;
j
++
)
for
(
j
=
0
;
j
<
pFxchMan
->
nSizeOutputID
&&
RetValue
;
j
++
)
RetValue
=
(
pOutputID0
[
j
]
==
pOutputID1
[
j
]
);
RetValue
=
(
pOutputID0
[
j
]
==
pOutputID1
[
j
]
);
...
@@ -512,7 +514,8 @@ static inline int Fxch_ManCreateCube( Fxch_Man_t* pFxchMan,
...
@@ -512,7 +514,8 @@ static inline int Fxch_ManCreateCube( Fxch_Man_t* pFxchMan,
int
Lit1
)
int
Lit1
)
{
{
int
Level
,
int
Level
,
iVarNew
;
iVarNew
,
j
;
Vec_Int_t
*
vCube0
,
Vec_Int_t
*
vCube0
,
*
vCube1
;
*
vCube1
;
...
@@ -521,7 +524,7 @@ static inline int Fxch_ManCreateCube( Fxch_Man_t* pFxchMan,
...
@@ -521,7 +524,7 @@ static inline int Fxch_ManCreateCube( Fxch_Man_t* pFxchMan,
pFxchMan
->
nVars
++
;
pFxchMan
->
nVars
++
;
/* Clear temporary outputID vector */
/* Clear temporary outputID vector */
for
(
int
j
=
0
;
j
<
pFxchMan
->
nSizeOutputID
;
j
++
)
for
(
j
=
0
;
j
<
pFxchMan
->
nSizeOutputID
;
j
++
)
pFxchMan
->
pTempOutputID
[
j
]
=
0
;
pFxchMan
->
pTempOutputID
[
j
]
=
0
;
/* Create new Lit hash keys */
/* Create new Lit hash keys */
...
@@ -674,6 +677,7 @@ void Fxch_ManUpdate( Fxch_Man_t* pFxchMan,
...
@@ -674,6 +677,7 @@ void Fxch_ManUpdate( Fxch_Man_t* pFxchMan,
Vec_IntForEachEntryDouble
(
pFxchMan
->
vSCC
,
iCube0
,
iCube1
,
i
)
Vec_IntForEachEntryDouble
(
pFxchMan
->
vSCC
,
iCube0
,
iCube1
,
i
)
{
{
int
j
,
RetValue
=
1
;
int
*
pOutputID0
=
Vec_IntEntryP
(
pFxchMan
->
vOutputID
,
iCube0
*
pFxchMan
->
nSizeOutputID
);
int
*
pOutputID0
=
Vec_IntEntryP
(
pFxchMan
->
vOutputID
,
iCube0
*
pFxchMan
->
nSizeOutputID
);
int
*
pOutputID1
=
Vec_IntEntryP
(
pFxchMan
->
vOutputID
,
iCube1
*
pFxchMan
->
nSizeOutputID
);
int
*
pOutputID1
=
Vec_IntEntryP
(
pFxchMan
->
vOutputID
,
iCube1
*
pFxchMan
->
nSizeOutputID
);
vCube0
=
Vec_WecEntry
(
pFxchMan
->
vCubes
,
iCube0
);
vCube0
=
Vec_WecEntry
(
pFxchMan
->
vCubes
,
iCube0
);
...
@@ -695,7 +699,7 @@ void Fxch_ManUpdate( Fxch_Man_t* pFxchMan,
...
@@ -695,7 +699,7 @@ void Fxch_ManUpdate( Fxch_Man_t* pFxchMan,
if
(
Vec_IntSize
(
vCube0
)
==
Vec_IntSize
(
vCube1
)
)
if
(
Vec_IntSize
(
vCube0
)
==
Vec_IntSize
(
vCube1
)
)
{
{
for
(
int
j
=
0
;
j
<
pFxchMan
->
nSizeOutputID
;
j
++
)
for
(
j
=
0
;
j
<
pFxchMan
->
nSizeOutputID
;
j
++
)
{
{
pOutputID1
[
j
]
|=
pOutputID0
[
j
];
pOutputID1
[
j
]
|=
pOutputID0
[
j
];
pOutputID0
[
j
]
=
0
;
pOutputID0
[
j
]
=
0
;
...
@@ -705,8 +709,7 @@ void Fxch_ManUpdate( Fxch_Man_t* pFxchMan,
...
@@ -705,8 +709,7 @@ void Fxch_ManUpdate( Fxch_Man_t* pFxchMan,
continue
;
continue
;
}
}
int
RetValue
=
1
;
for
(
j
=
0
;
j
<
pFxchMan
->
nSizeOutputID
&&
RetValue
;
j
++
)
for
(
int
j
=
0
;
j
<
pFxchMan
->
nSizeOutputID
&&
RetValue
;
j
++
)
RetValue
=
(
pOutputID0
[
j
]
==
pOutputID1
[
j
]
);
RetValue
=
(
pOutputID0
[
j
]
==
pOutputID1
[
j
]
);
if
(
RetValue
)
if
(
RetValue
)
...
@@ -717,7 +720,7 @@ void Fxch_ManUpdate( Fxch_Man_t* pFxchMan,
...
@@ -717,7 +720,7 @@ void Fxch_ManUpdate( Fxch_Man_t* pFxchMan,
else
else
{
{
RetValue
=
0
;
RetValue
=
0
;
for
(
int
j
=
0
;
j
<
pFxchMan
->
nSizeOutputID
;
j
++
)
for
(
j
=
0
;
j
<
pFxchMan
->
nSizeOutputID
;
j
++
)
{
{
RetValue
|=
(
pOutputID0
[
j
]
&
~
(
pOutputID1
[
j
]
)
);
RetValue
|=
(
pOutputID0
[
j
]
&
~
(
pOutputID1
[
j
]
)
);
pOutputID0
[
j
]
&=
~
(
pOutputID1
[
j
]
);
pOutputID0
[
j
]
&=
~
(
pOutputID1
[
j
]
);
...
...
src/opt/fxch/FxchSCHashTable.c
View file @
8bc4894c
...
@@ -124,7 +124,7 @@ static inline int Fxch_SCHashTableEntryCompare( Fxch_SCHashTable_t* pSCHashTable
...
@@ -124,7 +124,7 @@ static inline int Fxch_SCHashTableEntryCompare( Fxch_SCHashTable_t* pSCHashTable
int
*
pOutputID0
=
Vec_IntEntryP
(
pSCHashTable
->
pFxchMan
->
vOutputID
,
pSCData0
->
iCube
*
pSCHashTable
->
pFxchMan
->
nSizeOutputID
),
int
*
pOutputID0
=
Vec_IntEntryP
(
pSCHashTable
->
pFxchMan
->
vOutputID
,
pSCData0
->
iCube
*
pSCHashTable
->
pFxchMan
->
nSizeOutputID
),
*
pOutputID1
=
Vec_IntEntryP
(
pSCHashTable
->
pFxchMan
->
vOutputID
,
pSCData1
->
iCube
*
pSCHashTable
->
pFxchMan
->
nSizeOutputID
);
*
pOutputID1
=
Vec_IntEntryP
(
pSCHashTable
->
pFxchMan
->
vOutputID
,
pSCData1
->
iCube
*
pSCHashTable
->
pFxchMan
->
nSizeOutputID
);
int
Result
=
0
;
int
i
,
Result
=
0
;
if
(
!
Vec_IntSize
(
vCube0
)
||
if
(
!
Vec_IntSize
(
vCube0
)
||
!
Vec_IntSize
(
vCube1
)
||
!
Vec_IntSize
(
vCube1
)
||
...
@@ -132,7 +132,7 @@ static inline int Fxch_SCHashTableEntryCompare( Fxch_SCHashTable_t* pSCHashTable
...
@@ -132,7 +132,7 @@ static inline int Fxch_SCHashTableEntryCompare( Fxch_SCHashTable_t* pSCHashTable
pSCData0
->
Id
!=
pSCData1
->
Id
)
pSCData0
->
Id
!=
pSCData1
->
Id
)
return
0
;
return
0
;
for
(
i
nt
i
=
0
;
i
<
pSCHashTable
->
pFxchMan
->
nSizeOutputID
&&
Result
==
0
;
i
++
)
for
(
i
=
0
;
i
<
pSCHashTable
->
pFxchMan
->
nSizeOutputID
&&
Result
==
0
;
i
++
)
Result
=
(
pOutputID0
[
i
]
&
pOutputID1
[
i
]
);
Result
=
(
pOutputID0
[
i
]
&
pOutputID1
[
i
]
);
if
(
Result
==
0
)
if
(
Result
==
0
)
...
@@ -181,6 +181,8 @@ int Fxch_SCHashTableInsert( Fxch_SCHashTable_t* pSCHashTable,
...
@@ -181,6 +181,8 @@ int Fxch_SCHashTableInsert( Fxch_SCHashTable_t* pSCHashTable,
int
Pairs
=
0
;
int
Pairs
=
0
;
uint32_t
BinID
;
uint32_t
BinID
;
Fxch_SCHashTable_Entry_t
*
pBin
;
Fxch_SCHashTable_Entry_t
*
pBin
;
Fxch_SubCube_t
*
pNewEntry
;
int
iEntry
;
MurmurHash3_x86_32
(
(
void
*
)
&
SubCubeID
,
sizeof
(
int
),
0x9747b28c
,
&
BinID
);
MurmurHash3_x86_32
(
(
void
*
)
&
SubCubeID
,
sizeof
(
int
),
0x9747b28c
,
&
BinID
);
pBin
=
Fxch_SCHashTableBin
(
pSCHashTable
,
BinID
);
pBin
=
Fxch_SCHashTableBin
(
pSCHashTable
,
BinID
);
...
@@ -207,15 +209,15 @@ int Fxch_SCHashTableInsert( Fxch_SCHashTable_t* pSCHashTable,
...
@@ -207,15 +209,15 @@ int Fxch_SCHashTableInsert( Fxch_SCHashTable_t* pSCHashTable,
if
(
pBin
->
Size
==
1
)
if
(
pBin
->
Size
==
1
)
return
0
;
return
0
;
Fxch_SubCube_t
*
pNewEntry
=
&
(
pBin
->
vSCData
[
iNewEntry
]
);
pNewEntry
=
&
(
pBin
->
vSCData
[
iNewEntry
]
);
for
(
i
nt
iEntry
=
0
;
iEntry
<
pBin
->
Size
-
1
;
iEntry
++
)
for
(
i
Entry
=
0
;
iEntry
<
(
int
)
pBin
->
Size
-
1
;
iEntry
++
)
{
{
Fxch_SubCube_t
*
pEntry
=
&
(
pBin
->
vSCData
[
iEntry
]
);
Fxch_SubCube_t
*
pEntry
=
&
(
pBin
->
vSCData
[
iEntry
]
);
int
*
pOutputID0
=
Vec_IntEntryP
(
pSCHashTable
->
pFxchMan
->
vOutputID
,
pEntry
->
iCube
*
pSCHashTable
->
pFxchMan
->
nSizeOutputID
);
int
*
pOutputID0
=
Vec_IntEntryP
(
pSCHashTable
->
pFxchMan
->
vOutputID
,
pEntry
->
iCube
*
pSCHashTable
->
pFxchMan
->
nSizeOutputID
);
int
*
pOutputID1
=
Vec_IntEntryP
(
pSCHashTable
->
pFxchMan
->
vOutputID
,
pNewEntry
->
iCube
*
pSCHashTable
->
pFxchMan
->
nSizeOutputID
);
int
*
pOutputID1
=
Vec_IntEntryP
(
pSCHashTable
->
pFxchMan
->
vOutputID
,
pNewEntry
->
iCube
*
pSCHashTable
->
pFxchMan
->
nSizeOutputID
);
int
Result
=
0
;
int
Result
=
0
;
int
Base
;
int
Base
;
int
iNewDiv
;
int
iNewDiv
,
i
,
z
;
if
(
!
Fxch_SCHashTableEntryCompare
(
pSCHashTable
,
vCubes
,
pEntry
,
pNewEntry
)
)
if
(
!
Fxch_SCHashTableEntryCompare
(
pSCHashTable
,
vCubes
,
pEntry
,
pNewEntry
)
)
continue
;
continue
;
...
@@ -244,10 +246,10 @@ int Fxch_SCHashTableInsert( Fxch_SCHashTable_t* pSCHashTable,
...
@@ -244,10 +246,10 @@ int Fxch_SCHashTableInsert( Fxch_SCHashTable_t* pSCHashTable,
if
(
Base
<
0
)
if
(
Base
<
0
)
continue
;
continue
;
for
(
i
nt
i
=
0
;
i
<
pSCHashTable
->
pFxchMan
->
nSizeOutputID
;
i
++
)
for
(
i
=
0
;
i
<
pSCHashTable
->
pFxchMan
->
nSizeOutputID
;
i
++
)
Result
+=
Fxch_CountOnes
(
pOutputID0
[
i
]
&
pOutputID1
[
i
]
);
Result
+=
Fxch_CountOnes
(
pOutputID0
[
i
]
&
pOutputID1
[
i
]
);
for
(
int
z
=
0
;
z
<
Result
;
z
++
)
for
(
z
=
0
;
z
<
Result
;
z
++
)
iNewDiv
=
Fxch_DivAdd
(
pSCHashTable
->
pFxchMan
,
fUpdate
,
0
,
Base
);
iNewDiv
=
Fxch_DivAdd
(
pSCHashTable
->
pFxchMan
,
fUpdate
,
0
,
Base
);
Vec_WecPush
(
pSCHashTable
->
pFxchMan
->
vDivCubePairs
,
iNewDiv
,
pEntry
->
iCube
);
Vec_WecPush
(
pSCHashTable
->
pFxchMan
->
vDivCubePairs
,
iNewDiv
,
pEntry
->
iCube
);
...
@@ -271,6 +273,8 @@ int Fxch_SCHashTableRemove( Fxch_SCHashTable_t* pSCHashTable,
...
@@ -271,6 +273,8 @@ int Fxch_SCHashTableRemove( Fxch_SCHashTable_t* pSCHashTable,
int
Pairs
=
0
;
int
Pairs
=
0
;
uint32_t
BinID
;
uint32_t
BinID
;
Fxch_SCHashTable_Entry_t
*
pBin
;
Fxch_SCHashTable_Entry_t
*
pBin
;
Fxch_SubCube_t
*
pEntry
;
int
idx
;
MurmurHash3_x86_32
(
(
void
*
)
&
SubCubeID
,
sizeof
(
int
),
0x9747b28c
,
&
BinID
);
MurmurHash3_x86_32
(
(
void
*
)
&
SubCubeID
,
sizeof
(
int
),
0x9747b28c
,
&
BinID
);
...
@@ -282,22 +286,20 @@ int Fxch_SCHashTableRemove( Fxch_SCHashTable_t* pSCHashTable,
...
@@ -282,22 +286,20 @@ int Fxch_SCHashTableRemove( Fxch_SCHashTable_t* pSCHashTable,
return
0
;
return
0
;
}
}
for
(
iEntry
=
0
;
iEntry
<
pBin
->
Size
;
iEntry
++
)
for
(
iEntry
=
0
;
iEntry
<
(
int
)
pBin
->
Size
;
iEntry
++
)
if
(
pBin
->
vSCData
[
iEntry
].
iCube
==
iCube
)
if
(
pBin
->
vSCData
[
iEntry
].
iCube
==
iCube
)
break
;
break
;
assert
(
(
iEntry
!=
pBin
->
Size
)
&&
(
pBin
->
Size
!=
0
)
);
assert
(
(
iEntry
!=
pBin
->
Size
)
&&
(
pBin
->
Size
!=
0
)
);
Fxch_SubCube_t
*
pEntry
=
&
(
pBin
->
vSCData
[
iEntry
]
);
pEntry
=
&
(
pBin
->
vSCData
[
iEntry
]
);
for
(
int
idx
=
0
;
idx
<
pBin
->
Size
;
idx
++
)
for
(
idx
=
0
;
idx
<
(
int
)
pBin
->
Size
;
idx
++
)
if
(
idx
!=
iEntry
)
{
{
if
(
idx
==
iEntry
)
continue
;
int
Base
,
int
Base
,
iDiv
;
iDiv
;
int
i
,
int
i
,
z
,
iCube0
,
iCube0
,
iCube1
;
iCube1
;
...
@@ -317,10 +319,10 @@ int Fxch_SCHashTableRemove( Fxch_SCHashTable_t* pSCHashTable,
...
@@ -317,10 +319,10 @@ int Fxch_SCHashTableRemove( Fxch_SCHashTable_t* pSCHashTable,
if
(
Base
<
0
)
if
(
Base
<
0
)
continue
;
continue
;
for
(
i
nt
i
=
0
;
i
<
pSCHashTable
->
pFxchMan
->
nSizeOutputID
;
i
++
)
for
(
i
=
0
;
i
<
pSCHashTable
->
pFxchMan
->
nSizeOutputID
;
i
++
)
Result
+=
Fxch_CountOnes
(
pOutputID0
[
i
]
&
pOutputID1
[
i
]
);
Result
+=
Fxch_CountOnes
(
pOutputID0
[
i
]
&
pOutputID1
[
i
]
);
for
(
int
z
=
0
;
z
<
Result
;
z
++
)
for
(
z
=
0
;
z
<
Result
;
z
++
)
iDiv
=
Fxch_DivRemove
(
pSCHashTable
->
pFxchMan
,
fUpdate
,
0
,
Base
);
iDiv
=
Fxch_DivRemove
(
pSCHashTable
->
pFxchMan
,
fUpdate
,
0
,
Base
);
vDivCubePairs
=
Vec_WecEntry
(
pSCHashTable
->
pFxchMan
->
vDivCubePairs
,
iDiv
);
vDivCubePairs
=
Vec_WecEntry
(
pSCHashTable
->
pFxchMan
->
vDivCubePairs
,
iDiv
);
...
...
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