summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove obsolete `digitsTyConKey :: Unique`Herbert Valerio Riedel2014-08-171-2/+2
| | | | | | | | This became dead with 1e87c0a6e485e1dbef8e9ed19191e54f6cdc54e0 and was probably just missed. I plan to re-use the freed up `mkPreludeTyConUnique 23` slot soon for a new `bigNatTyConKey` (as part of the #9281 effort)
* Workaround GCC `__ctzdi2` intrinsic linker errorsHerbert Valerio Riedel2014-08-171-1/+17
| | | | | | | | | | | | | | | | | | | | | | | On Linux/i386 the 64bit `__builtin_ctzll()` instrinsic doesn't get inlined by GCC but rather a short `__ctzdi2` runtime function is inserted when needed into compiled object files. This causes failures for the four test-cases TEST="T8639_api T8628 dynCompileExpr T5313" with error messages of the kind dynCompileExpr: .../libraries/ghc-prim/dist-install/build/libHSghcpr_BE58KUgBe9ELCsPXiJ1Q2r.a: unknown symbol `__ctzdi2' dynCompileExpr: dynCompileExpr: unable to load package `ghc-prim' This workaround forces GCC on 32bit x86 to to express `hs_ctz64` in terms of the 32bit `__builtin_ctz()` (this is no loss, as there's no 64bit BSF instruction on i686 anyway) and thus avoid the problematic out-of-line runtime function. Note: `__builtin_ctzll()` is used since e0c1767d0ea8d12e0a4badf43682a08784e379c6 (re #9340)
* Revert "Fix typos 'resizze'"Gabor Greif2014-08-163-3/+3
| | | | | | this is z-encoding (as hvr tells me) This reverts commit 425d5178af55620efa00e6e16426f491c63ad533.
* Fix typos 'resizze'Gabor Greif2014-08-163-3/+3
|
* Implement {resize,shrink}MutableByteArray# primopsHerbert Valerio Riedel2014-08-166-0/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The two new primops with the type-signatures resizeMutableByteArray# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, MutableByteArray# s #) shrinkMutableByteArray# :: MutableByteArray# s -> Int# -> State# s -> State# s allow to resize MutableByteArray#s in-place (when possible), and are useful for algorithms where memory is temporarily over-allocated. The motivating use-case is for implementing integer backends, where the final target size of the result is either N or N+1, and only known after the operation has been performed. A future commit will implement a stateful variant of the `sizeofMutableByteArray#` operation (see #9447 for details), since now the size of a `MutableByteArray#` may change over its lifetime (i.e before it gets frozen or GCed). Test Plan: ./validate --slow Reviewers: ezyang, austin, simonmar Reviewed By: austin, simonmar Differential Revision: https://phabricator.haskell.org/D133
* Make configure's sed(1) expression for GHC_LDFLAGS more BSD-friendly.Gabor Pali2014-08-151-1/+1
|
* LlvmMangler: Be more selective when mangling object typesBen Gamari2014-08-151-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We previously did a wholesale replace of `%function` to `%object` to mangle object `.type` annotations. This is bad as it can end up replacing appearances of `"%function"` in the user's code. We now look for a proper `.type` keyword before performing the replacement. Thanks to @rwbarton for pointing out the bug. Test Plan: Previously, $ echo 'main = putStrLn "@function"' > test.hs $ ghc -fllvm test.hs $ ./test @object Now, $ echo 'main = putStrLn "@function"' > test.hs $ ghc -fllvm test.hs $ ./test @function Reviewers: rwbarton, austin Reviewed By: rwbarton, austin Subscribers: phaskell, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D150 GHC Trac Issues: #9439
* Declare `ghc-head` to be haddock's upstream branchHerbert Valerio Riedel2014-08-141-0/+1
| | | | | | | | This will affect commands such as git submodule update --remote utils/haddock to use `ghc-head` instead of the default `master` branch
* Implement new CLZ and CTZ primops (re #9340)Herbert Valerio Riedel2014-08-1417-1/+347
| | | | | | | | | | | | | | | | | | | | | | | | This implements the new primops clz#, clz32#, clz64#, ctz#, ctz32#, ctz64# which provide efficient implementations of the popular count-leading-zero and count-trailing-zero respectively (see testcase for a pure Haskell reference implementation). On x86, NCG as well as LLVM generates code based on the BSF/BSR instructions (which need extra logic to make the 0-case well-defined). Test Plan: validate and succesful tests on i686 and amd64 Reviewers: rwbarton, simonmar, ezyang, austin Subscribers: simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D144 GHC Trac Issues: #9340
* Remove out of date TODOEdward Z. Yang2014-08-131-2/+0
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Explicitly version test for package key support.Edward Z. Yang2014-08-133-1/+14
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Have ghc-pkg use an old-style package key when it's not provided.Edward Z. Yang2014-08-131-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | Summary: When this occurs, it means that the user is using an old version of Cabal. In that case, don't barf out: just go ahead and install it as an old-style package key. The user won't be able to link multiple versions together, but that should not be a problem because their Cabal can't handle it anyway. What happens if old-style are mixed up with new-style? Well, currently with Cabal, it's indistinguishable. However, if at some later point we add private dependencies, libraries compiled with old style linker names are incompatible with each other. We'll cross that road when we come to it. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: tibbe, hvr, austin Subscribers: simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D154
* StgCmmPrim: add note to stop using fixed size signed types for sizesJohan Tibell2014-08-121-0/+5
| | | | | We use fixed size signed types to e.g. represent array sizes. This means that the size can overflow.
* Add some Haddocks to SMRepJohan Tibell2014-08-121-2/+13
|
* shouldInlinePrimOp: Fix Int overflowJohan Tibell2014-08-122-24/+43
| | | | | | | | | | | | | | | | There were two overflow issues in shouldInlinePrimOp. The first one is due to a negative CmmInt literal being created if the array size was given as larger than 2^63-1 (on a 64-bit platform.) This meant that large array sizes could compare as being smaller than maxInlineAllocSize. The second issue is that we casted the Integer to an Int in the comparison, which again meant that large array sizes could compare as being smaller than maxInlineAllocSize. The attempt to allocate a large array inline then caused a segfault. Fixes #9416.
* Testsuite wibbles around #9200Richard Eisenberg2014-08-125-14/+6
|
* Update manual (#9200).Richard Eisenberg2014-08-121-43/+62
|
* Remove NonParametricKinds (#9200)Richard Eisenberg2014-08-124-226/+77
| | | | | This commit also removes 'KindCheckingStrategy' and related gubbins, instead including the notion of a CUSK into HsDecls.
* Change treatment of CUSKs for synonyms and families (#9200).Richard Eisenberg2014-08-122-5/+34
|
* Added more testing for #9200. (polykinds/T9200b)Richard Eisenberg2014-08-123-0/+17
|
* Change definition of CUSK for data and class definitions (#9200).Richard Eisenberg2014-08-122-6/+20
| | | | | Now, a CUSK is when (and only when) all type variables are annotated. This allows classes to participate in polymorphic recursion.
* Test #9200. (polykinds/T9200)Richard Eisenberg2014-08-122-0/+20
|
* Test #9415 (typecheck/should_fail/T9415)Richard Eisenberg2014-08-123-0/+14
|
* Fix #9415.Richard Eisenberg2014-08-121-1/+16
| | | | | | Abort typechecking when we detect a superclass cycle error, as ambiguity checking in the presence of superclass cycle errors can cause a loop.
* Fix Trac #9371.Richard Eisenberg2014-08-121-1/+21
| | | | | This was very simple: lists of different lengths are *maybe* apart, not *surely* apart.
* Test #9371 (indexed-types/should_fail/T9371)Richard Eisenberg2014-08-123-0/+31
|
* x86: zero extend the result of 16-bit popcnt instructions (#9435)Reid Barton2014-08-121-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The 'popcnt r16, r/m16' instruction only writes the low 16 bits of the destination register, so we have to zero-extend the result to a full word as popCnt16# is supposed to return a Word#. For popCnt8# we could instead zero-extend the input to 32 bits and then do a 32-bit popcnt, and not have to zero-extend the result. LLVM produces the 16-bit popcnt sequence with two zero extensions, though, and who am I to argue? Test Plan: - ran "make TEST=cgrun071 EXTRA_HC_OPTS=-msse42" - then ran again adding "WAY=optasm", and verified that the popcnt sequences we generate match the ones produced by LLVM for its @llvm.ctpop.* intrinsics Reviewers: austin, hvr, tibbe Reviewed By: austin, hvr, tibbe Subscribers: phaskell, hvr, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D147 GHC Trac Issues: #9435
* Add CMOVcc insns to x86 NCGHerbert Valerio Riedel2014-08-122-0/+18
| | | | | | | | | | | | | | This is a pre-requisite for implementing count-{leading,trailing}-zero prim-ops (re #9340) and may be useful to NCG to help turn some code into branch-less code sequences. Test Plan: Compiles and validates in combination with clz/ctz primop impl Reviewers: ezyang, rwbarton, simonmar, austin Subscribers: simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D141
* Add bit scan {forward,reverse} insns to x86 NCGHerbert Valerio Riedel2014-08-122-2/+10
| | | | | | | | | | | This is a pre-requisite for implementing count-{leading,trailing}-zero prim-ops (re #9340) Reviewers: ezyang, rwbarton, simonmar, austin Subscribers: simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D141
* Re-add `--no-dph` option to ./validateHerbert Valerio Riedel2014-08-121-0/+3
| | | | | | This was removed in bb003086599c2ac166cfb3aa710480713adb5a2f and caused some buildbots to stop working. So this commit just re-adds it as a no-op (wrt the current default).
* testsuite/base: update .gitignoreAustin Seipp2014-08-112-0/+3
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Unbreak travis by not passing --no-dphJoachim Breitner2014-08-111-1/+1
|
* stg/Prim.h: drop redundant #ifdefSergei Trofimovich2014-08-111-4/+0
| | | | | | | | | | | | | | | | | Summary: Noticed by Herbert Valerio Riedel Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: build test Reviewers: simonmar, austin, hvr Reviewed By: hvr Subscribers: rwbarton, phaskell, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D143
* x86: Always generate add instruction in MO_Add2 (#9013)Reid Barton2014-08-114-6/+15
| | | | | | | | | | | | | Test Plan: - ran validate - ran T9013 test with all ways - ran CarryOverflow test with all ways, for good measure Reviewers: austin, simonmar Reviewed By: simonmar Differential Revision: https://phabricator.haskell.org/D137
* Make IntAddCOp, IntSubCOp into GenericOpsReid Barton2014-08-101-57/+65
| | | | | | | | | ... in preparation for backend-specific implementations. No functional changes in this commit (except in panic messages for ill-formed Cmm). Differential Revision: https://phabricator.haskell.org/D138
* Eliminate some code duplication in x86 backend (genCCall32/64)Reid Barton2014-08-101-101/+13
| | | | | | | | | | | | | | | | | | | | | | | | Summary: No functional changes except in panic messages. These functions were identical except for - x87 operations in genCCall32 - the fallback to genCCall32'/64' - "32" vs "64" in panic messages (one case was wrong!) - minor syntactic or otherwise non-functional differences. Test Plan: Ran "validate --no-dph --slow" before and after the change. Only differences were two tests that failed before the change but not after, further investigation revealed that those tests are in fact erratic. Reviewers: simonmar, austin Reviewed By: austin Subscribers: phaskell, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D139
* Improve seq documentation; part of trac issue #9390Michael Snoyman2014-08-101-0/+7
| | | | | | | | | | | | | | | | Summary: Signed-off-by: Michael Snoyman <michael@snoyman.com> Test Plan: Review documentation change Reviewers: simonpj, austin Reviewed By: austin Subscribers: phaskell, hvr, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D136 GHC Trac Issues: #9390
* fix darwin threaded static linking by removing -lpthread option #9189Bob Ippolito2014-08-101-1/+1
| | | | | | | | | | | | | | | | Summary: Signed-off-by: Bob Ippolito <bob@redivi.com> Test Plan: See repro instructions in trac #9189 Reviewers: austin Reviewed By: austin Subscribers: phaskell, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D120 GHC Trac Issues: #9189
* rts: Remove trailing whitespace and tabs from Printer.cAustin Seipp2014-08-101-196/+196
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts/Printer.c: drop zcode mangling/demangling support in C codeSergei Trofimovich2014-08-101-147/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: GHC's RTS contains ancient Zdecode code which changed format a bit. It's easier to drop broken part and show original names. The patch changes output for './hello +RTS -Da' (apply) from such gibberish: stg_ap_v_ret... PAP/1(0x92922a, &i!_-&i!_:<.s_r=Z) stg_ap_0_ret... base:GHC.MVar.MVar(0x7fd3d1f040f8) stg_ap_v_ret... THUNK(&i!_-&i!_i!f.Z) stg_ap_v_ret... PAP/1(0x92c1f3, EO_:<.s_r=Z, EP_:<.s_r=Z) stg_ap_0_ret... ghc-prim:GHC.Tuple.(,)(0x7fd3d1f04209, 0x7fd3d1f041fa) stg_ap_0_ret... ghc-prim:GHC.Types.:(0x7fd3d1f04301, 0x7fd3d1f042ea) stg_ap_0_ret... THUNK(3F0_i!f.Z, 0x9152a1) stg_ap_0_ret... FUN/3(&s=_GHCziIOziFD_z/fB_ff=r=/IOFD14_i!f.Z) stg_ap_ppv_ret... FUN/3(&s=_GHCziIOziFD_z/fB_ff=r=/IOFD14_i!f.Z) stg_ap_0_ret... FUN/2(&s=_GHCziIOziFD_z/fIOD=vi:=FD15_i!f.Z) stg_ap_pv_ret... FUN/2(&s=_GHCziIOziFD_z/fIOD=vi:=FD15_i!f.Z) stg_ap_0_ret... base:GHC.IO.Handle.Types.FileHandle(5'A_:<.s_r=Z, 0x7fd3d1f04ef0) stg_ap_v_ret... THUNK(*>_&+_2__+/_i!f.Z, 0x7fd3d1f0602a, 0x7fd3d1f04f10) stg_ap_v_ret... PAP/1(0x7fd3d1f0602a, 0x7fd3d1f04f10) to something more readable: stg_ap_v_ret... PAP/1(0x92922a, <Main_main_closure>[0x90b710]) stg_ap_0_ret... base:GHC.MVar.MVar(0x7f1e256040f8) stg_ap_v_ret... THUNK(<Main_main_info>[0x4046c8]) stg_ap_v_ret... PAP/1(0x92c1f3, <sEO_closure>[0x90b6f0], <sEP_closure>[0x90b6d0]) stg_ap_0_ret... ghc-prim:GHC.Tuple.(,)(0x7f1e25604209, 0x7f1e256041fa) stg_ap_0_ret... ghc-prim:GHC.Types.:(0x7f1e25604301, 0x7f1e256042ea) stg_ap_0_ret... THUNK(<s3F0_info>[0x434f70], 0x9152a1) stg_ap_0_ret... FUN/3(<base_GHCziIOziFD_zdfBufferedIOFD14_info>[0x5f5198]) stg_ap_ppv_ret... FUN/3(<base_GHCziIOziFD_zdfBufferedIOFD14_info>[0x5f5198]) stg_ap_0_ret... FUN/2(<base_GHCziIOziFD_zdfIODeviceFD15_info>[0x5f7c60]) stg_ap_pv_ret... FUN/2(<base_GHCziIOziFD_zdfIODeviceFD15_info>[0x5f7c60]) stg_ap_0_ret... base:GHC.IO.Handle.Types.FileHandle(<r5qA_closure>[0x91a920], 0x7f1e25604ef0) stg_ap_v_ret... THUNK(<stg_ap_2_upd_info>[0x6b1c60], 0x7f1e2560602a, 0x7f1e25604f10) stg_ap_v_ret... PAP/1(0x7f1e2560602a, 0x7f1e25604f10) First observed on '+RTS -Di' (interpreter) on unregisterised builds. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: built 'hello world' with -debug in moth modes and ran under '+RTS -Da' Reviewers: simonmar, austin, ezyang Reviewed By: austin, ezyang Subscribers: phaskell, rwbarton, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D116
* change topHandler02/topHandler03 tests to use signal_exit_code functionKarel Gardas2014-08-101-3/+2
| | | | | | | | | | | | Test Plan: validate Reviewers: simonmar, austin Reviewed By: austin Subscribers: phaskell, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D127
* Don't build or test dph by defaultAustin Seipp2014-08-103-16/+13
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* fix T4981-V3 to avoid DOS line endingsKarel Gardas2014-08-101-44/+43
|
* fix T4981-V3 and T9208 tests for no newline at end of file warningKarel Gardas2014-08-102-2/+3
| | | | | | | | | | | | Test Plan: validated on Linux and tested on Solaris Reviewers: ezyang, austin Reviewed By: ezyang, austin Subscribers: phaskell, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D134
* fix T4201 to avoid GNU grep specific -B option by usage of pure POSIX toolsKarel Gardas2014-08-101-2/+5
| | | | | | | | | | | | Test Plan: validated on Linux and tested on Solaris Reviewers: austin Reviewed By: austin Subscribers: phaskell, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D135
* Tweak linting rules.Edward Z. Yang2014-08-101-4/+14
| | | | | | | | | | | | | | | | | | | | | | | Summary: - Removed the default text rule that was applied to all files; it produced way too many spurious warnings. For now, text lint is applied to C, Haskell and Shell. Add more if you care. - Makefiles and shell scripts had their max line length bumped a healthy amount. A pile of files still fail to lint, so these might even still be too aggressive. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: none Reviewers: hvr, austin Subscribers: simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D131
* systools info: fix warning about C compiler (message said about linker)Sergei Trofimovich2014-08-101-2/+2
| | | | | | | | | | | | | | Summary: Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: build-tested Reviewers: austin Reviewed By: austin Subscribers: phaskell, simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D132
* Clarify documentation of addIntC#, subIntC#Reid Barton2014-08-091-4/+10
|
* Add a test for plusWord2#, addIntC#, subIntC#Reid Barton2014-08-094-0/+92
|
* Remove obsolete "-- #hide" Haddock pragmasReid Barton2014-08-092-2/+0
| | | | The modules already have the modern version {-# OPTIONS_HADDOCK hide #-}.