orcx86: use HAVE_AMD64 and HAVE_I386 defines everywhere
authorJan Schmidt <jan@centricular.com>
Fri, 28 Oct 2016 12:37:51 +0000 (23:37 +1100)
committerJan Schmidt <jan@centricular.com>
Fri, 28 Oct 2016 12:38:46 +0000 (23:38 +1100)
Some places were checking for __amd64__ and __i386__ explicitly,
but MSVC doesn't define __amd64__ in 64-bit mode, so use the
define from config.h instead. Fixes incorrect asm generation
on 64-bit Windows

orc/orccpu-x86.c
orc/orcprogram-mmx.c
orc/orcprogram-sse.c

index f55b2c5..f5620b0 100644 (file)
@@ -88,14 +88,14 @@ get_cpuid_ecx (orc_uint32 op, orc_uint32 init_ecx, orc_uint32 *a, orc_uint32 *b,
 {
   *a = op;
   *c = init_ecx;
-#ifdef __i386__
+#if defined(HAVE_I386)
   __asm__ (
       "  pushl %%ebx\n"
       "  cpuid\n"
       "  mov %%ebx, %%esi\n"
       "  popl %%ebx\n"
       : "+a" (*a), "=S" (*b), "+c" (*c), "=d" (*d));
-#elif defined(__amd64__)
+#elif defined(HAVE_AMD64)
   __asm__ (
       "  cpuid\n"
       : "+a" (*a), "=b" (*b), "+c" (*c), "=d" (*d));
index 50169ef..a4f3f8e 100644 (file)
@@ -88,7 +88,7 @@ orc_compiler_mmx_get_default_flags (void)
 {
   unsigned int flags = 0;
 
-#ifdef __amd64__
+#if defined (HAVE_AMD64)
   flags |= ORC_TARGET_MMX_64BIT;
 #endif
   if (_orc_compiler_flag_debug) {
index 51c1536..0f27b9a 100644 (file)
@@ -88,7 +88,7 @@ orc_compiler_sse_get_default_flags (void)
 {
   unsigned int flags = 0;
 
-#ifdef __amd64__
+#if defined(HAVE_AMD64)
   flags |= ORC_TARGET_SSE_64BIT;
 #endif
   if (_orc_compiler_flag_debug) {