From 41d5c6157bbe2cda24d1c23b1e7fa84b408214f5 Mon Sep 17 00:00:00 2001 From: "Clifford T. Matthews" Date: Mon, 8 Jun 2009 20:07:17 -0600 Subject: [PATCH] x86_64 runs now, although so far only with optimization flags lowered by hand. --- include/syn68k_private.h.in | 3 ++- runtime/backpatch.c | 4 +++- runtime/init.c | 4 +++- runtime/syn68k_header.c | 4 +++- syngen/generatecode.c | 5 +++-- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/include/syn68k_private.h.in b/include/syn68k_private.h.in index 82d28be..318f36b 100644 --- a/include/syn68k_private.h.in +++ b/include/syn68k_private.h.in @@ -275,7 +275,8 @@ static uint32 _writeul_unswapped(uint16 *p, uint32 tmp) | ((cpu_state.ccx != 0) << 4)) -#if !defined(__alpha) +/* #if !defined(__alpha) */ +#if SIZEOF_CHAR_P != 8 #define DEREF(typ, addr) (*(typ *)addr) #else diff --git a/runtime/backpatch.c b/runtime/backpatch.c index 8a5e01b..2c40975 100644 --- a/runtime/backpatch.c +++ b/runtime/backpatch.c @@ -1,3 +1,5 @@ +#include "config.h" + #include "syn68k_private.h" #include "backpatch.h" #include "alloc.h" @@ -57,7 +59,7 @@ backpatch_apply_and_free (Block *b, backpatch_t *p) *(uint16 *)((char *)b->compiled_code + first_byte) = value; else if (length == 8) *(uint8 *)((char *)b->compiled_code + first_byte) = value; -#if defined (__alpha) +#if SIZEOF_CHAR_P == 8 else if (length == 64) *(uint64 *)((char *)b->compiled_code + first_byte) = value; #endif diff --git a/runtime/init.c b/runtime/init.c index 60aee8e..a735fa8 100644 --- a/runtime/init.c +++ b/runtime/init.c @@ -1,3 +1,5 @@ +#include "config.h" + #include "syn68k_private.h" #include "hash.h" #include "rangetree.h" @@ -103,7 +105,7 @@ initialize_68k_emulator (void (*while_busy)(int), int native_p, /* Create the magical block that contains an RTE. */ b = NULL; -#if !defined (__alpha) +#if SIZEOF_CHAR_P != 8 generate_block (NULL, US_TO_SYN68K (&rte), &b, TRUE); #else { diff --git a/runtime/syn68k_header.c b/runtime/syn68k_header.c index b6a6bd9..9533d8c 100644 --- a/runtime/syn68k_header.c +++ b/runtime/syn68k_header.c @@ -1,3 +1,5 @@ +#include "config.h" + /* Global register to hold the PC. We put this up here so that * the global register will be defined before any of the inline functions * in syn68k_public.h are hit, but after uint16 is typedef'd. @@ -690,7 +692,7 @@ interpret_code (const uint16 *start_code) * endian order. Since we know we're at the beginning of * a block, we can check for the interrupt here. */ -#if !defined (__alpha) /* FIXME -- TODO -- just use __alpha case for everyone */ +#if SIZEOF_CHAR_P != 8 syn68k_addr_t addr = READUL (US_TO_SYN68K (code - PTR_WORDS - PTR_WORDS)); #else syn68k_addr_t addr = READUL_US (code - PTR_WORDS - PTR_WORDS); diff --git a/syngen/generatecode.c b/syngen/generatecode.c index 12cfad4..6524619 100644 --- a/syngen/generatecode.c +++ b/syngen/generatecode.c @@ -138,7 +138,8 @@ generate_c_code (const ParsedOpcodeInfo *info, const CCVariant *var, else /* If we end a block, profile the next block. */ { -#if !defined (__alpha) /* FIXME -- TODO -- just use __alpha case for everyone */ +/* #if !defined (__alpha) /* FIXME -- TODO -- just use __alpha case for everyone */ +#if SIZEOF_CHAR_P != 8 fputs ("\n#ifdef PROFILE\n" " profile_block (hash_lookup " "(READUL (US_TO_SYN68K (code) - 4)));\n" @@ -154,7 +155,7 @@ generate_c_code (const ParsedOpcodeInfo *info, const CCVariant *var, #if defined (SYNCHRONOUS_INTERRUPTS) && !defined (GENERATE_NATIVE_CODE) fprintf (syn68k_c_stream, -"#if !defined (__alpha) /* FIXME -- TODO -- just use __alpha case for everyone */\n" +"#if SIZEOF_CHAR_P != 8\n" " CHECK_FOR_INTERRUPT (READUL (US_TO_SYN68K (code - PTR_WORDS)));\n" "#else\n" " CHECK_FOR_INTERRUPT (READUL_US (code - PTR_WORDS));\n"