FTK changes. Various optimizations for Solaris.

git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@785 0109f412-320b-0410-ab79-c3e0c5ffbbe6
This commit is contained in:
ahodgkinson
2006-08-22 20:54:08 +00:00
parent 564ae538a7
commit ccdbccde49
6 changed files with 179 additions and 267 deletions

View File

@@ -857,7 +857,7 @@ ifdef unix_target
ifeq ($(target_os_family),solaris)
compiler = CC
exe_linker = CC
shared_linker = ld
shared_linker = CC
compiler_version := $(shell $(compiler) -V 2>&1)
ifneq (,$(findstring Sun C++,$(compiler_version)))
sun_studio_compiler = yes
@@ -931,6 +931,9 @@ ifdef unix_target
ifeq ($(target_os_family),solaris)
ifeq ($(usenativecc),yes)
ccflags += -KPIC
ifeq ($(target_build_type),release)
ccflags += -xO3
endif
ifeq ($(sun_studio_compiler),yes)
ccflags += -errwarn=%all -errtags -erroff=hidef,inllargeuse
endif
@@ -1109,7 +1112,7 @@ ifdef netware_target
shared_linker = "$(call normpath,$(strip $(wc_dir)))/binnt/wlink.exe"
compiler = "$(call normpath,$(wc_dir))/binnt/wpp386.exe"
ifneq ($(build),release)
ifneq ($(target_build_type),release)
ccdefs += FLM_DEBUG
endif
@@ -1121,7 +1124,7 @@ ifdef netware_target
ccflags += /ez /6s /w4 /za /zp1 /zq /zm /s /ei /of+ /we /bt=NETWARE
ifeq ($(build),release)
ifeq ($(target_build_type),release)
ccflags += /oair
else
ccflags += /hc

View File

