X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=includes%2FStg.h;h=1facd5f40594237d64ee8ca9ed0821afa0320b5e;hp=a63b7ec2d6f43d980375f2fd9b90c9238c7a3620;hb=9bbcd77cf9b66940058dbea1827db594e8ff6d7f;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1 diff --git a/includes/Stg.h b/includes/Stg.h index a63b7ec..1facd5f 100644 --- a/includes/Stg.h +++ b/includes/Stg.h @@ -66,7 +66,9 @@ #define BITS_IN(x) (BITS_PER_BYTE * sizeof(x)) /* - * 'Portable' inlining + * 'Portable' inlining: + * INLINE_HEADER is for inline functions in header files + * STATIC_INLINE is for inline functions in source files */ #if defined(__GNUC__) || defined( __INTEL_COMPILER) # define INLINE_HEADER static inline @@ -127,8 +129,8 @@ typedef StgWord64 LW_; #define EF_(f) extern F_ f(void) typedef StgWord StgWordArray[]; -#define EI_ extern StgWordArray -#define II_ static StgWordArray +#define EI_(X) extern StgWordArray (X) GNU_ATTRIBUTE(aligned (8)) +#define II_(X) static StgWordArray (X) GNU_ATTRIBUTE(aligned (8)) /* ----------------------------------------------------------------------------- Tail calls @@ -442,7 +444,9 @@ typedef union { /* Approximate version when we don't have long arithmetic (on 64-bit archs) */ -#define HALF_POS_INT (((I_)1) << (BITS_IN (I_) / 2)) +/* If we have n-bit words then we have n-1 bits after accounting for the + * sign bit, so we can fit the result of multiplying 2 (n-1)/2-bit numbers */ +#define HALF_POS_INT (((I_)1) << ((BITS_IN (I_) - 1) / 2)) #define HALF_NEG_INT (-HALF_POS_INT) #define mulIntMayOflo(a,b) \