Skip to content
Snippets Groups Projects
  1. Oct 22, 2015
    • Erik de Castro Lopo's avatar
      nativeGen PPC: fix > 16 bit offsets in stack handling · 4093e6da
      Erik de Castro Lopo authored and Ben Gamari's avatar Ben Gamari committed
      Back port of Peter Trommler's patch from master (19dae027cb) to the
      7.10 branch. Peter's commit does not apply to the 7.10 branch because
      PowerPC64 was added to master after the 7.10 branch was started.
      
      Comments from the original commit:
      Implement access to spill slots at offsets larger than 16 bits.
      Also allocation and deallocation of spill slots was restricted to
      16 bit offsets. Now 32 bit offsets are supported on all PowerPC
      platforms.
      
      The implementation of 32 bit offsets requires more than one instruction
      but the native code generator wants one instruction. So we implement
      pseudo-instructions that are pretty printed into multiple assembly
      instructions.
      
      With pseudo-instructions for spill slot allocation and deallocation
      we can also implement handling of the back chain pointer according
      to the ELF ABIs.
      4093e6da
    • rasen's avatar
      Make headers C++ compatible (fixes #10700) · 284a4317
      rasen authored and Ben Gamari's avatar Ben Gamari committed
      Some headers used `new` as parameter name, which is reserved word in
      C++. This patch changes these names to `new_`.
      
      Test Plan: validate
      
      Reviewers: austin, ezyang, bgamari, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1107
      
      GHC Trac Issues: #10700
      284a4317
  2. Oct 04, 2015
    • Erik de Castro Lopo's avatar
      nativeGen PPC: fix > 16 bit offsets in stack handling · e22d7dc4
      Erik de Castro Lopo authored and Ben Gamari's avatar Ben Gamari committed
      Back port of Peter Trommler's patch from master (19dae027cb) to the
      7.10 branch. Peter's commit does not apply to the 7.10 branch because
      PowerPC64 was added to master after the 7.10 branch was started.
      
      Comments from the original commit:
      Implement access to spill slots at offsets larger than 16 bits.
      Also allocation and deallocation of spill slots was restricted to
      16 bit offsets. Now 32 bit offsets are supported on all PowerPC
      platforms.
      
      The implementation of 32 bit offsets requires more than one instruction
      but the native code generator wants one instruction. So we implement
      pseudo-instructions that are pretty printed into multiple assembly
      instructions.
      
      With pseudo-instructions for spill slot allocation and deallocation
      we can also implement handling of the back chain pointer according
      to the ELF ABIs.
      e22d7dc4
  3. Oct 03, 2015
  4. Jun 26, 2015
    • rwbarton's avatar
      Be aware of overlapping global STG registers in CmmSink (#10521) · 7707e54c
      rwbarton authored
      Summary:
      On x86_64, commit e2f6bbd3 assigned
      the STG registers F1 and D1 the same hardware register (xmm1), and
      the same for the registers F2 and D2, etc. When mixing calls to
      functions involving Float#s and Double#s, this can cause wrong Cmm
      optimizations that assume the F1 and D1 registers are independent.
      
      Reviewers: simonpj, austin
      
      Reviewed By: austin
      
      Subscribers: simonpj, thomie, bgamari
      
      Differential Revision: https://phabricator.haskell.org/D993
      
      GHC Trac Issues: #10521
      
      (cherry picked from commit a2f828a3)
      7707e54c
  5. Jun 01, 2015
  6. May 19, 2015
  7. Feb 23, 2015
  8. Jan 19, 2015
  9. Dec 23, 2014
  10. Dec 22, 2014
  11. Dec 15, 2014
  12. Dec 14, 2014
    • Sergei Trofimovich's avatar
      powerpc: fix and enable shared libraries by default on linux · fa31e8f4
      Sergei Trofimovich authored
      
      Summary:
      And fix things all the way down to it. Namely:
          - remove 'r30' from free registers, it's an .LCTOC1 register
            for gcc. generated .plt stubs expect it to be initialised.
          - fix PicBase computation, which originally forgot to use 'tmp'
            reg in 'initializePicBase_ppc.fetchPC'
          - mark 'ForeighTarget's as implicitly using 'PicBase' register
            (see comment for details)
          - add 64-bit MO_Sub and test on alloclimit3/4 regtests
          - fix dynamic label offsets to match with .LCTOC1 offset
      
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      
      Test Plan: validate passes equal amount of vanilla/dyn tests
      
      Reviewers: simonmar, erikd, austin
      
      Reviewed By: erikd, austin
      
      Subscribers: carter, thomie
      
      Differential Revision: https://phabricator.haskell.org/D560
      
      GHC Trac Issues: #8024, #9831
      fa31e8f4
  13. Dec 10, 2014
    • Joachim Breitner's avatar
      Link pre-ARMv6 spinlocks into all RTS variants · df1307f0
      Joachim Breitner authored
      Summary:
      For compatibility with ARM machines from pre v6, the RTS provides
      implementations of certain atomic operations. Previously, these
      were only included in the threaded RTS.
      
      But ghc (the library) contains the code in compiler/cbits/genSym.c, which
      uses these operations if there is more than one capability. But there is only
      one libHSghc, so the linker wants to resolve these symbols in every case.
      
      By providing these operations in all RTSs, the linker is happy. The only
      downside is a small amount of dead code in the non-threaded RTS on old ARM
      machines.
      
      Test Plan: It helped here.
      
      Reviewers: bgamari, austin
      
      Reviewed By: bgamari, austin
      
      Subscribers: carter, thomie
      
      Differential Revision: https://phabricator.haskell.org/D564
      
      GHC Trac Issues: #8951
      df1307f0
    • Facundo Domínguez's avatar
      Implement -XStaticValues · fc45f324
      Facundo Domínguez authored
      Summary:
      As proposed in [1], this extension introduces a new syntactic form
      `static e`, where `e :: a` can be any closed expression. The static form
      produces a value of type `StaticPtr a`, which works as a reference that
      programs can "dereference" to get the value of `e` back. References are
      like `Ptr`s, except that they are stable across invocations of a
      program.
      
      The relevant wiki pages are [2, 3], which describe the motivation/ideas
      and implementation plan respectively.
      
      [1] Jeff Epstein, Andrew P. Black, and Simon Peyton-Jones. Towards
      Haskell in the cloud. SIGPLAN Not., 46(12):118–129, September 2011. ISSN
      0362-1340.
      [2] https://ghc.haskell.org/trac/ghc/wiki/StaticPointers
      [3] https://ghc.haskell.org/trac/ghc/wiki/StaticPointers/ImplementationPlan
      
      
      
      Authored-by: default avatarFacundo Domínguez <facundo.dominguez@tweag.io>
      Authored-by: default avatarMathieu Boespflug <m@tweag.io>
      Authored-by: default avatarAlexander Vershilov <alexander.vershilov@tweag.io>
      
      Test Plan: `./validate`
      
      Reviewers: hvr, simonmar, simonpj, austin
      
      Reviewed By: simonpj, austin
      
      Subscribers: qnikst, bgamari, mboes, carter, thomie, goldfire
      
      Differential Revision: https://phabricator.haskell.org/D550
      
      GHC Trac Issues: #7015
      fc45f324
  14. Dec 05, 2014
  15. Dec 02, 2014
    • Simon Peyton Jones's avatar
      Revert "Add purgeObj() to remove the symbol table entries for an object" · 7932b2ad
      Simon Peyton Jones authored
      This reverts commit 9e6e4796.
      
      I reverted it because one of these two patches
        9e6e4796 Add purgeObj()
        b5e8b3b1 Make the linker API thread-safe
      
      causes a seg-fault on Windows.  The seg-fault happens immediately
      the linker is invoked, in ghci or in Template Haskell.
      
      I believe that it is the "linker API thread-safe" commit that causes
      the seg-fault; it happens even if the "purgeObj" commit alone is
      reverted.  But since the two patches mess with the same code, to
      revert the "linker API" patch I had revert both.
      7932b2ad
  16. Nov 28, 2014
    • Simon Marlow's avatar
      Add purgeObj() to remove the symbol table entries for an object · 9e6e4796
      Simon Marlow authored
      This allows us to replace an object without actually unloading the old
      object, which is necessary when we know we have references to the old
      object so it can't be completely unloaded.  Using unloadObj() would
      cause the GC (CheckUnload) to repeatedly and fruitlessly try to unload
      the old object.
      9e6e4796
  17. Nov 25, 2014
    • Simon Marlow's avatar
      Add +RTS -n<size>: divide the nursery into chunks · 452eb80f
      Simon Marlow authored
      See the documentation for details.
      452eb80f
    • Simon Marlow's avatar
      Make clearNursery free · e22bc0de
      Simon Marlow authored
      Summary:
      clearNursery resets all the bd->free pointers of nursery blocks to
      make the blocks empty.  In profiles we've seen clearNursery taking
      significant amounts of time particularly with large -N and -A values.
      
      This patch moves the work of clearNursery to the point at which we
      actually need the new block, thereby introducing an invariant that
      blocks to the right of the CurrentNursery pointer still need their
      bd->free pointer reset.  This should make things faster overall,
      because we don't need to clear blocks that we don't use.
      
      Test Plan: validate
      
      Reviewers: AndreasVoellmy, ezyang, austin
      
      Subscribers: thomie, carter, ezyang, simonmar
      
      Differential Revision: https://phabricator.haskell.org/D318
      e22bc0de
  18. Nov 24, 2014
    • Ömer Sinan Ağacan's avatar
      accessors to RTS flag values -- #5364 · 1617a10a
      Ömer Sinan Ağacan authored
      Summary: Implementation of #5364. Mostly boilerplate, reading FILE fields is missing.
      
      Test Plan:
      - Get some feedback on missing parts. (FILE fields)
      - Get some feedback on module name.
      - Get some feedback on other things.
      - Get code reviewed.
      - Make sure test suite is passing. (I haven't run it myself)
      
      Reviewers: hvr, austin, ezyang
      
      Reviewed By: ezyang
      
      Subscribers: ekmett, simonmar, ezyang, carter, thomie
      
      Differential Revision: https://phabricator.haskell.org/D306
      
      GHC Trac Issues: #5364
      
      Conflicts:
      	includes/rts/Flags.h
      1617a10a
  19. Nov 19, 2014
  20. Nov 12, 2014
    • Sergei Trofimovich's avatar
      includes/Stg.h: define _DEFAULT_SOURCE for glibc-2.20 · c65221bd
      Sergei Trofimovich authored
      
      _BSD_SOURCE we are using for 'gamma()' and friends
      was deprecated in glibc-2.20 in favour of '_DEFAULT_SOURCE'.
      
      gcc says:
      
          In file included from /usr/include/math.h:26:0:
              0,
                               from includes/Stg.h:69,
                               from /tmp/ghc19488_0/ghc19488_2.hc:3:
      
          /usr/include/features.h:148:3:
               warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
               # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
                 ^
      
      Patch fixes testsuite failures on UNREG
      (stderr are not cluttered by warnings anymore).
      
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      c65221bd
    • Simon Marlow's avatar
      Per-thread allocation counters and limits · d70b19bf
      Simon Marlow authored
      This reverts commit f0fcc41d.
      
      New changes: now works on 32-bit platforms too.  I added some basic
      support for 64-bit subtraction and comparison operations to the x86
      NCG.
      d70b19bf
  21. Oct 20, 2014
  22. Oct 10, 2014
  23. Oct 08, 2014
    • Simon Marlow's avatar
      Make the linker more robust to errors · 5300099e
      Simon Marlow authored
      Summary:
      When linking fails because there was a problem with the supplied
      object file, then we should not barf() or exit, we should emit a
      suitable error message and return an error code to the caller.  We
      should also free all memory that might have been allocated during
      linking, and generally not do any damage.  This patch fixes most
      common instances of this problem.
      
      Test Plan: validate
      
      Reviewers: rwbarton, austin, ezyang
      
      Reviewed By: ezyang
      
      Subscribers: simonmar, ezyang, carter, thomie
      
      Differential Revision: https://phabricator.haskell.org/D294
      5300099e
  24. Oct 05, 2014
    • Herbert Valerio Riedel's avatar
      Implement `MIN_VERSION_GLASGOW_HASKELL()` macro · 3549c952
      Herbert Valerio Riedel authored
      This exposes the `cProjectPatchLevel{1,2}` value at the CPP level to
      allow it to be used in CPP conditionals. Concretely, GHC 7.10.2.20150623
      would result in
      
        #define __GLASGOW_HASKELL__             710
        #define __GLASGOW_HASKELL_PATCHLEVEL1__ 2
        #define __GLASGOW_HASKELL_PATCHLEVEL2__ 20150623
      
      while GHC 7.10.3 results in
      
        #define __GLASGOW_HASKELL__             710
        #define __GLASGOW_HASKELL_PATCHLEVEL1__ 3
      
      and finally GHC 7.9.20141009 results in
      
        #define __GLASGOW_HASKELL__             709
        #define __GLASGOW_HASKELL_PATCHLEVEL1__ 20141009
      
      As it's error-prone to properly express CPP conditionals for testing GHC
      multi-component versions, a new macro `MIN_VERSION_GLASGOW_HASKELL()` is
      provided (also via the new CPP include file `ghcversion.h`)
      
      Finally, in order to make it easier to define the new CPP macro
      `MIN_VERSION_GLASGOW_HASKELL()`, a new default-included
      `include/ghcversion.h` is used for the new CPP definitions.
      
      Reviewed By: ekmett, austin, #ghc
      
      Differential Revision: https://phabricator.haskell.org/D66
      3549c952
  25. Oct 02, 2014
    • Edward Z. Yang's avatar
      Rename _closure to _static_closure, apply naming consistently. · 35672072
      Edward Z. Yang authored
      
      Summary:
      In preparation for indirecting all references to closures,
      we rename _closure to _static_closure to ensure any old code
      will get an undefined symbol error.  In order to reference
      a closure foobar_closure (which is now undefined), you should instead
      use STATIC_CLOSURE(foobar).  For convenience, a number of these
      old identifiers are macro'd.
      
      Across C-- and C (Windows and otherwise), there were differing
      conventions on whether or not foobar_closure or &foobar_closure
      was the address of the closure.  Now, all foobar_closure references
      are addresses, and no & is necessary.
      
      CHARLIKE/INTLIKE were not changed, simply alpha-renamed.
      
      Part of remove HEAP_ALLOCED patch set (#8199)
      
      Depends on D265
      
      Signed-off-by: default avatarEdward Z. Yang <ezyang@mit.edu>
      
      Test Plan: validate
      
      Reviewers: simonmar, austin
      
      Subscribers: simonmar, ezyang, carter, thomie
      
      Differential Revision: https://phabricator.haskell.org/D267
      
      GHC Trac Issues: #8199
      35672072
  26. Oct 01, 2014
  27. Sep 29, 2014
  28. Sep 24, 2014
  29. Sep 17, 2014
    • Herbert Valerio Riedel's avatar
      Implement `decodeDouble_Int64#` primop · b62bd5ec
      Herbert Valerio Riedel authored
      The existing `decodeDouble_2Int#` primop is rather inconvenient to use
      (and in fact is not even used by `integer-gmp`) as the mantissa is split
      into 3 components which would actually fit in an `Int64#` value.
      
      However, `decodeDouble_Int64#` is to be used by the new `integer-gmp2`
      re-implementation (see #9281).
      
      Moreover, `decodeDouble_2Int#` performs direct bit-wise operations on the
      IEEE representation which can be replaced by a combination of the
      portable standard C99 `scalbn(3)` and `frexp(3)` functions.
      
      Differential Revision: https://phabricator.haskell.org/D160
      b62bd5ec
  30. Sep 16, 2014
    • AndreasVoellmy's avatar
      Revert "Revert "rts/base: Fix #9423"" and resolve issue that caused the revert. · 7e658bc1
      AndreasVoellmy authored
      Summary:
      This reverts commit 4748f593. The fix for #9423
      was reverted because this commit introduced a C function setIOManagerControlFd()
      (defined in Schedule.c) defined for all OS types, while the prototype
      (in includes/rts/IOManager.h) was only included when mingw32_HOST_OS is
      not defined. This broke Windows builds.
      
      This commit reverts the original commit and resolves the problem by only defining
      setIOManagerControlFd() when mingw32_HOST_OS is defined. Hence the missing prototype
      error should not occur on Windows.
      
      In addition, since the io_manager_control_wr_fd field of the Capability struct is only
      usd by the setIOManagerControlFd, this commit includes the io_manager_control_wr_fd
      field in the Capability struct only when mingw32_HOST_OS is not defined.
      
      Test Plan: Try to compile successfully on all platforms.
      
      Reviewers: austin
      
      Reviewed By: austin
      
      Subscribers: simonmar, ezyang, carter
      
      Differential Revision: https://phabricator.haskell.org/D174
      7e658bc1
  31. Sep 01, 2014
  32. Aug 28, 2014
Loading