/[pcre]/code/trunk/sljit/sljitNativeX86_common.c
ViewVC logotype

Diff of /code/trunk/sljit/sljitNativeX86_common.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1221 by zherczeg, Fri Nov 9 08:13:13 2012 UTC revision 1222 by zherczeg, Mon Nov 19 08:04:03 2012 UTC
# Line 268  static sljit_si cpu_has_sse2 = -1; Line 268  static sljit_si cpu_has_sse2 = -1;
268  static sljit_si cpu_has_cmov = -1;  static sljit_si cpu_has_cmov = -1;
269    
270  #if defined(_MSC_VER) && (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)  #if defined(_MSC_VER) && (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
271    #if _MSC_VER >= 1400
272  #include <intrin.h>  #include <intrin.h>
273    #else
274    #error "MSVC does not support inline assembly in 64 bit mode"
275  #endif  #endif
276    #endif /* _MSC_VER && SLJIT_CONFIG_X86_64 */
277    
278  static void get_cpu_features(void)  static void get_cpu_features(void)
279  {  {
# Line 277  static void get_cpu_features(void) Line 281  static void get_cpu_features(void)
281    
282  #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)  #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
283    
284  #if defined(__GNUC__) || defined(__SUNPRO_C)  #if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__SUNPRO_C)
285          /* AT&T syntax. */          /* AT&T syntax. */
286          asm (          __asm__ (
287                  "pushl %%ebx\n"                  "pushl %%ebx\n"
288                  "movl $0x1, %%eax\n"                  "movl $0x1, %%eax\n"
289                  "cpuid\n"                  "cpuid\n"
# Line 304  static void get_cpu_features(void) Line 308  static void get_cpu_features(void)
308    
309  #else /* SLJIT_CONFIG_X86_32 */  #else /* SLJIT_CONFIG_X86_32 */
310    
311  #if defined(__GNUC__) || defined(__SUNPRO_C)  #if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__SUNPRO_C)
312          /* AT&T syntax. */          /* AT&T syntax. */
313          asm (          __asm__ (
314                  "pushq %%rbx\n"                  "pushq %%rbx\n"
315                  "movl $0x1, %%eax\n"                  "movl $0x1, %%eax\n"
316                  "cpuid\n"                  "cpuid\n"
# Line 316  static void get_cpu_features(void) Line 320  static void get_cpu_features(void)
320                  :                  :
321                  : "%rax", "%rcx", "%rdx"                  : "%rax", "%rcx", "%rdx"
322          );          );
323  #elif defined(_MSC_VER)  #elif defined(_MSC_VER) && _MSC_VER >= 1400
324          int CPUInfo[4];          int CPUInfo[4];
325    
326          __cpuid(CPUInfo, 1);          __cpuid(CPUInfo, 1);
327          features = (sljit_ui)CPUInfo[3];          features = (sljit_ui)CPUInfo[3];
328  #else  #else
329  #       error "SLJIT_DETECT_SSE2 is not implemented for this C compiler"          __asm {
330                    mov eax, 1
331                    push rbx
332                    cpuid
333                    pop rbx
334                    mov features, edx
335            }
336  #endif  #endif
337    
338  #endif /* SLJIT_CONFIG_X86_32 */  #endif /* SLJIT_CONFIG_X86_32 */
# Line 2554  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_ Line 2564  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_
2564                  }                  }
2565                  if (src == SLJIT_MEM1(SLJIT_LOCALS_REG) && type >= SLJIT_CALL3)                  if (src == SLJIT_MEM1(SLJIT_LOCALS_REG) && type >= SLJIT_CALL3)
2566                          srcw += sizeof(sljit_sw);                          srcw += sizeof(sljit_sw);
 #else  
                 if (src == SLJIT_MEM1(SLJIT_LOCALS_REG))  
                         srcw += sizeof(sljit_sw) * (type - SLJIT_CALL0);  
2567  #endif  #endif
2568  #endif  #endif
2569  #if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) && defined(_WIN64)  #if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) && defined(_WIN64)

Legend:
Removed from v.1221  
changed lines
  Added in v.1222

  ViewVC Help
Powered by ViewVC 1.1.5