1. 21 Mar, 2019 1 commit
    • jberryman's avatar
      Rough working LTO · 6f369534
      jberryman authored
      Very rough and hacky, with some hacks unnecessary but which I haven't
      taken the time to sort out yet.
      
      you need to make sure you have the lto plugin set up correctly, e.g.:
      
        $ cd /usr/lib/bfd-plugins/
        $ sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/6/liblto_plugin.so .
      
      then do:
      
         $ export PATH=SHIMS_PATH:$PATH
         $ LD=gold  CC_STAGE0=gcc CC=gcc ./configure
         $ make
      
      You should adjust your path in the same way when building with this GHC,
      and you can do e.g.
      
        $ cabal new-build --disable-profiling --disable-library-profiling --with-compiler=your-ghc-source-tree/inplace/bin/ghc-stage2 --package-db=your-ghc-source-tree/inplace/lib/package.conf.d all
      
      You can see `-time` log in gcc shim file, play with recompilation
      options there.
      6f369534
  2. 24 Apr, 2018 1 commit
  3. 26 Mar, 2018 1 commit
  4. 08 Mar, 2018 2 commits
  5. 03 Feb, 2018 1 commit
    • Ben Gamari's avatar
      ghc-prim: Emulate C11 atomics when not available · 217e4170
      Ben Gamari authored
      GCC's __sync primitives apparently "usually" imply a full barrier,
      meaning they can be used to emulate the more precise C11 atomics albeit
      with a loss of efficiency. This restores compatibility with GCC 4.4.
      
      This partially reverts commit 59de2909.
      
      Test Plan: Validate on Centos
      
      Reviewers: hvr, simonmar, trommler
      
      Subscribers: rwbarton, thomie, erikd, carter
      
      GHC Trac Issues: #14244
      
      Differential Revision: https://phabricator.haskell.org/D4364
      217e4170
  6. 02 Nov, 2017 1 commit
    • Peter Trommler's avatar
      Fix atomicread/write operations · bd765f4b
      Peter Trommler authored
      In `libraries/ghc-prim/cbits/atomic.c` no barriers were issued for
      atomic read and write operations. Starting with gcc 4.7 compiler
      intrinsics are offered. The atomic intrinisics are also available in
      clang. Use these to implement `hs_atomicread*` and `hs_atomicwrite`.
      
      Test Plan: validate on OSX and Windows
      
      Reviewers: austin, bgamari, simonmar, hvr, erikd, dfeuer
      
      Reviewed By: bgamari
      
      Subscribers: dfeuer, rwbarton, thomie
      
      GHC Trac Issues: #14244
      
      Differential Revision: https://phabricator.haskell.org/D4009
      bd765f4b
  7. 02 Oct, 2015 1 commit
    • Andreas Schwab's avatar
      Fix signature of atomic builtins · e3d2bab8
      Andreas Schwab authored
      This patch is due to Andreas Schwab.
      
      This fixes #10926, which reports (on AArch64) errors of the form,
      
      ```
      /tmp/ghc1492_0/ghc_1.hc:2844:25: warning: passing argument 1 of
      'hs_atomic_xor64' makes pointer from integer without a cast
      [-Wint-conversion]
           _c1Ho = hs_atomic_xor64((*Sp) + (((Sp[1]) << 0x3UL) + 0x10UL), Sp[2]);
                                   ^
      
      In file included from
      /home/abuild/rpmbuild/BUILD/ghc-7.10.2/includes/Stg.h:273:0: 0,
                       from /tmp/ghc1492_0/ghc_1.hc:3:
      
      /home/abuild/rpmbuild/BUILD/ghc-7.10.2/includes/stg/Prim.h:41:11:
           note: expected 'volatile StgWord64 *
                 {aka volatile long unsigned int *}'
                 but argument is of type 'long unsigned int'
           StgWord64 hs_atomic_xor64(volatile StgWord64 *x, StgWord64 val);
                     ^
      ```
      
      Test Plan: Validate
      
      Reviewers: austin, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1300
      
      GHC Trac Issues: #10926
      e3d2bab8
  8. 10 Mar, 2015 1 commit
    • Erik de Castro Lopo's avatar
      ghc-prim : Hide 64 bit primops when the word size is 32 bits (fixes #9886). · 19440ae2
      Erik de Castro Lopo authored
      Summary:
      These primops were failing to compile on PowerPC (32 bit). There is also
      currently no way to call into these primops from Haskell code. Currently,
      the *only* way to call any of these C hs_atomic_* functions is via the
      fetch*IntArray primops which are only defined for Int values and Int is
      always the native word size.
      
      When these functions can be called (and tested) from Haskell code, then
      it will be worth while implementing them.
      
      Test Plan:
          Compile and run on x86, x86_64, powerpc and arm:
          testsuite/tests/concurrent/should_run/AtomicPrimops.hs
      
      Reviewers: tibbe, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D702
      
      GHC Trac Issues: #9886
      19440ae2
  9. 30 Jun, 2014 1 commit
    • tibbe's avatar
      Re-add more primops for atomic ops on byte arrays · 4ee4ab01
      tibbe authored
      This is the second attempt to add this functionality. The first
      attempt was reverted in 950fcae4, due
      to register allocator failure on x86. Given how the register
      allocator currently works, we don't have enough registers on x86 to
      support cmpxchg using complicated addressing modes. Instead we fall
      back to a simpler addressing mode on x86.
      
      Adds the following primops:
      
       * atomicReadIntArray#
       * atomicWriteIntArray#
       * fetchSubIntArray#
       * fetchOrIntArray#
       * fetchXorIntArray#
       * fetchAndIntArray#
      
      Makes these pre-existing out-of-line primops inline:
      
       * fetchAddIntArray#
       * casIntArray#
      4ee4ab01
  10. 26 Jun, 2014 2 commits
  11. 24 Jun, 2014 1 commit
    • tibbe's avatar
      Add more primops for atomic ops on byte arrays · d8abf85f
      tibbe authored
      Summary:
      Add more primops for atomic ops on byte arrays
      
      Adds the following primops:
      
       * atomicReadIntArray#
       * atomicWriteIntArray#
       * fetchSubIntArray#
       * fetchOrIntArray#
       * fetchXorIntArray#
       * fetchAndIntArray#
      
      Makes these pre-existing out-of-line primops inline:
      
       * fetchAddIntArray#
       * casIntArray#
      d8abf85f