  
  {-# OPTIONS_HADDOCK hide #-}
  
-@@ -47,6 +52,13 @@
- -- First component of result is @log2 n@, second is @0#@ iff /n/ is a
- -- power of two.
- integerLog2IsPowerOf2# :: Integer -> (# Int#, Int# #)
-+#if defined(ghcjs_HOST_OS)
-+integerLog2IsPowerOf2# x = --
-+  case js_integerLog2IsPowerOf2 (unsafeCoerce# x) of
-+    y | isTrue# (y <# 0#) -> (# 0# -# y, 0# #)
-+    y                     -> (# y      , 1# #)
-+foreign import javascript unsafe "h$ghcjsbn_integerLog2IsPowerOf2($1)" js_integerLog2IsPowerOf2 :: Any -> Int#
-+#else
- -- The power of 2 test is n&(n-1) == 0, thus powers of 2
- -- are indicated bythe second component being zero.
- integerLog2IsPowerOf2# (S# i#) = case int2Word# i# of
-@@ -70,7 +82,7 @@
-                 else case indexBigNat# bn i of
-                         0## -> test (i -# 1#)
-                         _   -> 1#
--
-+#endif
- 
- -- Assumption: Integer and Int# are strictly positive, Int# is less
- -- than logBase 2 of Integer, otherwise havoc ensues.
-@@ -84,6 +96,10 @@
- -- 1# means we have a half-integer, round to even
- -- 2# means round up (away from zero)
- roundingMode# :: Integer -> Int# -> Int#
-+#if defined(ghcjs_HOST_OS)
-+roundingMode# x y = js_roundingMode (unsafeCoerce# x) y
-+foreign import javascript unsafe "h$integer_roundingMode($1,$2)" js_roundingMode :: Any -> Int# -> Int#
-+#else
- roundingMode# (S# i#) t =
-     case int2Word# i# `and#` ((uncheckedShiftL# 2## t) `minusWord#` 1##) of
-       k -> case uncheckedShiftL# 1## t of
-@@ -116,3 +132,4 @@
-                 else case indexBigNat# bn i of
-                         0## -> test (i -# 1#)
-                         _   -> 2#
-+#endif
 diff -X ../utils/updatePatches.excludes -Nru upstream/pkg/integer-gmp/src/GHC/Integer/Logarithms.hs boot/pkg/integer-gmp/src/GHC/Integer/Logarithms.hs
---- upstream/pkg/integer-gmp/src/GHC/Integer/Logarithms.hs	2019-05-07 22:52:34.000000000 -0700
-+++ boot/pkg/integer-gmp/src/GHC/Integer/Logarithms.hs	2019-05-07 22:52:34.932871418 -0700
+--- upstream/pkg/integer-gmp/src/GHC/Integer/Logarithms.hs	2019-06-15 23:41:11.000000000 +0200
++++ boot/pkg/integer-gmp/src/GHC/Integer/Logarithms.hs	2019-06-15 23:41:11.000000000 +0200
 @@ -4,6 +4,9 @@
  {-# LANGUAGE UnliftedFFITypes #-}
  {-# LANGUAGE CPP #-}

diff -X ../utils/updatePatches.excludes -Nru upstream/pkg/integer-gmp/integer-gmp.buildinfo.in boot/pkg/integer-gmp/integer-gmp.buildinfo.in
--- upstream/pkg/integer-gmp/integer-gmp.buildinfo.in	2019-05-07 22:52:34.000000000 -0700
+++ boot/pkg/integer-gmp/integer-gmp.buildinfo.in	2019-05-07 22:52:34.932871418 -0700
@@ -2,4 +2,4 @@
 extra-lib-dirs: @GMP_LIB_DIRS@
 extra-libraries: @GMP_LIBS@

 -- | Compute base-2 log of 'Word#'
 --
diff -X ../utils/updatePatches.excludes -Nru upstream/pkg/integer-gmp/src/GHC/Integer/Type.hs boot/pkg/integer-gmp/src/GHC/Integer/Type.hs
--- upstream/pkg/integer-gmp/src/GHC/Integer/Type.hs	2019-06-15 23:41:11.000000000 +0200
+++ boot/pkg/integer-gmp/src/GHC/Integer/Type.hs	2019-06-15 23:41:11.000000000 +0200
@@ -9,6 +9,9 @@
 {-# LANGUAGE RebindableSyntax #-}
 {-# LANGUAGE NegativeLiterals #-}
