Skip to content
Commits on Source (2)
ghc (8.6.5+dfsg1-2) unstable; urgency=medium
* Use ghc-8.4 as the bootstrap compiler and drop the
fix-build-using-unregisterized-v8.2 patch.
fix-build-using-unregisterized-v8.2 patch (Closes: #921579)
* Allow unregisterised ghc-8.4 to build newer GHC (Closes: #932941)
* Re-add upstream patches (which were lost during packaging of the latest
release) to support risc* platforms. Thanks to Aurelien Jarno for
reporting this (Closes: #933009)
* Backport upstream patch to fix a bug where an unregisterised GHC failed to
compile some libraries (e.g., gloss, juicypixels) on 64-bit architectures.
-- Ilias Tsitsimpis <iliastsi@debian.org> Thu, 25 Jul 2019 17:59:31 +0300
......
commit 35a897782b6b0a252da7fdcf4921198ad4e1d96c
Author: James Clarke <jrtc27@jrtc27.com>
Date: Thu Nov 22 11:55:17 2018 -0500
UNREG: PprC: Add support for adjacent floats
When two 32-bit floats are adjacent for a 64-bit target, there is no
padding between them to force alignment, so we must combine their bit
representations into a single word.
Reviewers: bgamari, simonmar
Reviewed By: simonmar
Subscribers: rwbarton, carter
GHC Trac Issues: #15853
Differential Revision: https://phabricator.haskell.org/D5306
Index: b/compiler/cmm/PprC.hs
===================================================================
--- a/compiler/cmm/PprC.hs
+++ b/compiler/cmm/PprC.hs
@@ -512,9 +512,12 @@ pprLit1 other = pprLit other
pprStatics :: DynFlags -> [CmmStatic] -> [SDoc]
pprStatics _ [] = []
pprStatics dflags (CmmStaticLit (CmmFloat f W32) : rest)
- -- floats are padded to a word by padLitToWord, see #1852
+ -- odd numbers of floats are padded to a word by mkVirtHeapOffsetsWithPadding
| wORD_SIZE dflags == 8, CmmStaticLit (CmmInt 0 W32) : rest' <- rest
= pprLit1 (floatToWord dflags f) : pprStatics dflags rest'
+ -- adjacent floats aren't padded but combined into a single word
+ | wORD_SIZE dflags == 8, CmmStaticLit (CmmFloat g W32) : rest' <- rest
+ = pprLit1 (floatPairToWord dflags f g) : pprStatics dflags rest'
| wORD_SIZE dflags == 4
= pprLit1 (floatToWord dflags f) : pprStatics dflags rest
| otherwise
@@ -1261,6 +1264,25 @@ floatToWord dflags r
, wORDS_BIGENDIAN dflags = 32
| otherwise = 0
+floatPairToWord :: DynFlags -> Rational -> Rational -> CmmLit
+floatPairToWord dflags r1 r2
+ = runST (do
+ arr <- newArray_ ((0::Int),1)
+ writeArray arr 0 (fromRational r1)
+ writeArray arr 1 (fromRational r2)
+ arr' <- castFloatToWord32Array arr
+ w32_1 <- readArray arr' 0
+ w32_2 <- readArray arr' 1
+ return (pprWord32Pair w32_1 w32_2)
+ )
+ where pprWord32Pair w32_1 w32_2
+ | wORDS_BIGENDIAN dflags =
+ CmmInt ((shiftL i1 32) .|. i2) W64
+ | otherwise =
+ CmmInt ((shiftL i2 32) .|. i1) W64
+ where i1 = toInteger w32_1
+ i2 = toInteger w32_2
+
doubleToWords :: DynFlags -> Rational -> [CmmLit]
doubleToWords dflags r
= runST (do
Description: cherry-pick of upstream commits
beba89a0f16681c85d39fc8a894bde4162ff492a.patch:
5e63a25249f3cb07300258e115af9ff55079d2ea.patch:
Last-Update: 2019-05-27
Index: b/aclocal.m4
===================================================================
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -217,7 +217,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V
mipsel)
test -z "[$]2" || eval "[$]2=ArchMipsel"
;;
- hppa|hppa1_1|ia64|m68k|nios2|rs6000|s390|s390x|sh4|vax)
+ hppa|hppa1_1|ia64|m68k|nios2|riscv32|riscv64|rs6000|s390|s390x|sh4|vax)
test -z "[$]2" || eval "[$]2=ArchUnknown"
;;
*)
@@ -1906,6 +1906,12 @@ case "$1" in
powerpc*)
$2="powerpc"
;;
+ riscv64*)
+ $2="riscv64"
+ ;;
+ riscv|riscv32*)
+ $2="riscv32"
+ ;;
rs6000)
$2="rs6000"
;;
......@@ -11,3 +11,5 @@ add_-latomic_to_ghc-prim
kfreebsd-aclocal.m4
local-mathjax
fix-build-using-unregisterized-v8.4
risc-support.patch
PprC-Add-support-for-adjacent-floats