Skip to content

Instantly share code, notes, and snippets.

View bgamari's full-sized avatar

Ben Gamari bgamari

View GitHub Profile
+ make -j9
===--- building phase 0
make --no-print-directory -f ghc.mk phase=0 phase_0_builds
make[1]: Nothing to be done for 'phase_0_builds'.
===--- building phase 1
make --no-print-directory -f ghc.mk phase=1 phase_1_builds
make[1]: Nothing to be done for 'phase_1_builds'.
===--- building final phase
make --no-print-directory -f ghc.mk phase=final all
make -C utils/haddock/doc html SPHINX_BUILD=/nix/store/yi8zqnh793fp117hlqkqvcd4kghwk44a-ghc-build-environment/bin/sphinx-build

STG Registers

STG amd64 ARM description


Base r13 Base register (StgRegTable*) Sp rbp Stack pointer SpLim r15 Stack limit Hp r12 Heap pointer R1 rbx Current closure, return value R2 r14 arg1

import Control.Concurrent
import Control.Concurrent.STM
import Criterion.Main
import Data.IORef
main = do
mv <- newMVar ()
tv <- newTMVarIO ()
ir <- newIORef ()
module Hello where
import Clash.Prelude
{-# ANN maybeTest (defTop { t_name = "test"
, t_inputs = [PortName "hi"]
, t_output = PortName "out"}) #-}
maybeTest :: Signal clk (Unsigned 32) -> Signal clk (Unsigned 16) -> Signal clk (Unsigned 32)
maybeTest x y = x
@bgamari
bgamari / complete-cabal.py
Last active November 21, 2017 15:58
A bash completion script for cabal-install
#!/usr/bin/python3
"""
Configure with
complete -C /path/to/script cabal
"""
import os.path
import json
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE RecursiveDo #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
module StreamSignal ( Stream(..), streamSignal, applying ) where
import Debug.Trace
import Data.Maybe
import System.IO
import qualified Data.List as L
#!/bin/bash -e
name=$(sed -n -e 's/^[nN]ame:\s\+\(.\+\)/\1/p' *.cabal)
old_ver=$(sed -n -e 's/^[vV]ersion:\s\+\(.\+\)/\1/p' *.cabal)
has_docs=1
grep -i '^Library' *.cabal || has_docs=0
echo "Package name: $name"
echo "Current version: $old_ver"
echo "Has documentation: $has_docs"
@bgamari
bgamari / gist:fbd3e55047bd041d8208ebe820c0f493
Last active April 11, 2017 22:56
Nofib characterization of GHC 7.6, 7.8, 7.10, 8.0, and 8.2.1-rc1
NoFib Results
--------------------------------------------------------------------------------
Program Size Size Size Size Size Size Size Allocs Allocs Allocs Allocs Allocs Allocs Allocs Runtime Runtime Runtime Runtime Runtime Runtime Runtime Elapsed Elapsed Elapsed Elapsed Elapsed Elapsed Elapsed TotalMem TotalMem TotalMem TotalMem TotalMem TotalMem TotalMem
7.6.3.log 7.8.4.log 7.10.3.lo 8.0.1.log 8.2.1-hea 8.2.1-rc1 nofib-ana 7.6.3.log 7.8.4.log 7.10.3.lo 8.0.1.log 8.2.1-hea 8.2.1-rc1 nofib-ana 7.6.3.log 7.8.4.log 7.10.3.lo 8.0.1.log 8.2.1-hea 8.2.1-rc1 nofib-ana 7.6.3.log 7.8.4.log 7.10.3.lo 8.0.1.log 8.2.1-hea 8.2.1-rc1 nofib-ana 7.6.3.log 7.8.4.log 7.10.3.lo 8.0.1.log 8.2.1-hea 8.2.1-rc1 nofib-ana
--------------------------------------------------------------------------------
anna -0.9% +0.6% +3.5% ----- +206.2% +0.3% ----- +1.0%
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
import GHC.Prim
import GHC.Float
main :: IO ()
main = do
let x = broadcastDoubleX4# 42.0##
y = broadcastDoubleX4# 52.0##
z = addIt x y