diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+# 0.1.2.1
+- fix incorrect wrappers for Win64
+- relax dependencies for ghc-9.4
+
+# 0.1.2
+- ghc-9 compatibility
+
 # 0.1.1
 - raw function foreign import bindings
 - define hsc2hs #alignment macro for older GHC versions
diff --git a/cbits/wrappers.c b/cbits/wrappers.c
--- a/cbits/wrappers.c
+++ b/cbits/wrappers.c
@@ -8,7 +8,7 @@
   } else if (sizeof(HsInt) == sizeof(signed long int) + sizeof(unsigned long int)) {
     // Win64, see comments in integer-gmp/src/GHC/Integer/Type.hs
 #define lobits (8 * sizeof(unsigned long int))
-#define lomask (lobits - 1)
+#define lomask ((1ULL << lobits) - 1)
     mpz_set_si(dst, n >> lobits); // warns when branch will be unused
     mpz_mul_2exp(dst, dst, lobits);
     mpz_add_ui(dst, dst, n & lomask);
diff --git a/hgmp.cabal b/hgmp.cabal
--- a/hgmp.cabal
+++ b/hgmp.cabal
@@ -1,5 +1,5 @@
 name:                hgmp
-version:             0.1.2
+version:             0.1.2.1
 synopsis:            Haskell interface to GMP
 description:         Types and instances, and marshalling between Integer and
                      Rational and the corresponding GMP types, along with raw
@@ -7,8 +7,8 @@
                      (whether in GMP itself or in third-party code that uses
                      GMP).
                      .
-                     Supports only GHC with integer-gmp, this might change if
-                     there's any demand.
+                     Supports only GHC with integer-gmp or ghc-bignum, this
+                     might change if there's any demand.
 
 homepage:            https://code.mathr.co.uk/hgmp
 
@@ -28,11 +28,11 @@
                      , Numeric.GMP.Types
                      , Numeric.GMP.Raw.Safe
                      , Numeric.GMP.Raw.Unsafe
-  build-depends:       base >= 4.8 && < 4.17
-                     , ghc-prim >= 0.4 && < 0.8
+  build-depends:       base >= 4.8 && < 4.18
+                     , ghc-prim >= 0.4 && < 0.10
 
   if (impl(ghc >= 8.11))
-    build-depends:     ghc-bignum >= 1.0 && < 1.1
+    build-depends:     ghc-bignum >= 1.0 && < 1.4
   else
     build-depends:     integer-gmp >= 1.0 && < 1.1
 
@@ -66,4 +66,4 @@
 source-repository this
   type:                git
   location:            https://code.mathr.co.uk/hgmp.git
-  tag:                 v0.1.2
+  tag:                 v0.1.2.1
