2009-03-18 00:49 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbatomic.h
+ added atomic inc/dec inline assembler code for 32bit MSVC builds
and probably also to other compilers which defines _MSC_VER
macro (XCC/POCC). Thanks to Viktor for help. Please make some tests.
* harbour/source/compiler/hbopt.c
! disabled one assert() in PCODE optimization code.
Mindaugas, I left note which explains why.
This commit is contained in:
@@ -8,6 +8,16 @@
|
||||
2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
|
||||
*/
|
||||
|
||||
2009-03-18 00:49 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/include/hbatomic.h
|
||||
+ added atomic inc/dec inline assembler code for 32bit MSVC builds
|
||||
and probably also to other compilers which defines _MSC_VER
|
||||
macro (XCC/POCC). Thanks to Viktor for help. Please make some tests.
|
||||
|
||||
* harbour/source/compiler/hbopt.c
|
||||
! disabled one assert() in PCODE optimization code.
|
||||
Mindaugas, I left note which explains why.
|
||||
|
||||
2009-03-18 00:31 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
|
||||
* config/rules.cf
|
||||
+ Added -ko optimization switch for Harbour.
|
||||
|
||||
@@ -258,7 +258,43 @@ HB_EXTERN_BEGIN
|
||||
|
||||
# endif /* ???CPU?? */
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
#elif defined( _MSC_VER )
|
||||
|
||||
# if defined( i386 ) || defined( __i386__ ) || defined( __x86_64__ ) || \
|
||||
defined( _M_IX86 ) || defined( _M_AMD64 )
|
||||
|
||||
# if HB_COUNTER_SIZE == 4
|
||||
|
||||
static __inline void hb_atomic_inc32( volatile int * p )
|
||||
{
|
||||
__asm lock inc p
|
||||
}
|
||||
|
||||
static __inline__ int hb_atomic_dec32( volatile int * p )
|
||||
{
|
||||
unsigned char c;
|
||||
|
||||
__asm xor eax, eax
|
||||
__asm lock dec p
|
||||
__asm setne c
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
# define HB_ATOM_INC( p ) ( hb_atomic_inc32( ( volatile int * ) (p) ) )
|
||||
# define HB_ATOM_DEC( p ) ( hb_atomic_dec32( ( volatile int * ) (p) ) )
|
||||
# define HB_ATOM_GET( p ) (*(int volatile *)(p))
|
||||
# define HB_ATOM_SET( p, n ) do { *((int volatile *)(p)) = (n); } while(0)
|
||||
|
||||
# elif HB_COUNTER_SIZE == 8
|
||||
|
||||
/* TODO: */
|
||||
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
#endif /* ??? C compiler ??? */
|
||||
|
||||
|
||||
#if defined( HB_OS_WIN )
|
||||
|
||||
@@ -1219,6 +1219,7 @@ static void hb_compPCodeEnumSelfifyLocal( PFUNCTION pFunc, SHORT isLocal )
|
||||
{
|
||||
assert( ulPos > 0 && pFunc->pCode[ ulLastPos ] == HB_P_PUSHSELF &&
|
||||
! hb_compHasJump( pFunc, ulPos ) );
|
||||
|
||||
hb_compNOOPfill( pFunc, ulLastPos, 1, FALSE, FALSE );
|
||||
hb_compNOOPfill( pFunc, ulPos, 2, FALSE, FALSE );
|
||||
}
|
||||
@@ -1576,8 +1577,21 @@ void hb_compPCodeTraceOptimizer( HB_COMP_DECL )
|
||||
while( pVar )
|
||||
{
|
||||
/* Compiler and optimizer should have the same opinion about variable usage */
|
||||
/* I hope that it will in the future but now compiler does not detect some
|
||||
* dead code before marking variables as used so this conditions fails in
|
||||
* code like:
|
||||
* proc main()
|
||||
* local x
|
||||
* if .f.
|
||||
* x := 1
|
||||
* endif
|
||||
* return
|
||||
* [druzus]
|
||||
*/
|
||||
#if 0
|
||||
assert( ( ! ( pVar->iUsed & VU_USED ) && pLocals[ usIndex ].bFlags == 0 ) ||
|
||||
( ( pVar->iUsed & VU_USED ) && pLocals[ usIndex ].bFlags != 0 ) );
|
||||
#endif
|
||||
|
||||
if( usIndex >= pFunc->wParamCount && pLocals[ usIndex ].bFlags == OPT_LOCAL_FLAG_PUSH )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user