X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FPrimOps.h;h=cf467a4f428528dbe660c42a21a6a651649e66aa;hb=2ea1f1f95ab60183f61461e0a42350dc16e45dad;hp=71bc8afea55622c3267d1c1a1ee8bdc2c37be5f0;hpb=70c5660c4bb19a3828454c901aae5e7f01aeca63;p=ghc-hetmet.git diff --git a/ghc/includes/PrimOps.h b/ghc/includes/PrimOps.h index 71bc8af..cf467a4 100644 --- a/ghc/includes/PrimOps.h +++ b/ghc/includes/PrimOps.h @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- - * $Id: PrimOps.h,v 1.63 2000/09/26 16:45:34 simonpj Exp $ + * $Id: PrimOps.h,v 1.67 2000/11/13 14:40:36 simonmar Exp $ * - * (c) The GHC Team, 1998-1999 + * (c) The GHC Team, 1998-2000 * * Macros for primitive operations in STG-ish C code. * @@ -41,16 +41,8 @@ r = ((P_ *)tmp)[i]; \ } while (0) - -#else - -/* These are the original definitions. They don't chase indirections. */ -#define indexWordOffClosurezh(r,a,i) r= ((W_ *)(a))[i] -#define indexPtrOffClosurezh(r,a,i) r= ((P_ *)(a))[i] - #endif - /* ----------------------------------------------------------------------------- Comparison PrimOps. -------------------------------------------------------------------------- */ @@ -444,6 +436,12 @@ EXTFUN_RTS(word2Integerzh_fast); EXTFUN_RTS(decodeFloatzh_fast); EXTFUN_RTS(decodeDoublezh_fast); +/* Bit operations */ +EXTFUN_RTS(andIntegerzh_fast); +EXTFUN_RTS(orIntegerzh_fast); +EXTFUN_RTS(xorIntegerzh_fast); +EXTFUN_RTS(complementIntegerzh_fast); + /* ----------------------------------------------------------------------------- Word64 PrimOps. -------------------------------------------------------------------------- */ @@ -549,11 +547,11 @@ LI_ stg_word64ToInt64 (StgWord64); #ifdef DEBUG #define BYTE_ARR_CTS(a) \ - ({ ASSERT(GET_INFO((StgArrWords *)(a)) == &ARR_WORDS_info); \ + ({ ASSERT(GET_INFO((StgArrWords *)(a)) == &stg_ARR_WORDS_info); \ REAL_BYTE_ARR_CTS(a); }) #define PTRS_ARR_CTS(a) \ - ({ ASSERT((GET_INFO((StgMutArrPtrs *)(a)) == &MUT_ARR_PTRS_FROZEN_info) \ - || (GET_INFO((StgMutArrPtrs *)(a)) == &MUT_ARR_PTRS_info)); \ + ({ ASSERT((GET_INFO((StgMutArrPtrs *)(a)) == &stg_MUT_ARR_PTRS_FROZEN_info) \ + || (GET_INFO((StgMutArrPtrs *)(a)) == &stg_MUT_ARR_PTRS_info)); \ REAL_PTRS_ARR_CTS(a); }) #else #define BYTE_ARR_CTS(a) REAL_BYTE_ARR_CTS(a) @@ -621,7 +619,7 @@ extern I_ resetGenSymZh(void); #define unsafeFreezzeArrayzh(r,a) \ { \ - SET_INFO((StgClosure *)a,&MUT_ARR_PTRS_FROZEN_info); \ + SET_INFO((StgClosure *)a,&stg_MUT_ARR_PTRS_FROZEN_info); \ r = a; \ } @@ -653,22 +651,15 @@ EXTFUN_RTS(newArrayzh_fast); /* The decode operations are out-of-line because they need to allocate * a byte array. */ -#ifdef FLOATS_AS_DOUBLES -#define decodeFloatzh_fast decodeDoublezh_fast -#else EXTFUN_RTS(decodeFloatzh_fast); -#endif - EXTFUN_RTS(decodeDoublezh_fast); /* grimy low-level support functions defined in StgPrimFloat.c */ extern StgDouble __encodeDouble (I_ size, StgByteArray arr, I_ e); extern StgDouble __int_encodeDouble (I_ j, I_ e); -#ifndef FLOATS_AS_DOUBLES extern StgFloat __encodeFloat (I_ size, StgByteArray arr, I_ e); extern StgFloat __int_encodeFloat (I_ j, I_ e); -#endif extern void __decodeDouble (MP_INT *man, I_ *_exp, StgDouble dbl); extern void __decodeFloat (MP_INT *man, I_ *_exp, StgFloat flt); extern StgInt isDoubleNaN(StgDouble d); @@ -700,7 +691,7 @@ EXTFUN_RTS(newMutVarzh_fast); #define sameMVarzh(r,a,b) r=(I_)((a)==(b)) /* Assume external decl of EMPTY_MVAR_info is in scope by now */ -#define isEmptyMVarzh(r,a) r=(I_)((GET_INFO((StgMVar*)(a))) == &EMPTY_MVAR_info ) +#define isEmptyMVarzh(r,a) r=(I_)((GET_INFO((StgMVar*)(a))) == &stg_EMPTY_MVAR_info ) EXTFUN_RTS(newMVarzh_fast); EXTFUN_RTS(takeMVarzh_fast); EXTFUN_RTS(tryTakeMVarzh_fast); @@ -879,7 +870,7 @@ EXTFUN_RTS(mkWeakzh_fast); EXTFUN_RTS(finalizzeWeakzh_fast); #define deRefWeakzh(code,val,w) \ - if (((StgWeak *)w)->header.info == &WEAK_info) { \ + if (((StgWeak *)w)->header.info == &stg_WEAK_info) { \ code = 1; \ val = (P_)((StgWeak *)w)->value; \ } else { \