-/* -----------------------------------------------------------------------------
- Word# PrimOps.
- -------------------------------------------------------------------------- */
-
-#define plusWordzh(r,a,b) r=(a)+(b)
-#define minusWordzh(r,a,b) r=(a)-(b)
-#define timesWordzh(r,a,b) r=(a)*(b)
-#define quotWordzh(r,a,b) r=(a)/(b)
-#define remWordzh(r,a,b) r=(a)%(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)
-
-/* The extra tests below properly define the behaviour when shifting
- * by offsets larger than the width of the value being shifted. Doing
- * so is undefined in C (and in fact gives different answers depending
- * on whether the operation is constant folded or not with gcc on x86!)
- */
-
-#define shiftLzh(r,a,b) r=((b) >= BITS_IN(W_)) ? 0 : (a)<<(b)
-#define shiftRLzh(r,a,b) r=((b) >= BITS_IN(W_)) ? 0 : (a)>>(b)
-#define iShiftLzh(r,a,b) r=((b) >= BITS_IN(W_)) ? 0 : (a)<<(b)
-/* Right shifting of signed quantities is not portable in C, so
- the behaviour you'll get from using these primops depends
- on the whatever your C compiler is doing. ToDo: fix/document. -- sof 8/98
-*/
-#define iShiftRAzh(r,a,b) r=((b) >= BITS_IN(I_)) ? (((a) < 0) ? -1 : 0) : (a)>>(b)
-#define iShiftRLzh(r,a,b) r=((b) >= BITS_IN(I_)) ? 0 : (I_)((W_)(a)>>(b))
-
-#define int2Wordzh(r,a) r=(W_)(a)
-#define word2Intzh(r,a) r=(I_)(a)
-
-/* -----------------------------------------------------------------------------
- Explicitly sized Int# and Word# PrimOps.
- -------------------------------------------------------------------------- */
-
-#define narrow8Intzh(r,a) r=(StgInt8)(a)
-#define narrow16Intzh(r,a) r=(StgInt16)(a)
-#define narrow32Intzh(r,a) r=(StgInt32)(a)
-#define narrow8Wordzh(r,a) r=(StgWord8)(a)
-#define narrow16Wordzh(r,a) r=(StgWord16)(a)
-#define narrow32Wordzh(r,a) r=(StgWord32)(a)
-
-/* -----------------------------------------------------------------------------
- Addr# PrimOps.
- -------------------------------------------------------------------------- */
-
-#define nullAddrzh(r,i) r=(A_)(0)
-#define plusAddrzh(r,a,i) r=((void *)(a)) + (i)
-#define minusAddrzh(r,a,b) r=((void *)(a)) - ((void *)(b))
-#define remAddrzh(r,a,i) r=((W_)(a))%(i)
-#define int2Addrzh(r,a) r=(A_)(a)
-#define addr2Intzh(r,a) r=(I_)(a)
-
-#define readCharOffAddrzh(r,a,i) r=((StgWord8 *)(a))[i]
-#define readWideCharOffAddrzh(r,a,i) r=((C_ *)(a))[i]
-#define readIntOffAddrzh(r,a,i) r=((I_ *)(a))[i]
-#define readWordOffAddrzh(r,a,i) r=((W_ *)(a))[i]
-#define readAddrOffAddrzh(r,a,i) r=((PP_)(a))[i]
-#define readFloatOffAddrzh(r,a,i) r=PK_FLT((P_) (((StgFloat *)(a)) + i))
-#define readDoubleOffAddrzh(r,a,i) r=PK_DBL((P_) (((StgDouble *)(a)) + i))
-#define readStablePtrOffAddrzh(r,a,i) r=((StgStablePtr *)(a))[i]
-#define readInt8OffAddrzh(r,a,i) r=((StgInt8 *)(a))[i]
-#define readInt16OffAddrzh(r,a,i) r=((StgInt16 *)(a))[i]
-#define readWord8OffAddrzh(r,a,i) r=((StgWord8 *)(a))[i]
-#define readWord16OffAddrzh(r,a,i) r=((StgWord16 *)(a))[i]
-#define readInt32OffAddrzh(r,a,i) r=((StgInt32 *)(a))[i]
-#define readWord32OffAddrzh(r,a,i) r=((StgWord32 *)(a))[i]
-#ifdef SUPPORT_LONG_LONGS
-#define readInt64OffAddrzh(r,a,i) r=((LI_ *)(a))[i]
-#define readWord64OffAddrzh(r,a,i) r=((LW_ *)(a))[i]
-#else
-#define readInt64OffAddrzh(r,a,i) r=((I_ *)(a))[i]
-#define readWord64OffAddrzh(r,a,i) r=((W_ *)(a))[i]
-#endif
-
-#define writeCharOffAddrzh(a,i,v) ((StgWord8 *)(a))[i] = (v)
-#define writeWideCharOffAddrzh(a,i,v) ((C_ *)(a))[i] = (v)
-#define writeIntOffAddrzh(a,i,v) ((I_ *)(a))[i] = (v)
-#define writeWordOffAddrzh(a,i,v) ((W_ *)(a))[i] = (v)
-#define writeAddrOffAddrzh(a,i,v) ((PP_)(a))[i] = (v)
-#define writeForeignObjOffAddrzh(a,i,v) ((PP_)(a))[i] = ForeignObj_CLOSURE_DATA(v)
-#define writeFloatOffAddrzh(a,i,v) ASSIGN_FLT((P_) (((StgFloat *)(a)) + i),v)
-#define writeDoubleOffAddrzh(a,i,v) ASSIGN_DBL((P_) (((StgDouble *)(a)) + i),v)
-#define writeStablePtrOffAddrzh(a,i,v) ((StgStablePtr *)(a))[i] = (v)
-#define writeInt8OffAddrzh(a,i,v) ((StgInt8 *)(a))[i] = (v)
-#define writeInt16OffAddrzh(a,i,v) ((StgInt16 *)(a))[i] = (v)
-#define writeInt32OffAddrzh(a,i,v) ((StgInt32 *)(a))[i] = (v)
-#define writeWord8OffAddrzh(a,i,v) ((StgWord8 *)(a))[i] = (v)
-#define writeWord16OffAddrzh(a,i,v) ((StgWord16 *)(a))[i] = (v)
-#define writeWord32OffAddrzh(a,i,v) ((StgWord32 *)(a))[i] = (v)
-#ifdef SUPPORT_LONG_LONGS
-#define writeInt64OffAddrzh(a,i,v) ((LI_ *)(a))[i] = (v)
-#define writeWord64OffAddrzh(a,i,v) ((LW_ *)(a))[i] = (v)
-#else
-#define writeInt64OffAddrzh(a,i,v) ((I_ *)(a))[i] = (v)
-#define writeWord64OffAddrzh(a,i,v) ((W_ *)(a))[i] = (v)
-#endif
-
-#define indexCharOffAddrzh(r,a,i) r=((StgWord8 *)(a))[i]
-#define indexWideCharOffAddrzh(r,a,i) r=((C_ *)(a))[i]
-#define indexIntOffAddrzh(r,a,i) r=((I_ *)(a))[i]
-#define indexWordOffAddrzh(r,a,i) r=((W_ *)(a))[i]
-#define indexAddrOffAddrzh(r,a,i) r=((PP_)(a))[i]
-#define indexFloatOffAddrzh(r,a,i) r=PK_FLT((P_) (((StgFloat *)(a)) + i))
-#define indexDoubleOffAddrzh(r,a,i) r=PK_DBL((P_) (((StgDouble *)(a)) + i))
-#define indexStablePtrOffAddrzh(r,a,i) r=((StgStablePtr *)(a))[i]
-#define indexInt8OffAddrzh(r,a,i) r=((StgInt8 *)(a))[i]
-#define indexInt16OffAddrzh(r,a,i) r=((StgInt16 *)(a))[i]
-#define indexInt32OffAddrzh(r,a,i) r=((StgInt32 *)(a))[i]
-#define indexWord8OffAddrzh(r,a,i) r=((StgWord8 *)(a))[i]
-#define indexWord16OffAddrzh(r,a,i) r=((StgWord16 *)(a))[i]
-#define indexWord32OffAddrzh(r,a,i) r=((StgWord32 *)(a))[i]
-#ifdef SUPPORT_LONG_LONGS
-#define indexInt64OffAddrzh(r,a,i) r=((LI_ *)(a))[i]
-#define indexWord64OffAddrzh(r,a,i) r=((LW_ *)(a))[i]
-#else
-#define indexInt64OffAddrzh(r,a,i) r=((I_ *)(a))[i]
-#define indexWord64OffAddrzh(r,a,i) r=((W_ *)(a))[i]
-#endif
-
-/* -----------------------------------------------------------------------------
- Float PrimOps.
- -------------------------------------------------------------------------- */
-
-#define plusFloatzh(r,a,b) r=(a)+(b)
-#define minusFloatzh(r,a,b) r=(a)-(b)
-#define timesFloatzh(r,a,b) r=(a)*(b)
-#define divideFloatzh(r,a,b) r=(a)/(b)
-#define negateFloatzh(r,a) r=-(a)
-
-#define int2Floatzh(r,a) r=(StgFloat)(a)
-#define float2Intzh(r,a) r=(I_)(a)
-
-#define expFloatzh(r,a) r=(StgFloat) RET_PRIM_STGCALL1(StgDouble,exp,a)
-#define logFloatzh(r,a) r=(StgFloat) RET_PRIM_STGCALL1(StgDouble,log,a)
-#define sqrtFloatzh(r,a) r=(StgFloat) RET_PRIM_STGCALL1(StgDouble,sqrt,a)
-#define sinFloatzh(r,a) r=(StgFloat) RET_PRIM_STGCALL1(StgDouble,sin,a)
-#define cosFloatzh(r,a) r=(StgFloat) RET_PRIM_STGCALL1(StgDouble,cos,a)
-#define tanFloatzh(r,a) r=(StgFloat) RET_PRIM_STGCALL1(StgDouble,tan,a)
-#define asinFloatzh(r,a) r=(StgFloat) RET_PRIM_STGCALL1(StgDouble,asin,a)
-#define acosFloatzh(r,a) r=(StgFloat) RET_PRIM_STGCALL1(StgDouble,acos,a)
-#define atanFloatzh(r,a) r=(StgFloat) RET_PRIM_STGCALL1(StgDouble,atan,a)
-#define sinhFloatzh(r,a) r=(StgFloat) RET_PRIM_STGCALL1(StgDouble,sinh,a)
-#define coshFloatzh(r,a) r=(StgFloat) RET_PRIM_STGCALL1(StgDouble,cosh,a)
-#define tanhFloatzh(r,a) r=(StgFloat) RET_PRIM_STGCALL1(StgDouble,tanh,a)
-#define powerFloatzh(r,a,b) r=(StgFloat) RET_PRIM_STGCALL2(StgDouble,pow,a,b)
-
-/* -----------------------------------------------------------------------------
- Double PrimOps.
- -------------------------------------------------------------------------- */
-
-#define zpzhzh(r,a,b) r=(a)+(b)
-#define zmzhzh(r,a,b) r=(a)-(b)
-#define ztzhzh(r,a,b) r=(a)*(b)
-#define zszhzh(r,a,b) r=(a)/(b)
-#define negateDoublezh(r,a) r=-(a)
-
-#define int2Doublezh(r,a) r=(StgDouble)(a)
-#define double2Intzh(r,a) r=(I_)(a)
-
-#define float2Doublezh(r,a) r=(StgDouble)(a)
-#define double2Floatzh(r,a) r=(StgFloat)(a)
-
-#define expDoublezh(r,a) r=(StgDouble) RET_PRIM_STGCALL1(StgDouble,exp,a)
-#define logDoublezh(r,a) r=(StgDouble) RET_PRIM_STGCALL1(StgDouble,log,a)
-#define sqrtDoublezh(r,a) r=(StgDouble) RET_PRIM_STGCALL1(StgDouble,sqrt,a)
-#define sinDoublezh(r,a) r=(StgDouble) RET_PRIM_STGCALL1(StgDouble,sin,a)
-#define cosDoublezh(r,a) r=(StgDouble) RET_PRIM_STGCALL1(StgDouble,cos,a)
-#define tanDoublezh(r,a) r=(StgDouble) RET_PRIM_STGCALL1(StgDouble,tan,a)
-#define asinDoublezh(r,a) r=(StgDouble) RET_PRIM_STGCALL1(StgDouble,asin,a)
-#define acosDoublezh(r,a) r=(StgDouble) RET_PRIM_STGCALL1(StgDouble,acos,a)
-#define atanDoublezh(r,a) r=(StgDouble) RET_PRIM_STGCALL1(StgDouble,atan,a)
-#define sinhDoublezh(r,a) r=(StgDouble) RET_PRIM_STGCALL1(StgDouble,sinh,a)
-#define coshDoublezh(r,a) r=(StgDouble) RET_PRIM_STGCALL1(StgDouble,cosh,a)
-#define tanhDoublezh(r,a) r=(StgDouble) RET_PRIM_STGCALL1(StgDouble,tanh,a)
-/* Power: **## */
-#define ztztzhzh(r,a,b) r=(StgDouble) RET_PRIM_STGCALL2(StgDouble,pow,a,b)