From 67dbf6a696353dfc2d8cf899071ca4eae9a9f176 Mon Sep 17 00:00:00 2001 From: Shao Cheng Date: Sat, 31 Mar 2018 16:59:59 +0800 Subject: [PATCH] Fix GHC.PrimopWrappers; test time penalty of -split-sections for ghc-prim --- asterius/test/ahc-boot.hs | 2 +- ghc-toolkit/boot-libs/ghc-prim/GHC/PrimopWrappers.hs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/asterius/test/ahc-boot.hs b/asterius/test/ahc-boot.hs index 5c7ba4ed..76a5e717 100644 --- a/asterius/test/ahc-boot.hs +++ b/asterius/test/ahc-boot.hs @@ -10,7 +10,7 @@ main = do BootArgs { bootDir = bootdir , configureOptions = - "--verbose --ghc-option=-keep-hc-files --ghc-option=-keep-s-files --ghc-option=-ddump-to-file --ghc-option=-ddump-asm --ghc-option=-ddump-cmm-raw --ghc-option=-ddump-cmm --ghc-option=-ddump-stg --ghc-option=-ddump-simpl" + "--verbose --enable-split-sections --ghc-option=-keep-hc-files --ghc-option=-keep-s-files --ghc-option=-ddump-to-file --ghc-option=-ddump-asm --ghc-option=-ddump-cmm-raw --ghc-option=-ddump-cmm --ghc-option=-ddump-stg --ghc-option=-ddump-simpl" , buildOptions = "" , installOptions = "" } diff --git a/ghc-toolkit/boot-libs/ghc-prim/GHC/PrimopWrappers.hs b/ghc-toolkit/boot-libs/ghc-prim/GHC/PrimopWrappers.hs index 59c1e97c..d2d4ff22 100644 --- a/ghc-toolkit/boot-libs/ghc-prim/GHC/PrimopWrappers.hs +++ b/ghc-toolkit/boot-libs/ghc-prim/GHC/PrimopWrappers.hs @@ -195,6 +195,7 @@ popCnt64# a1 = (GHC.Prim.popCnt64#) a1 {-# NOINLINE popCnt# #-} popCnt# :: Word# -> Word# popCnt# a1 = (GHC.Prim.popCnt#) a1 +#if MIN_TOOL_VERSION_ghc(8,4,1) {-# NOINLINE pdep8# #-} pdep8# :: Word# -> Word# -> Word# pdep8# a1 a2 = (GHC.Prim.pdep8#) a1 a2 @@ -225,6 +226,7 @@ pext64# a1 a2 = (GHC.Prim.pext64#) a1 a2 {-# NOINLINE pext# #-} pext# :: Word# -> Word# -> Word# pext# a1 a2 = (GHC.Prim.pext#) a1 a2 +#endif {-# NOINLINE clz8# #-} clz8# :: Word# -> Word# clz8# a1 = (GHC.Prim.clz8#) a1 @@ -639,6 +641,7 @@ indexWord32Array# a1 a2 = (GHC.Prim.indexWord32Array#) a1 a2 {-# NOINLINE indexWord64Array# #-} indexWord64Array# :: ByteArray# -> Int# -> Word# indexWord64Array# a1 a2 = (GHC.Prim.indexWord64Array#) a1 a2 +#if MIN_TOOL_VERSION_ghc(8,5,20180326) {-# NOINLINE indexWord8ArrayAsChar# #-} indexWord8ArrayAsChar# :: ByteArray# -> Int# -> Char# indexWord8ArrayAsChar# a1 a2 = (GHC.Prim.indexWord8ArrayAsChar#) a1 a2 @@ -681,6 +684,7 @@ indexWord8ArrayAsWord64# a1 a2 = (GHC.Prim.indexWord8ArrayAsWord64#) a1 a2 {-# NOINLINE indexWord8ArrayAsWord# #-} indexWord8ArrayAsWord# :: ByteArray# -> Int# -> Word# indexWord8ArrayAsWord# a1 a2 = (GHC.Prim.indexWord8ArrayAsWord#) a1 a2 +#endif {-# NOINLINE readCharArray# #-} readCharArray# :: MutableByteArray# s -> Int# -> State# s -> (# State# s,Char# #) readCharArray# a1 a2 a3 = (GHC.Prim.readCharArray#) a1 a2 a3 @@ -729,6 +733,7 @@ readWord32Array# a1 a2 a3 = (GHC.Prim.readWord32Array#) a1 a2 a3 {-# NOINLINE readWord64Array# #-} readWord64Array# :: MutableByteArray# s -> Int# -> State# s -> (# State# s,Word# #) readWord64Array# a1 a2 a3 = (GHC.Prim.readWord64Array#) a1 a2 a3 +#if MIN_TOOL_VERSION_ghc(8,5,20180326) {-# NOINLINE readWord8ArrayAsChar# #-} readWord8ArrayAsChar# :: MutableByteArray# s -> Int# -> State# s -> (# State# s,Char# #) readWord8ArrayAsChar# a1 a2 a3 = (GHC.Prim.readWord8ArrayAsChar#) a1 a2 a3 @@ -771,6 +776,7 @@ readWord8ArrayAsWord64# a1 a2 a3 = (GHC.Prim.readWord8ArrayAsWord64#) a1 a2 a3 {-# NOINLINE readWord8ArrayAsWord# #-} readWord8ArrayAsWord# :: MutableByteArray# s -> Int# -> State# s -> (# State# s,Word# #) readWord8ArrayAsWord# a1 a2 a3 = (GHC.Prim.readWord8ArrayAsWord#) a1 a2 a3 +#endif {-# NOINLINE writeCharArray# #-} writeCharArray# :: MutableByteArray# s -> Int# -> Char# -> State# s -> State# s writeCharArray# a1 a2 a3 a4 = (GHC.Prim.writeCharArray#) a1 a2 a3 a4 @@ -819,6 +825,7 @@ writeWord32Array# a1 a2 a3 a4 = (GHC.Prim.writeWord32Array#) a1 a2 a3 a4 {-# NOINLINE writeWord64Array# #-} writeWord64Array# :: MutableByteArray# s -> Int# -> Word# -> State# s -> State# s writeWord64Array# a1 a2 a3 a4 = (GHC.Prim.writeWord64Array#) a1 a2 a3 a4 +#if MIN_TOOL_VERSION_ghc(8,5,20180326) {-# NOINLINE writeWord8ArrayAsChar# #-} writeWord8ArrayAsChar# :: MutableByteArray# s -> Int# -> Char# -> State# s -> State# s writeWord8ArrayAsChar# a1 a2 a3 a4 = (GHC.Prim.writeWord8ArrayAsChar#) a1 a2 a3 a4 @@ -861,9 +868,12 @@ writeWord8ArrayAsWord64# a1 a2 a3 a4 = (GHC.Prim.writeWord8ArrayAsWord64#) a1 a2 {-# NOINLINE writeWord8ArrayAsWord# #-} writeWord8ArrayAsWord# :: MutableByteArray# s -> Int# -> Word# -> State# s -> State# s writeWord8ArrayAsWord# a1 a2 a3 a4 = (GHC.Prim.writeWord8ArrayAsWord#) a1 a2 a3 a4 +#endif +#if MIN_TOOL_VERSION_ghc(8,4,1) {-# NOINLINE compareByteArrays# #-} compareByteArrays# :: ByteArray# -> Int# -> ByteArray# -> Int# -> Int# -> Int# compareByteArrays# a1 a2 a3 a4 a5 = (GHC.Prim.compareByteArrays#) a1 a2 a3 a4 a5 +#endif {-# NOINLINE copyByteArray# #-} copyByteArray# :: ByteArray# -> Int# -> MutableByteArray# s -> Int# -> Int# -> State# s -> State# s copyByteArray# a1 a2 a3 a4 a5 a6 = (GHC.Prim.copyByteArray#) a1 a2 a3 a4 a5 a6 @@ -1403,12 +1413,14 @@ traceEvent# a1 a2 = (GHC.Prim.traceEvent#) a1 a2 {-# NOINLINE traceMarker# #-} traceMarker# :: Addr# -> State# s -> State# s traceMarker# a1 a2 = (GHC.Prim.traceMarker#) a1 a2 +#if MIN_TOOL_VERSION_ghc(8,5,20180108) {-# NOINLINE getThreadAllocationCounter# #-} getThreadAllocationCounter# :: State# (RealWorld) -> (# State# (RealWorld),Int# #) getThreadAllocationCounter# a1 = (GHC.Prim.getThreadAllocationCounter#) a1 {-# NOINLINE setThreadAllocationCounter# #-} setThreadAllocationCounter# :: Int# -> State# (RealWorld) -> State# (RealWorld) setThreadAllocationCounter# a1 a2 = (GHC.Prim.setThreadAllocationCounter#) a1 a2 +#endif {-# NOINLINE prefetchByteArray3# #-} prefetchByteArray3# :: ByteArray# -> Int# -> State# s -> State# s prefetchByteArray3# a1 a2 a3 = (GHC.Prim.prefetchByteArray3#) a1 a2 a3