X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FnativeGen%2FNCG.h;h=b17f682e719cb201d4fb74a4180f36167d1c7378;hb=8f8d1ebf5f37c1b51f8d48cd1343a226d9769912;hp=d02415f0fd8e48d6a0f234505e4941cf9ed6f3c5;hpb=1fb1ab5d53a09607e7f6d2450806760688396387;p=ghc-hetmet.git diff --git a/ghc/compiler/nativeGen/NCG.h b/ghc/compiler/nativeGen/NCG.h index d02415f..b17f682 100644 --- a/ghc/compiler/nativeGen/NCG.h +++ b/ghc/compiler/nativeGen/NCG.h @@ -1,106 +1,37 @@ -#ifndef NCG_H -#define NCG_H - -#if 0 - -IMPORTANT! If you put extra tabs/spaces in these macro definitions, -you will screw up the layout where they are used in case expressions! - -(This is cpp-dependent, of course) - -** Convenience macros for writing the native-code generator ** - -#endif - -#define FAST_REG_NO FAST_INT - -#include "../../includes/config.h" - -#if 0 -{-testing only-} -#undef sparc_TARGET_ARCH -#undef sunos4_TARGET_OS -#undef i386_TARGET_ARCH -#define i386_TARGET_ARCH 1 -#undef linuxaout_TARGET_OS -#define linuxaout_TARGET_OS 1 -#endif -#if 0 -{-testing only-} -#undef sparc_TARGET_ARCH -#undef sunos4_TARGET_OS -#undef alpha_TARGET_ARCH -#define alpha_TARGET_ARCH 1 -#endif +/* ----------------------------------------------------------------------------- -#if i386_TARGET_ARCH -# define STOLEN_X86_REGS 4 --- HACK: go for the max -#endif -#include "../../includes/MachRegs.h" - -#if alpha_TARGET_ARCH -# define BYTES_PER_WORD 8 -# define BYTES_PER_WORD_STR "8" + (c) The University of Glasgow, 1994-2004 -# include "../../includes/alpha-dec-osf1.h" -#endif + Native-code generator header file - just useful macros for now. -#if i386_TARGET_ARCH -# define BYTES_PER_WORD 4 -# define BYTES_PER_WORD_STR "4" + -------------------------------------------------------------------------- */ -# if linuxaout_TARGET_OS -# include "../../includes/i386-unknown-linuxaout.h" -# endif -# if linux_TARGET_OS -# include "../../includes/i386-unknown-linux.h" -# endif -# if freebsd_TARGET_OS -# include "../../includes/i386-unknown-freebsd.h" -# endif -# if netbsd_TARGET_OS -# include "../../includes/i386-unknown-netbsd.h" -# endif -# if bsdi_TARGET_OS -# include "../../includes/i386-unknown-bsdi.h" -# endif -# if cygwin32_TARGET_OS -# include "../../includes/i386-unknown-cygwin32.h" -# endif -# if solaris2_TARGET_OS -# include "../../includes/i386-unknown-solaris2.h" -# endif -#endif +#ifndef NCG_H +#define NCG_H -#if sparc_TARGET_ARCH -# define BYTES_PER_WORD 4 -# define BYTES_PER_WORD_STR "4" +#include "ghc_boot_platform.h" -# if sunos4_TARGET_OS -# include "../../includes/sparc-sun-sunos4.h" -# endif -# if solaris2_TARGET_OS -# include "../../includes/sparc-sun-solaris2.h" -# endif -#endif - ---------------------------------------------- +#define COMMA , +-- - - - - - - - - - - - - - - - - - - - - - #if alpha_TARGET_ARCH # define IF_ARCH_alpha(x,y) x #else # define IF_ARCH_alpha(x,y) y #endif - ---------------------------------------------- - +-- - - - - - - - - - - - - - - - - - - - - - #if i386_TARGET_ARCH # define IF_ARCH_i386(x,y) x #else # define IF_ARCH_i386(x,y) y #endif -- - - - - - - - - - - - - - - - - - - - - - +#if x86_64_TARGET_ARCH +# define IF_ARCH_x86_64(x,y) x +#else +# define IF_ARCH_x86_64(x,y) y +#endif +-- - - - - - - - - - - - - - - - - - - - - - #if freebsd_TARGET_OS # define IF_OS_freebsd(x,y) x #else @@ -113,6 +44,12 @@ you will screw up the layout where they are used in case expressions! # define IF_OS_netbsd(x,y) y #endif -- - - - - - - - - - - - - - - - - - - - - - +#if openbsd_TARGET_OS +# define IF_OS_openbsd(x,y) x +#else +# define IF_OS_openbsd(x,y) y +#endif +-- - - - - - - - - - - - - - - - - - - - - - #if linux_TARGET_OS # define IF_OS_linux(x,y) x #else @@ -130,7 +67,13 @@ you will screw up the layout where they are used in case expressions! #else # define IF_OS_bsdi(x,y) y #endif ---------------------------------------------- +-- - - - - - - - - - - - - - - - - - - - - - +#if cygwin32_TARGET_OS +# define IF_OS_cygwin32(x,y) x +#else +# define IF_OS_cygwin32(x,y) y +#endif +-- - - - - - - - - - - - - - - - - - - - - - #if sparc_TARGET_ARCH # define IF_ARCH_sparc(x,y) x #else @@ -149,5 +92,17 @@ you will screw up the layout where they are used in case expressions! #else # define IF_OS_solaris2(x,y) y #endif +-- - - - - - - - - - - - - - - - - - - - - - +#if powerpc_TARGET_ARCH +# define IF_ARCH_powerpc(x,y) x +#else +# define IF_ARCH_powerpc(x,y) y +#endif +-- - - - - - - - - - - - - - - - - - - - - - +#if darwin_TARGET_OS +# define IF_OS_darwin(x,y) x +#else +# define IF_OS_darwin(x,y) y +#endif --------------------------------------------- #endif