X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FStg.h;h=5cd3701c0fae311128ec7d4ba0762d8f8acc258c;hb=28a0d04ee6650069e7912ea69d37376323dab17b;hp=8e3da0f6d3c3ffba6f660326d82bd75e20907803;hpb=983a0f014a12c290ce5efec0b732ad54dd8a281a;p=ghc-hetmet.git diff --git a/includes/Stg.h b/includes/Stg.h index 8e3da0f..5cd3701 100644 --- a/includes/Stg.h +++ b/includes/Stg.h @@ -442,7 +442,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) \