From: simonm Date: Mon, 10 May 1999 09:50:49 +0000 (+0000) Subject: [project @ 1999-05-10 09:50:49 by simonm] X-Git-Tag: Approximately_9120_patches~6240 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=4f2b3ca6ddd54b417d9e592fe9ea8f47a72dbfd9;hp=94e0fc0b3d90dd220d72d8ff109d20e9904ada4e;p=ghc-hetmet.git [project @ 1999-05-10 09:50:49 by simonm] integer2Int# take 4: cleaned up a little. --- diff --git a/ghc/includes/PrimOps.h b/ghc/includes/PrimOps.h index 6b793c7..87630c4 100644 --- a/ghc/includes/PrimOps.h +++ b/ghc/includes/PrimOps.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: PrimOps.h,v 1.29 1999/05/10 09:26:41 sof Exp $ + * $Id: PrimOps.h,v 1.30 1999/05/10 09:50:49 simonm Exp $ * * (c) The GHC Team, 1998-1999 * @@ -307,19 +307,16 @@ typedef union { * integer2Int# is now modular. */ -#define integer2Intzh(r, sa,da) \ -{ MP_INT arg; \ - \ - arg._mp_size = (sa); \ - arg._mp_alloc = ((StgArrWords *)da)->words; \ - arg._mp_d = (unsigned long int *) (BYTE_ARR_CTS(da)); \ - \ - (r) = \ - ( arg._mp_size == 0 ) ? \ - 0 : \ - (( arg._mp_size < 0 && arg._mp_d[0] != 0x80000000 ) ? \ - -(I_)arg._mp_d[0] : \ - (I_)arg._mp_d[0]); \ +#define integer2Intzh(r, sa,da) \ +{ StgWord word0 = ((StgWord *)BYTE_ARR_CTS(da))[0]; \ + int size = sa; \ + \ + (r) = \ + ( size == 0 ) ? \ + 0 : \ + ( size < 0 && word0 != 0x8000000 ) ? \ + -(I_)word0 : \ + (I_)word0; \ } #define integer2Wordzh(r, sa,da) \