From 4f2b3ca6ddd54b417d9e592fe9ea8f47a72dbfd9 Mon Sep 17 00:00:00 2001 From: simonm Date: Mon, 10 May 1999 09:50:49 +0000 Subject: [PATCH] [project @ 1999-05-10 09:50:49 by simonm] integer2Int# take 4: cleaned up a little. --- ghc/includes/PrimOps.h | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) 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) \ -- 1.7.10.4