X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FStgMacros.lh;h=44d9a4d92dd6bc53ae0777a5f4550d14ac79b02b;hb=23c94851fb2c98d345d913d35a5a12bbc3a346bd;hp=19baff8d87977ebc2e7c8cc02eeeadcb5bf37615;hpb=2a3a552c0aa2302deaf6fadd5badbbb0d193b3b1;p=ghc-hetmet.git diff --git a/ghc/includes/StgMacros.lh b/ghc/includes/StgMacros.lh index 19baff8..44d9a4d 100644 --- a/ghc/includes/StgMacros.lh +++ b/ghc/includes/StgMacros.lh @@ -232,7 +232,7 @@ I_ StackOverflow PROTO((W_, W_)); do { \ DO_ASTK_HWM(); /* ticky-ticky profiling */ \ DO_BSTK_HWM(); \ - if (STKS_OVERFLOW_OP((a_headroom) + 1, (b_headroom) + 1)) { \ + if (STKS_OVERFLOW_OP(((a_headroom) + 1), ((b_headroom) + 1))) { \ STACK_OVERFLOW(liveness_mask,a_headroom,b_headroom,spa,spb,ret_type,reenter);\ } \ }while(0) @@ -454,6 +454,7 @@ I_ stg_div PROTO((I_ a, I_ b)); #define ZmZh(r,a,b) r=(a)-(b) #define ZtZh(r,a,b) r=(a)*(b) #define quotIntZh(r,a,b) r=(a)/(b) +/* ZdZh not used??? --SDM */ #define ZdZh(r,a,b) r=ULTRASAFESTGCALL2(I_,(void *, I_, I_),stg_div,(a),(b)) #define remIntZh(r,a,b) r=(a)%(b) #define negateIntZh(r,a) r=-(a) @@ -468,8 +469,12 @@ I_ stg_div PROTO((I_ a, I_ b)); %************************************************************************ \begin{code} +#define quotWordZh(r,a,b) r=((W_)a)/((W_)b) +#define remWordZh(r,a,b) r=((W_)a)%((W_)b) + #define andZh(r,a,b) r=(a)&(b) #define orZh(r,a,b) r=(a)|(b) +#define xorZh(r,a,b) r=(a)^(b) #define notZh(r,a) r=~(a) #define shiftLZh(r,a,b) r=(a)<<(b) @@ -880,7 +885,7 @@ Some floating-point format info, made with the \tr{enquire} program /* yes, it is IEEE floating point */ #include "ieee-flpt.h" -#if alpha_dec_osf1_TARGET \ +#if alpha_TARGET_ARCH \ || i386_TARGET_ARCH \ || mipsel_TARGET_ARCH @@ -897,7 +902,7 @@ Some floating-point format info, made with the \tr{enquire} program \end{code} \begin{code} -#if alpha_dec_osf1_TARGET +#if alpha_TARGET_ARCH #define encodeFloatZh(r, hp, aa,sa,da, expon) encodeDoubleZh(r, hp, aa,sa,da, expon) #else #define encodeFloatZh(r, hp, aa,sa,da, expon) \ @@ -923,7 +928,7 @@ Some floating-point format info, made with the \tr{enquire} program r = SAFESTGCALL2(StgDouble,(void *, MP_INT *, I_), __encodeDouble,&arg,(expon));\ } -#if alpha_dec_osf1_TARGET +#if alpha_TARGET_ARCH #define decodeFloatZh(exponr, ar,sr,dr, hp, f) decodeDoubleZh(exponr, ar,sr,dr, hp, f) #else #define decodeFloatZh(exponr, ar,sr,dr, hp, f) \ @@ -1163,6 +1168,12 @@ of one ptr (not bytes). #define indexFloatArrayZh(r,a,i) indexFloatOffAddrZh(r,BYTE_ARR_CTS(a),i) #define indexDoubleArrayZh(r,a,i) indexDoubleOffAddrZh(r,BYTE_ARR_CTS(a),i) +#define indexCharOffForeignObjZh(r,fo,i) indexCharOffAddrZh(r,ForeignObj_CLOSURE_DATA(fo),i) +#define indexIntOffForeignObjZh(r,fo,i) indexIntOffAddrZh(r,ForeignObj_CLOSURE_DATA(fo),i) +#define indexAddrOffForeignObjZh(r,fo,i) indexAddrOffAddrZh(r,ForeignObj_CLOSURE_DATA(fo),i) +#define indexFloatOffForeignObjZh(r,fo,i) indexFloatOffAddrZh(r,ForeignObj_CLOSURE_DATA(fo),i) +#define indexDoubleOffForeignObjZh(r,fo,i) indexDoubleOffAddrZh(r,ForeignObj_CLOSURE_DATA(fo),i) + #define indexCharOffAddrZh(r,a,i) r= ((C_ *)(a))[i] #define indexIntOffAddrZh(r,a,i) r= ((I_ *)(a))[i] #define indexAddrOffAddrZh(r,a,i) r= ((PP_)(a))[i] @@ -1970,7 +1981,7 @@ ED_(True_closure); extern I_ required_thread_count; #ifdef PAR -#define COUNT_SPARK TSO_GLOBALSPARKS(CurrentTSO)++ +#define COUNT_SPARK TSO_GLOBALSPARKS(CurrentTSO)++; sparksCreated++ #else #define COUNT_SPARK #endif @@ -2013,6 +2024,8 @@ extern I_ required_thread_count; } #endif /* GRAN */ + +#endif /* CONCURRENT */ \end{code} The following seq# code should only be used in unoptimized code. @@ -2047,7 +2060,6 @@ ED_RO_(vtbl_seq); r = 1; /* Should be unnecessary */ \ }) -#endif /* CONCURRENT */ \end{code} %************************************************************************