Commit c985746f authored by Andreas Klebinger's avatar Andreas Klebinger Committed by Ben Gamari

Move required language extensions into pragmas for shootout.

Summary: That way they are easier to compile with plain calls to ghc.

Test Plan: make clean && make boot && make

Reviewers: O26 nofib, bgamari

Reviewed By: bgamari

Subscribers: bgamari

Differential Revision: https://phabricator.haskell.org/D5437
parent 95c1dccb
Pipeline #773 passed with stage
in 4 minutes and 52 seconds
{-# LANGUAGE BangPatterns #-}
--
-- The Computer Language Benchmarks Game
-- http://benchmarksgame.alioth.debian.org/
......@@ -53,7 +54,7 @@ depth d m
where n = bit (m - d + minN)
-- allocate and check lots of trees
sumT :: Int -> Int -> Int -> Int
sumT :: Int -> Int -> Int -> Int
sumT d 0 t = t
sumT d i t = a `par` b `par` sumT d (i-1) ans
where a = check (make i d)
......
......@@ -8,5 +8,5 @@ SLOW_OPTS = 20 # official shootout setting
# The benchmark game also uses -fllvm, which we can't since it might
# not be available on the developer's machine.
HC_OPTS += -XBangPatterns -funbox-strict-fields
HC_OPTS += -funbox-strict-fields
SRC_RUNTEST_OPTS += +RTS -K128M -H200m -RTS
......@@ -7,6 +7,7 @@
and run with:
+RTS -N<number of cores> -RTS <input>
-}
{-# LANGUAGE BangPatterns #-}
import Control.Concurrent
import Control.Monad
......@@ -49,7 +50,7 @@ increment !p !ct = do
first <- peekElemOff p 1
pokeElemOff p 1 =<< peekElemOff p 0
pokeElemOff p 0 first
let go !i !first = do
ci <- peekElemOff ct i
if fromIntegral ci < i then pokeElemOff ct i (ci+1) else do
......
......@@ -6,7 +6,5 @@ FAST_OPTS = 10
NORM_OPTS = 11
SLOW_OPTS = 12 # official shootout setting
# The benchmark game also uses -fllvm, which we can't since it might
# The benchmark game uses -fllvm, which we can't since it might
# not be available on the developer's machine.
HC_OPTS += -XBangPatterns
......@@ -4,6 +4,7 @@
contributed by Bryan O'Sullivan
-}
{-# LANGUAGE BangPatterns, OverloadedStrings #-}
import Control.Monad
import Data.ByteString.Unsafe
......
......@@ -13,7 +13,7 @@ SLOW_OPTS = 25000000 # official shootout setting
# The benchmark game also uses -fllvm, which we can't since it might
# not be available on the developer's machine.
HC_OPTS += -XBangPatterns -XOverloadedStrings -package bytestring
HC_OPTS += -package bytestring
#------------------------------------------------------------------
# Create output to validate against
......
......@@ -4,6 +4,7 @@
--
-- contributed by Stephen Blackheath (with some bits taken from Don Stewart's
-- version), v1.2
{-# LANGUAGE BangPatterns #-}
import Text.Printf
import Data.ByteString.Internal
......
......@@ -11,7 +11,7 @@ CLEAN_FILES += fasta-c k-nucleotide.*stdin
# The benchmark game also uses -fllvm, which we can't since it might
# not be available on the developer's machine.
HC_OPTS += -XBangPatterns -package bytestring
HC_OPTS += -package bytestring
#------------------------------------------------------------------
# Create input
......
......@@ -10,6 +10,7 @@
--
-- Don't enable -optc-mfpmath=sse -optc-msse2, this triggers a gcc bug on x86
--
{-# LANGUAGE BangPatterns #-}
import Foreign (Ptr, Storable(..), plusPtr, mallocBytes)
import Foreign.Storable
......
......@@ -8,4 +8,4 @@ SLOW_OPTS = 50000000 # official shootout setting
# The benchmark game also uses -fllvm, which we can't since it might
# not be available on the developer's machine.
HC_OPTS += -XBangPatterns -fexcess-precision
HC_OPTS += -fexcess-precision
......@@ -4,6 +4,7 @@
-- modified by Eugene Kirpichov: pidgits only generates
-- the result string instead of printing it. For some
-- reason, this gives a speedup.
{-# LANGUAGE BangPatterns #-}
import System.Environment
......
......@@ -4,6 +4,7 @@ http://benchmarksgame.alioth.debian.org/
contributed by Louis Wasserman
-}
{-# LANGUAGE BangPatterns, MagicHash, UnboxedTuples #-}
import Control.Monad
import Foreign
......
......@@ -15,8 +15,7 @@ SLOW_OPTS = 25000000 # official shootout setting
# The benchmark game also uses -fllvm, which we can't since it might
# not be available on the developer's machine.
HC_OPTS += -XBangPatterns -funfolding-use-threshold=32 -XMagicHash \
-XUnboxedTuples
HC_OPTS += -funfolding-use-threshold=32
#------------------------------------------------------------------
# Create input
......
......@@ -13,6 +13,7 @@
-- -fexcess-precision -optc-ffast-math
-- Should be run with:
-- +RTS -N<number of cores>
{-# LANGUAGE BangPatterns, MagicHash #-}
import System.Environment
import Foreign.Marshal.Array
......
......@@ -8,4 +8,4 @@ SLOW_OPTS = 5500 # official shootout setting
# The benchmark game also uses -fllvm, which we can't since it might
# not be available on the developer's machine.
HC_OPTS += -XBangPatterns -XMagicHash -fexcess-precision
HC_OPTS += -fexcess-precision
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment