/* -----------------------------------------------------------------------------
- * $Id: PrimOps.h,v 1.39 1999/11/09 10:05:07 sewardj Exp $
+ * $Id: PrimOps.h,v 1.41 1999/12/08 14:21:54 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
(r) = RET_PRIM_STGCALL2(I_,mpz_cmp_si,&arg,i); \
}
+/* I think mp_limb_t must be the same size as StgInt for this to work
+ * properly --SDM
+ */
+#define gcdIntzh(r,a,b) \
+{ StgInt aa = a; \
+ r = (aa) ? (b) ? \
+ RET_STGCALL3(StgInt, mpn_gcd_1, (mp_limb_t *)(&aa), 1, (mp_limb_t)(b)) \
+ : abs(aa) \
+ : abs(b); \
+}
+
+#define gcdIntegerIntzh_fast(r,a,sb,b) \
+ RET_STGCALL3(StgInt, mpn_gcd_1, (unsigned long int *) b, sb, (mp_limb_t)(a))
+
/* The rest are all out-of-line: -------- */
/* Integer arithmetic */
EF_(timesIntegerzh_fast);
EF_(gcdIntegerzh_fast);
EF_(quotRemIntegerzh_fast);
+EF_(quotIntegerzh_fast);
+EF_(remIntegerzh_fast);
+EF_(divExactIntegerzh_fast);
EF_(divModIntegerzh_fast);
/* Conversions */
#endif
/* -----------------------------------------------------------------------------
- Parallel PrimOps.
+ Concurrency/Exception PrimOps.
-------------------------------------------------------------------------- */
EF_(forkzh_fast);
EF_(yieldzh_fast);
EF_(killThreadzh_fast);
EF_(seqzh_fast);
-EF_(unblockExceptionszh_fast);
-
-#define blockExceptionszh_fast \
- if (CurrentTSO->pending_exceptions == NULL) { \
- CurrentTSO->pending_exceptions = &END_EXCEPTION_LIST_closure; \
- }
+EF_(blockAsyncExceptionszh_fast);
+EF_(unblockAsyncExceptionszh_fast);
#define myThreadIdzh(t) (t = CurrentTSO)