New ACC version.
committer: mfx <mfx> 1089731989 +0000
This commit is contained in:
+4
-1
@@ -27,7 +27,7 @@
|
|||||||
#ifndef __ACC_H_INCLUDED
|
#ifndef __ACC_H_INCLUDED
|
||||||
#define __ACC_H_INCLUDED 1
|
#define __ACC_H_INCLUDED 1
|
||||||
|
|
||||||
#define ACC_VERSION 20040712L
|
#define ACC_VERSION 20040713L
|
||||||
|
|
||||||
#if !defined(ACC_CONFIG_INCLUDE)
|
#if !defined(ACC_CONFIG_INCLUDE)
|
||||||
# define ACC_CONFIG_INCLUDE(file) file
|
# define ACC_CONFIG_INCLUDE(file) file
|
||||||
@@ -44,6 +44,9 @@
|
|||||||
# define __INTEL_COMPILER __ICL
|
# define __INTEL_COMPILER __ICL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE)
|
||||||
|
# define _ALL_SOURCE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* disable pedantic warnings for undefined preprocessing symbols */
|
/* disable pedantic warnings for undefined preprocessing symbols */
|
||||||
#if defined(__INTEL_COMPILER) && defined(__linux__)
|
#if defined(__INTEL_COMPILER) && defined(__linux__)
|
||||||
|
|||||||
+5
-2
@@ -92,7 +92,7 @@
|
|||||||
# define HAVE_STRINGS_H 1
|
# define HAVE_STRINGS_H 1
|
||||||
# if (ACC_OS_POSIX_FREEBSD || ACC_OS_POSIX_MACOSX || ACC_OS_POSIX_OPENBSD)
|
# if (ACC_OS_POSIX_FREEBSD || ACC_OS_POSIX_MACOSX || ACC_OS_POSIX_OPENBSD)
|
||||||
# undef HAVE_MALLOC_H /* deprecated */
|
# undef HAVE_MALLOC_H /* deprecated */
|
||||||
# elif (ACC_OS_POSIX_HPUX)
|
# elif (ACC_OS_POSIX_HPUX || ACC_OS_POSIX_INTERIX)
|
||||||
# define HAVE_ALLOCA_H 1
|
# define HAVE_ALLOCA_H 1
|
||||||
# endif
|
# endif
|
||||||
# if (ACC_OS_POSIX_MACOSX && ACC_CC_MWERKS) && defined(__MSL__)
|
# if (ACC_OS_POSIX_MACOSX && ACC_CC_MWERKS) && defined(__MSL__)
|
||||||
@@ -599,6 +599,9 @@
|
|||||||
#elif (ACC_CC_GNUC)
|
#elif (ACC_CC_GNUC)
|
||||||
# define SIZEOF_LONG_LONG 8
|
# define SIZEOF_LONG_LONG 8
|
||||||
# define SIZEOF_UNSIGNED_LONG_LONG 8
|
# define SIZEOF_UNSIGNED_LONG_LONG 8
|
||||||
|
#elif ((ACC_OS_WIN32 || ACC_OS_WIN64) && ACC_CC_MSC && (_MSC_VER >= 1400))
|
||||||
|
# define SIZEOF_LONG_LONG 8
|
||||||
|
# define SIZEOF_UNSIGNED_LONG_LONG 8
|
||||||
#elif (ACC_OS_WIN64)
|
#elif (ACC_OS_WIN64)
|
||||||
# define SIZEOF___INT64 8
|
# define SIZEOF___INT64 8
|
||||||
# define SIZEOF_UNSIGNED___INT64 8
|
# define SIZEOF_UNSIGNED___INT64 8
|
||||||
@@ -627,7 +630,7 @@
|
|||||||
#elif (ACC_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64))
|
#elif (ACC_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64))
|
||||||
# define SIZEOF___INT64 8
|
# define SIZEOF___INT64 8
|
||||||
# define SIZEOF_UNSIGNED___INT64 8
|
# define SIZEOF_UNSIGNED___INT64 8
|
||||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
||||||
# define SIZEOF_LONG_LONG 8
|
# define SIZEOF_LONG_LONG 8
|
||||||
# define SIZEOF_UNSIGNED_LONG_LONG 8
|
# define SIZEOF_UNSIGNED_LONG_LONG 8
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -71,7 +71,7 @@
|
|||||||
# define ACC_UNUSED_FUNC(func) ((void) (void (*)(void)) func)
|
# define ACC_UNUSED_FUNC(func) ((void) (void (*)(void)) func)
|
||||||
# elif (ACC_CC_MSC && (_MSC_VER < 900))
|
# elif (ACC_CC_MSC && (_MSC_VER < 900))
|
||||||
# define ACC_UNUSED_FUNC(func) if (func) ; else
|
# define ACC_UNUSED_FUNC(func) if (func) ; else
|
||||||
# elif (ACC_CC_MSC && (_MSC_VER >= 1400))
|
# elif (ACC_CC_MSC && (_MSC_VER >= 1200))
|
||||||
# define ACC_UNUSED_FUNC(func) ((void) (void (*)(void)) func)
|
# define ACC_UNUSED_FUNC(func) ((void) (void (*)(void)) func)
|
||||||
# elif (ACC_CC_KEILC)
|
# elif (ACC_CC_KEILC)
|
||||||
# define ACC_UNUSED_FUNC(func)
|
# define ACC_UNUSED_FUNC(func)
|
||||||
|
|||||||
@@ -141,6 +141,9 @@
|
|||||||
# elif defined(__hpux__) || defined(__hpux)
|
# elif defined(__hpux__) || defined(__hpux)
|
||||||
# define ACC_OS_POSIX_HPUX 1
|
# define ACC_OS_POSIX_HPUX 1
|
||||||
# define ACC_INFO_OS_POSIX "hpux"
|
# define ACC_INFO_OS_POSIX "hpux"
|
||||||
|
# elif defined(__INTERIX)
|
||||||
|
# define ACC_OS_POSIX_INTERIX 1
|
||||||
|
# define ACC_INFO_OS_POSIX "interix"
|
||||||
# elif defined(__IRIX__) || defined(__irix__)
|
# elif defined(__IRIX__) || defined(__irix__)
|
||||||
# define ACC_OS_POSIX_IRIX 1
|
# define ACC_OS_POSIX_IRIX 1
|
||||||
# define ACC_INFO_OS_POSIX "irix"
|
# define ACC_INFO_OS_POSIX "irix"
|
||||||
|
|||||||
+17
-28
@@ -21,31 +21,31 @@
|
|||||||
#if defined(acc_int32e_t)
|
#if defined(acc_int32e_t)
|
||||||
|
|
||||||
|
|
||||||
|
#if ((ACC_ARCH_AMD64 || ACC_ARCH_IA32) && ACC_CC_GNUC)
|
||||||
|
# if (ACC_CC_GNUC >= 0x020000ul)
|
||||||
|
# define __ACCLIB_RDTSC_REGS : : "r" (t) : "cc", "memory", "eax", "edx"
|
||||||
|
# else
|
||||||
|
# define __ACCLIB_RDTSC_REGS : : "r" (t) : "ax", "dx"
|
||||||
|
# endif
|
||||||
|
#elif (ACC_ARCH_IA32 && ACC_CC_INTELC) && defined(__linux__)
|
||||||
|
# define __ACCLIB_RDTSC_REGS : : "r" (t) : "memory", "eax", "edx"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
// read TSC
|
// read TSC
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_tsc_read) (acc_uint32e_t* t)
|
ACCLIB_PUBLIC(int, acc_tsc_read) (acc_uint32e_t* t)
|
||||||
{
|
{
|
||||||
#if ((ACC_ARCH_AMD64 || ACC_ARCH_IA32) && ACC_CC_GNUC)
|
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32) && defined(__ACCLIB_RDTSC_REGS)
|
||||||
__asm__ __volatile__(
|
__asm__ __volatile__(
|
||||||
"clc \n" ".byte 0x0f, 0x31\n"
|
"clc \n" ".byte 0x0f, 0x31\n"
|
||||||
"movl %%eax,(%0)\n" "movl %%edx,4(%0)\n"
|
"movl %%eax,(%0)\n" "movl %%edx,4(%0)\n"
|
||||||
# if (ACC_CC_GNUC >= 0x020000ul)
|
__ACCLIB_RDTSC_REGS
|
||||||
: : "r" (t) : "cc", "memory", "eax", "edx"
|
|
||||||
# else
|
|
||||||
: : "r" (t) : "ax", "dx"
|
|
||||||
# endif
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
#elif (ACC_ARCH_IA32 && ACC_CC_INTELC) && defined(__linux__)
|
#elif (ACC_ARCH_IA32 && (ACC_OS_DOS32 || ACC_OS_WIN32) && (ACC_CC_DMC || ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC))
|
||||||
__asm__ __volatile__(
|
|
||||||
"clc \n" ".byte 0x0f, 0x31\n"
|
|
||||||
"movl %%eax,(%0)\n" "movl %%edx,4(%0)\n"
|
|
||||||
: : "r" (t) : "memory", "eax", "edx"
|
|
||||||
);
|
|
||||||
return 0;
|
|
||||||
#elif (ACC_ARCH_IA32 && (ACC_OS_DOS32 || ACC_OS_WIN32) && (ACC_CC_DMC || ACC_CC_INTELC || ACC_CC_MSC))
|
|
||||||
ACC_UNUSED(t);
|
ACC_UNUSED(t);
|
||||||
__asm {
|
__asm {
|
||||||
mov ecx, t
|
mov ecx, t
|
||||||
@@ -73,25 +73,14 @@ ACCLIB_PUBLIC(int, acc_tsc_read) (acc_uint32e_t* t)
|
|||||||
|
|
||||||
ACCLIB_PUBLIC(int, acc_tsc_read_add) (acc_uint32e_t* t)
|
ACCLIB_PUBLIC(int, acc_tsc_read_add) (acc_uint32e_t* t)
|
||||||
{
|
{
|
||||||
#if ((ACC_ARCH_AMD64 || ACC_ARCH_IA32) && ACC_CC_GNUC)
|
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32) && defined(__ACCLIB_RDTSC_REGS)
|
||||||
__asm__ __volatile__(
|
__asm__ __volatile__(
|
||||||
"clc \n" ".byte 0x0f, 0x31\n"
|
"clc \n" ".byte 0x0f, 0x31\n"
|
||||||
"addl %%eax,(%0)\n" "adcl $0,%%edx\n" "addl %%edx,4(%0)\n"
|
"addl %%eax,(%0)\n" "adcl $0,%%edx\n" "addl %%edx,4(%0)\n"
|
||||||
# if (ACC_CC_GNUC >= 0x020000ul)
|
__ACCLIB_RDTSC_REGS
|
||||||
: : "r" (t) : "cc", "memory", "eax", "edx"
|
|
||||||
# else
|
|
||||||
: : "r" (t) : "ax", "dx"
|
|
||||||
# endif
|
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
#elif (ACC_ARCH_IA32 && ACC_CC_INTELC) && defined(__linux__)
|
#elif (ACC_ARCH_IA32 && (ACC_OS_DOS32 || ACC_OS_WIN32) && (ACC_CC_DMC || ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC))
|
||||||
__asm__ __volatile__(
|
|
||||||
"clc \n" ".byte 0x0f, 0x31\n"
|
|
||||||
"addl %%eax,(%0)\n" "adcl $0,%%edx\n" "addl %%edx,4(%0)\n"
|
|
||||||
: : "r" (t) : "memory", "eax", "edx"
|
|
||||||
);
|
|
||||||
return 0;
|
|
||||||
#elif (ACC_ARCH_IA32 && (ACC_OS_DOS32 || ACC_OS_WIN32) && (ACC_CC_DMC || ACC_CC_INTELC || ACC_CC_MSC))
|
|
||||||
ACC_UNUSED(t);
|
ACC_UNUSED(t);
|
||||||
__asm {
|
__asm {
|
||||||
mov ecx, t
|
mov ecx, t
|
||||||
|
|||||||
Reference in New Issue
Block a user