Re: [pcre-dev] [PATCH] JIT support with Intel compiler, olde…

Page principale
Supprimer ce message
Auteur: Zoltán Herczeg
Date:  
À: danielg
CC: Daniel Richard G., pcre-dev
Sujet: Re: [pcre-dev] [PATCH] JIT support with Intel compiler, older Solaris
Hi Daniel,

Could you split the patch into two:

1) Older solaris support

I think an #if based soultion could work here:

#if defined(old_solaris)
asm for old solaris
#else
original code
#endif

Or it would be even better, if you could find a system call for cache flush, and get rid the assembly code in the old solaris case. This may be supported there:

http://man-wiki.net/index.php/2:cacheflush

(The typos could be added to this patch, it should be the smaller)

2) Intel C compiler

The cpuid on 64 bit should be look like this:

#if defined (__MSC_VER)
#if _MSC_VER >= 1400
__cpuid();
#else
#error An implementation of CPUID is required.
#endif
#elif GCC, IntelC etc.
AT&T syntax with __asm__
#endif

The ABI is the Application Binary Interface. It tells how a binary function calls another. Which registers are saved, which are not, how the arguments are passed (these are called calling conventions).

On x86/32 many calling conventions are used. stdcall, ccall, fastcall. SLJIT supports two types: the stdcall and the GCC style fastcall (when SLJIT_X86_32_FASTCALL is defined), which is also used by msvc. E.g. borland C compiler uses another type of fastcall, but it supports MS style fast calls, so SLJIT_CALL is defined as __msfastcall, and SLJIT_X86_32_FASTCALL is defined as 1. (Fast call is usually faster than standard call, since it passes the first two arguments in ecx:edx). Thus, getting rid of __stdcall just cause crashes. You need to find which calling types are supported by ICC, and use either the standard or the GCC style fastcall type.

Regards,
Zoltan