@@ -45,8 +45,6 @@ extern "C" unsigned long ftkGetMMXSupported(void);
#if defined( FLM_GNUC) || defined( FLM_WIN) || defined( FLM_NLM)
#define FLM_HAVE_FAST_CHECKSUM_ROUTINES
#endif
#elif defined( FLM_SPARC_PLUS)
#define FLM_HAVE_FAST_CHECKSUM_ROUTINES
#endif
/********************************************************************
@@ -604,178 +602,6 @@ void ftkFastXor(
}
#endif
/****************************************************************************
Desc:
****************************************************************************/
#if defined( FLM_SPARC_PLUS)
volatile void sparc_csum_code( void)
{
// Calculate the sum and xor bytes of a checksum
asm( ".global ftkFastChecksum");
#ifdef FLM_64BIT
asm( ".align 8");
#else
asm( ".align 4");
#endif
asm( "ftkFastChecksum:");
asm( " save %sp, -96, %sp");
#ifdef FLM_64BIT
asm( " ldx [%i1], %l1");
asm( " ldx [%i2], %l2");
#else
asm( " ld [%i1], %l1");
asm( " ld [%i2], %l2");
#endif
asm( " mov %i0, %l0");
asm( " mov %i3, %l3");
asm( " clr %l4");
asm( " csum_loop:");
asm( " ldub [%l0], %l4");
asm( " add %l4, %l1, %l1");
asm( " xor %l4, %l2, %l2");
asm( " inc %l0");
asm( " subcc %l3, 1, %l3");
asm( " bg csum_loop");
asm( " nop");
asm( " and %l1, 0xFF, %l1");
asm( " and %l2, 0xFF, %l2");
#ifdef FLM_64BIT
asm( " stx %l1, [%i1]");
asm( " stx %l2, [%i2]");
#else
asm( " st %l1, [%i1]");
asm( " st %l2, [%i2]");
#endif
asm( " ret");
asm( " restore");
asm( ".type ftkFastChecksum, #function");
asm( ".size ftkFastChecksum, (.-ftkFastChecksum)");
// Calculate the xor byte of a checksum
asm( ".global ftkFastXor");
#ifdef FLM_64BIT
asm( ".align 8");
#else
asm( ".align 4");
#endif
asm( "ftkFastXor:");
asm( " save %sp, -96, %sp");
#ifdef FLM_64BIT
asm( " ldx [%i1], %l1");
#else
asm( " ld [%i1], %l1");
#endif
asm( " mov %i0, %l0");
asm( " mov %i2, %l2");
asm( " clr %l3");
#ifdef FLM_64BIT
asm( " and %l0, 7, %l4");
#else
asm( " and %l0, 3, %l4");
#endif
asm( " cmp %l4, 0");
asm( " be xor_aligned_loop_init");
asm( " nop");
#ifdef FLM_64BIT
asm( " mov 8, %l5");
#else
asm( " mov 4, %l5");
#endif
asm( " sub %l5, %l4, %l4");
asm( " xor_lead_loop:");
asm( " ldub [%l0], %l3");
asm( " xor %l3, %l1, %l1");
asm( " inc %l0");
asm( " subcc %l2, 1, %l2");
asm( " be xor_done");
asm( " nop");
asm( " subcc %l4, 1, %l4");
asm( " bg xor_lead_loop");
asm( " nop");
asm( " xor_aligned_loop_init:");
#ifdef FLM_64BIT
asm( " cmp %l2, 8");
#else
asm( " cmp %l2, 4");
#endif
asm( " bl xor_tail_loop_init");
asm( " nop");
asm( " xor_aligned_loop:");
#ifdef FLM_64BIT
asm( " ldx [%l0], %l3");
#else
asm( " ld [%l0], %l3");
#endif
asm( " xor %l3, %l1, %l1");
#ifdef FLM_64BIT
asm( " add %l0, 8, %l0");
asm( " sub %l2, 8, %l2");
asm( " cmp %l2, 7");
#else
asm( " add %l0, 4, %l0");
asm( " sub %l2, 4, %l2");
asm( " cmp %l2, 3");
#endif
asm( " bg xor_aligned_loop");
asm( " nop");
asm( " xor_tail_loop_init:");
asm( " cmp %l2, 1");
asm( " bl xor_done");
asm( " xor_tail_loop:");
asm( " ldub [%l0], %l3");
asm( " xor %l3, %l1, %l1");
asm( " inc %l0");
asm( " subcc %l2, 1, %l2");
asm( " bg xor_tail_loop");
asm( " nop");
asm( " xor_done:");
asm( " mov %l1, %l3");
#ifdef FLM_64BIT
asm( " mov 7, %l2");
#else
asm( " mov 3, %l2");
#endif
asm( " xor_assemble_loop:");
#ifdef FLM_64BIT
asm( " srlx %l3, 8, %l3");
#else
asm( " srl %l3, 8, %l3");
#endif
asm( " xor %l3, %l1, %l1");
asm( " subcc %l2, 1, %l2");
asm( " bg xor_assemble_loop");
asm( " nop");
asm( " and %l1, 0xFF, %l1");
#ifdef FLM_64BIT
asm( " stx %l1, [%i1]");
#else
asm( " st %l1, [%i1]");
#endif
asm( " ret");
asm( " restore");
asm( ".type ftkFastXor, #function");
asm( ".size ftkFastXor, (.-ftkFastXor)");
}
#endif
/******************************************************************************
Desc: Sets the global variable to check if MMX instructions are allowed.
******************************************************************************/
@@ -792,8 +618,6 @@ void f_initFastCheckSum( void)
// will be on at least a P5.
gv_bCanUseFastCheckSum = ftkGetMMXSupported() ? TRUE : FALSE;
#elif defined( FLM_SPARC_PLUS)
gv_bCanUseFastCheckSum = TRUE;
#endif
}
@@ -823,22 +647,24 @@ FLMUINT32 FLMAPI f_calcFastChecksum(
uiXOR = *puiXOR;
}
#ifdef FLM_HAVE_FAST_CHECKSUM_ROUTINES
if( gv_bCanUseFastCheckSum)
{
ftkFastChecksum( pvData, (unsigned long *) &uiSum,
(unsigned long *) &uiXOR, (unsigned long) uiLength);
}
else
#endif
{
FLMBYTE * pucCur = pucData;
FLMBYTE * pucEnd = pucData + uiLength;
register FLMBYTE * pucCur = pucData;
register FLMBYTE * pucEnd = pucData + uiLength;
while( pucCur < pucEnd)
{
uiSum += *pucCur;
uiSum += *pucCur;
uiXOR ^= *pucCur++;
}
uiSum &= 0xFF;
}
@@ -960,11 +786,13 @@ FLMBYTE FLMAPI f_calcPacketChecksum(
{
FLMUINT uiChecksum = 0;
#ifdef FLM_HAVE_FAST_CHECKSUM_ROUTINES
if( gv_bCanUseFastCheckSum)
{
ftkFastXor( pvPacket, &uiChecksum, uiBytesToChecksum);
}
else
#endif
{
FLMBYTE * pucEnd;
FLMBYTE * pucSectionEnd;
@@ -973,7 +801,7 @@ FLMBYTE FLMAPI f_calcPacketChecksum(
pucCur = (FLMBYTE *)pvPacket;
pucEnd = pucCur + uiBytesToChecksum;
#ifdef FLM_64BIT
pucSectionEnd = pucCur + (sizeof( FLMUINT) - ((FLMUINT)pucCur & 0x7));
#else

View File

@@ -39,6 +39,10 @@ F_MUTEX F_FileHdl::m_hAsyncListMutex = F_MUTEX_NULL;
F_FileAsyncClient * F_FileHdl::m_pFirstAvailAsync = NULL;
FLMUINT F_FileHdl::m_uiAvailAsyncCount = 0;
#ifdef FLM_SPARC_PLUS
void * gv_pSparcAsmDummy = (void *)sparc_asm_code;
#endif
FSTATIC RCODE f_initRandomGenerator( void);
FSTATIC void f_freeRandomGenerator( void);

View File

@@ -190,6 +190,13 @@
#define f_va_copy(to, from) ((to) = (from))
#endif
/**********************************************************************
Desc:
**********************************************************************/
#if defined( FLM_SPARC_PLUS)
extern "C" void sparc_asm_code( void);
#endif
/**********************************************************************
Desc:
**********************************************************************/

View File

@@ -1316,7 +1316,7 @@ Desc: Remove this error pragma if you really intend to run with
Desc:
****************************************************************************/
#if defined( FLM_SPARC_PLUS)
void sparc_asm_code( void)
extern "C" void sparc_asm_code( void)
{
asm( ".align 8");
asm( ".global sparc_atomic_add_32");

View File

@@ -51,6 +51,9 @@ FSTATIC RCODE ftkTestAtomics( void);
FSTATIC RCODE FLMAPI ftkAtomicIncThread(
IF_Thread * pThread);
FSTATIC RCODE FLMAPI ftkAtomicIncMutexThread(
IF_Thread * pThread);
FSTATIC RCODE FLMAPI ftkAtomicDecThread(
IF_Thread * pThread);
@@ -4390,21 +4393,6 @@ int main( void)
f_assert( F_ROGONEK == rogonek);
f_assert( F_RMACRON == rmacron);
// Make sure text stuff is working
if( RC_BAD( rc = ftkTestText()))
{
goto Exit;
}
// Run a multi-threaded test to verify the proper operation of
// the atomic operations
if( RC_BAD( rc = ftkTestAtomics()))
{
goto Exit;
}
// Test the checksum routines
if( RC_BAD( rc = ftkFastChecksumTest()))
@@ -4424,6 +4412,21 @@ int main( void)
puiPacketSize++;
}
// Make sure text stuff is working
if( RC_BAD( rc = ftkTestText()))
{
goto Exit;
}
// Run a multi-threaded test to verify the proper operation of
// the atomic operations
if( RC_BAD( rc = ftkTestAtomics()))
{
goto Exit;
}
Exit:
if( pDirHdl)
@@ -4454,12 +4457,12 @@ RCODE ftkTestAtomics( void)
F_MUTEX hMutex = F_MUTEX_NULL;
IF_Thread * pThreadList[ F_ATOM_TEST_THREADS];
FLMUINT uiStartTime;
FLMUINT uiSlowTime = 0;
FLMUINT uiFastTime = 0;
FLMUINT uiBaseTime = 0;
FLMUINT uiToolkitTime = 0;
FLMUINT uiElapsedTime;
FLMUINT uiLoop;
FLMATOMIC uiTmp;
gv_refCount = 0;
f_memset( pThreadList, 0, sizeof( IF_Thread *) * F_ATOM_TEST_THREADS);
if( RC_BAD( rc = f_mutexCreate( &hMutex)))
@@ -4479,7 +4482,7 @@ RCODE ftkTestAtomics( void)
f_mutexUnlock( hMutex);
}
uiSlowTime = FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
uiBaseTime = FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
uiStartTime = FLM_GET_TIMER();
uiTmp = 0;
@@ -4488,25 +4491,26 @@ RCODE ftkTestAtomics( void)
f_atomicInc( &uiTmp);
}
uiFastTime = FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
uiToolkitTime = FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
f_printf( " Slow time = %u ms, Fast time = %u ms.\n",
(unsigned)FLM_TIMER_UNITS_TO_MILLI( uiSlowTime),
(unsigned)FLM_TIMER_UNITS_TO_MILLI( uiFastTime));
f_printf( "Creating atomic increment threads: ");
f_printf( " Base time = %u ms, FTK time = %u ms.\n",
(unsigned)FLM_TIMER_UNITS_TO_MILLI( uiBaseTime),
(unsigned)FLM_TIMER_UNITS_TO_MILLI( uiToolkitTime));
f_printf( "Running atomic increment test (mutex-based) ... ");
gv_refCount = 0;
uiStartTime = FLM_GET_TIMER();
for( uiLoop = 0; uiLoop < F_ATOM_TEST_THREADS; uiLoop++)
{
if( RC_BAD( rc = f_threadCreate( &pThreadList[ uiLoop],
ftkAtomicIncThread)))
ftkAtomicIncMutexThread, NULL, F_DEFAULT_THREAD_GROUP,
0, (void *)hMutex)))
{
goto Exit;
}
}
f_printf( "%u\n", uiLoop);
for( uiLoop = 0; uiLoop < F_ATOM_TEST_THREADS; uiLoop++)
{
pThreadList[ uiLoop]->waitToComplete();
@@ -4519,7 +4523,41 @@ RCODE ftkTestAtomics( void)
goto Exit;
}
f_printf( "Creating atomic decrement threads: ");
uiElapsedTime = FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
f_printf( "Done. Time = %u\n",
(unsigned)FLM_TIMER_UNITS_TO_MILLI( uiElapsedTime));
f_printf( "Running atomic increment test ... ");
gv_refCount = 0;
uiStartTime = FLM_GET_TIMER();
for( uiLoop = 0; uiLoop < F_ATOM_TEST_THREADS; uiLoop++)
{
if( RC_BAD( rc = f_threadCreate( &pThreadList[ uiLoop],
ftkAtomicIncThread)))
{
goto Exit;
}
}
for( uiLoop = 0; uiLoop < F_ATOM_TEST_THREADS; uiLoop++)
{
pThreadList[ uiLoop]->waitToComplete();
f_threadDestroy( &pThreadList[ uiLoop]);
}
if( gv_refCount != F_ATOM_TEST_THREADS * F_ATOM_TEST_ITERATIONS)
{
rc = RC_SET_AND_ASSERT( NE_FLM_FAILURE);
goto Exit;
}
uiElapsedTime = FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
f_printf( "Done. Time = %u\n",
(unsigned)FLM_TIMER_UNITS_TO_MILLI( uiElapsedTime));
f_printf( "Running atomic decrement test ... ");
uiStartTime = FLM_GET_TIMER();
for( uiLoop = 0; uiLoop < F_ATOM_TEST_THREADS; uiLoop++)
{
@@ -4530,8 +4568,6 @@ RCODE ftkTestAtomics( void)
}
}
f_printf( "%u\n", uiLoop);
for( uiLoop = 0; uiLoop < F_ATOM_TEST_THREADS; uiLoop++)
{
pThreadList[ uiLoop]->waitToComplete();
@@ -4544,7 +4580,13 @@ RCODE ftkTestAtomics( void)
goto Exit;
}
f_printf( "Creating atomic inc/dec threads: ");
uiElapsedTime = FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
f_printf( "Done. Time = %u\n",
(unsigned)FLM_TIMER_UNITS_TO_MILLI( uiElapsedTime));
f_printf( "Running atomic inc/dec test ... ");
gv_refCount = 0;
uiStartTime = FLM_GET_TIMER();
for( uiLoop = 0; uiLoop < F_ATOM_TEST_THREADS; uiLoop++)
{
@@ -4555,8 +4597,6 @@ RCODE ftkTestAtomics( void)
}
}
f_printf( "%u\n", uiLoop);
for( uiLoop = 0; uiLoop < F_ATOM_TEST_THREADS; uiLoop++)
{
pThreadList[ uiLoop]->waitToComplete();
@@ -4569,9 +4609,13 @@ RCODE ftkTestAtomics( void)
goto Exit;
}
uiElapsedTime = FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
f_printf( "Done. Time = %u\n",
(unsigned)FLM_TIMER_UNITS_TO_MILLI( uiElapsedTime));
f_printf( "Running atomic exchange test ... ");
gv_spinLock = 0;
f_printf( "Creating atomic exchange threads: ");
uiStartTime = FLM_GET_TIMER();
for( uiLoop = 0; uiLoop < F_ATOM_TEST_THREADS; uiLoop++)
{
@@ -4582,8 +4626,6 @@ RCODE ftkTestAtomics( void)
}
}
f_printf( "%u\n", uiLoop);
for( uiLoop = 0; uiLoop < F_ATOM_TEST_THREADS; uiLoop++)
{
pThreadList[ uiLoop]->waitToComplete();
@@ -4596,6 +4638,10 @@ RCODE ftkTestAtomics( void)
goto Exit;
}
uiElapsedTime = FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
f_printf( "Done. Time = %u\n",
(unsigned)FLM_TIMER_UNITS_TO_MILLI( uiElapsedTime));
Exit:
for( uiLoop = 0; uiLoop < F_ATOM_TEST_THREADS; uiLoop++)
@@ -4636,6 +4682,30 @@ FSTATIC RCODE FLMAPI ftkAtomicIncThread(
return( NE_FLM_OK);
}
/****************************************************************************
Desc:
****************************************************************************/
FSTATIC RCODE FLMAPI ftkAtomicIncMutexThread(
IF_Thread * pThread)
{
FLMUINT uiLoop;
F_MUTEX hMutex = (F_MUTEX)pThread->getParm1();
for( uiLoop = 0; uiLoop < F_ATOM_TEST_ITERATIONS; uiLoop++)
{
f_mutexLock( hMutex);
gv_refCount++;
f_mutexUnlock( hMutex);
if( (uiLoop % 128) == 0)
{
f_yieldCPU();
}
}
return( NE_FLM_OK);
}
/****************************************************************************
Desc:
****************************************************************************/
@@ -4722,22 +4792,22 @@ Desc:
FSTATIC RCODE ftkFastChecksumTest( void)
{
RCODE rc = NE_FLM_OK;
FLMUINT uiSlowAdds = 0;
FLMUINT uiSlowXORs = 0;
FLMUINT uiFastAdds = 0;
FLMUINT uiFastXORs = 0;
FLMUINT uiBaseAdds = 0;
FLMUINT uiBaseXORs = 0;
FLMUINT uiToolkitAdds = 0;
FLMUINT uiToolkitXORs = 0;
FLMUINT uiDataLength;
FLMBYTE * pucData = NULL;
FLMBYTE * pucCur;
FLMBYTE * pucEnd;
FLMUINT uiSlowChecksum = 0;
FLMUINT uiFastChecksum = 0;
FLMUINT uiBaseChecksum = 0;
FLMUINT uiToolkitChecksum = 0;
FLMUINT uiLoop;
FLMUINT uiIter;
FLMUINT uiPass;
FLMUINT uiStartTime;
FLMUINT uiSlowTime = 0;
FLMUINT uiFastTime = 0;
FLMUINT uiBaseTime = 0;
FLMUINT uiToolkitTime = 0;
f_printf( "Running checksum tests ");
@@ -4758,40 +4828,40 @@ FSTATIC RCODE ftkFastChecksumTest( void)
for( uiPass = 0; uiPass < 100; uiPass++)
{
uiSlowAdds = 0;
uiSlowXORs = 0;
uiBaseAdds = 0;
uiBaseXORs = 0;
pucCur = pucData;
pucEnd = pucData + uiDataLength;
while( pucCur < pucEnd)
{
uiSlowAdds += *pucCur;
uiSlowXORs ^= *pucCur++;
uiBaseAdds += *pucCur;
uiBaseXORs ^= *pucCur++;
}
uiSlowAdds &= 0xFF;
uiSlowChecksum = (FLMUINT32)((uiSlowAdds << 16) + uiSlowXORs);
uiBaseAdds &= 0xFF;
uiBaseChecksum = (FLMUINT32)((uiBaseAdds << 16) + uiBaseXORs);
}
uiSlowTime += FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
uiBaseTime += FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
uiStartTime = FLM_GET_TIMER();
for( uiPass = 0; uiPass < 100; uiPass++)
{
uiFastAdds = 0;
uiFastXORs = 0;
uiToolkitAdds = 0;
uiToolkitXORs = 0;
uiFastChecksum = f_calcFastChecksum( pucData,
uiDataLength, &uiFastAdds, &uiFastXORs);
uiToolkitChecksum = f_calcFastChecksum( pucData,
uiDataLength, &uiToolkitAdds, &uiToolkitXORs);
}
uiFastTime += FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
uiToolkitTime += FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
if( (uiSlowAdds != uiFastAdds) ||
(uiSlowXORs != uiFastXORs) ||
(uiSlowChecksum != uiFastChecksum))
if( (uiBaseAdds != uiToolkitAdds) ||
(uiBaseXORs != uiToolkitXORs) ||
(uiBaseChecksum != uiToolkitChecksum))
{
rc = RC_SET_AND_ASSERT( NE_FLM_FAILURE);
goto Exit;
@@ -4803,9 +4873,9 @@ FSTATIC RCODE ftkFastChecksumTest( void)
}
}
f_printf( " Slow time = %u ms, Fast time = %u ms. ",
(unsigned)FLM_TIMER_UNITS_TO_MILLI( uiSlowTime),
(unsigned)FLM_TIMER_UNITS_TO_MILLI( uiFastTime));
f_printf( " Base time = %u ms, FTK time = %u ms. ",
(unsigned)FLM_TIMER_UNITS_TO_MILLI( uiBaseTime),
(unsigned)FLM_TIMER_UNITS_TO_MILLI( uiToolkitTime));
Exit:
@@ -4828,14 +4898,14 @@ FSTATIC RCODE ftkPacketChecksumTest(
RCODE rc = NE_FLM_OK;
FLMBYTE * pucBuffer = NULL;
FLMBYTE * pucData;
FLMUINT uiSlowChecksum = 0;
FLMUINT uiFastChecksum = 0;
FLMUINT uiBaseChecksum = 0;
FLMUINT uiToolkitChecksum = 0;
FLMUINT uiLoop;
FLMUINT uiIter;
FLMUINT uiPass;
FLMUINT uiStartTime;
FLMUINT uiSlowTime = 0;
FLMUINT uiFastTime = 0;
FLMUINT uiBaseTime = 0;
FLMUINT uiToolkitTime = 0;
FLMUINT uiAlignDelta;
#ifdef FLM_64BIT
@@ -4866,18 +4936,18 @@ FSTATIC RCODE ftkPacketChecksumTest(
uiStartTime = FLM_GET_TIMER();
for( uiPass = 0; uiPass < 100; uiPass++)
{
uiSlowChecksum = ftkSlowPacketChecksum( pucData, uiPacketSize);
uiBaseChecksum = ftkSlowPacketChecksum( pucData, uiPacketSize);
}
uiSlowTime += FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
uiBaseTime += FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
uiStartTime = FLM_GET_TIMER();
for( uiPass = 0; uiPass < 100; uiPass++)
{
uiFastChecksum = f_calcPacketChecksum( pucData, uiPacketSize);
uiToolkitChecksum = f_calcPacketChecksum( pucData, uiPacketSize);
}
uiFastTime += FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
uiToolkitTime += FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
if( uiSlowChecksum != uiFastChecksum)
if( uiBaseChecksum != uiToolkitChecksum)
{
rc = RC_SET_AND_ASSERT( NE_FLM_FAILURE);
goto Exit;
@@ -4887,9 +4957,9 @@ FSTATIC RCODE ftkPacketChecksumTest(
f_printf( ".");
}
f_printf( " Slow time = %u ms, Fast time = %u ms. ",
(unsigned)FLM_TIMER_UNITS_TO_MILLI( uiSlowTime),
(unsigned)FLM_TIMER_UNITS_TO_MILLI( uiFastTime));
f_printf( " Base time = %u ms, FTK time = %u ms. ",
(unsigned)FLM_TIMER_UNITS_TO_MILLI( uiBaseTime),
(unsigned)FLM_TIMER_UNITS_TO_MILLI( uiToolkitTime));
Exit:
@@ -5002,8 +5072,8 @@ RCODE ftkTestText( void)
FLMUINT uiLoop;
FLMUINT uiSubloop;
FLMUINT uiStartTime;
FLMUINT uiSlowTime;
FLMUINT uiFastTime;
FLMUINT uiBaseTime;
FLMUINT uiToolkitTime;
FLMUINT16 ui16WpChar;
FLMUINT16 ui16BaseChar;
FLMUINT16 ui16BaseChar2;
@@ -5065,7 +5135,7 @@ RCODE ftkTestText( void)
}
}
uiSlowTime = FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
uiBaseTime = FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
uiStartTime = FLM_GET_TIMER();
for( uiLoop = 0; uiLoop < 100; uiLoop++)
@@ -5076,10 +5146,10 @@ RCODE ftkTestText( void)
}
}
uiFastTime = FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
uiToolkitTime = FLM_ELAPSED_TIME( FLM_GET_TIMER(), uiStartTime);
f_printf( "Slow time = %u, Fast time = %u. Done.\n",
(unsigned)uiSlowTime, (unsigned)uiFastTime);
f_printf( "Base time = %u, FTK time = %u. Done.\n",
(unsigned)uiBaseTime, (unsigned)uiToolkitTime);
f_printf( "Running Zenkaku to Hankaku conversion tests ... ");