| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Implement constant folding rules for Natural (similar to Integer ones)
* Add mkCoreUbxSum helper in GHC.Core.Make
* Remove naturalTo/FromInt
We now only provide `naturalTo/FromWord` as
the semantics is clear (truncate/zero-extend). For Int we have to deal
with negative numbers (throw an exception? convert to Word
beforehand?) so we leave the decision about what to do to the caller.
Moreover, now that we have sized types (Int8#, Int16#, ..., Word8#,
etc.) there is no reason to bless `Int#` more than `Int8#` or `Word8#`
(for example).
* Replaced a few `()` with `(# #)`
|
|
|
|
|
|
|
| |
Incidentally fix powModInteger which was crashing in integer-gmp for
negative exponents when the modular multiplicative inverse for the base
didn't exist. Now we compute it explicitly with integerRecipMod so that
every backend returns the same result without crashing.
|
| |
|
|
|
|
| |
Reimplementation of integer-gmp's byteArrayToBigNat#
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Also enhance bigNatCheck# and isValidNatural test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this patch BigNat names were confusing because we had:
* GHC.Num.BigNat.BigNat: unlifted type used everywhere else
* GHC.Num.BigNat.BigNatW: lifted type only used to share static constants
* GHC.Natural.BigNat: lifted type only used for backward compatibility
After this patch we have:
* GHC.Num.BigNat.BigNat#: unlifted type
* GHC.Num.BigNat.BigNat: lifted type (reexported from GHC.Natural)
Thanks to @RyanGlScott for spotting this.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ghc-bignum is a newer package that aims to replace the legacy
integer-simple and integer-gmp packages.
* it supports several backends. In particular GMP is still supported and
most of the code from integer-gmp has been merged in the "gmp"
backend.
* the pure Haskell "native" backend is new and is much faster than the
previous pure Haskell implementation provided by integer-simple
* new backends are easier to write because they only have to provide a
few well defined functions. All the other code is common to all
backends. In particular they all share the efficient small/big number
distinction previously used only in integer-gmp.
* backends can all be tested against the "native" backend with a simple
Cabal flag. Backends are only allowed to differ in performance, their
results should be the same.
* Add `integer-gmp` compat package: provide some pattern synonyms and
function aliases for those in `ghc-bignum`. It is intended to avoid
breaking packages that depend on `integer-gmp` internals.
Update submodules: text, bytestring
Metric Decrease:
Conversions
ManyAlternatives
ManyConstructors
Naperian
T10359
T10547
T10678
T12150
T12227
T12234
T12425
T13035
T13719
T14936
T1969
T4801
T4830
T5237
T5549
T5837
T8766
T9020
parsing001
space_leak_001
T16190
haddock.base
On ARM and i386, T17499 regresses (+6% > 5%).
On x86_64 unregistered, T13701 sometimes regresses (+2.2% > 2%).
Metric Increase:
T17499
T13701
|
| |
|
|
|
|
| |
Document and use simpler rules for the ghc-gmp.h header.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Hadrian doesn't use integer-gmp/config.mk file anymore to determine if
building GMP in-tree is required.
"config.mk" is created by Cabal when the integer-gmp package is
configured and this file is still untracked by Hadrian. This led to a
tricky configure "race" because "config.mk" is built by the
"setup-config" rule, but this rule is also used to find dependencies,
in particular the "ghc-gmp.h" header, but the creation of this file
was depending (without being tracked) on "config.mk".
Now Hadrian only builds in-tree GMP if `--with-intree-gmp` is passed
to the top-level configure script.
* in-tree GMP isn't built once for all in a fixed stage (Stage1)
anymore. It is built per stage which is required if we build a
cross-compiler
* switching between in-tree and external GMP is now supported without
having to clean the build directory first.
* "wrappers.c" now includes "ghc-gmp.h" instead of "ghc.h". It
helps ensuring that the build system generates "ghc-gmp.h".
* build in-tree GMP in "<root>/stageN/gmp/gmpbuild" and produce useful
artefacts (libgmp.a, gmp.h, objs/*.o) in "<root>/stageN/gmp"
|
|
|
|
| |
-L is only needed during linking.
|
|
|
|
| |
Update haddock submodule
|
| |
|
|
|
|
|
| |
Configure intree GMP with `--with-pic` instead of patching it. Moreover
the correct patching was only done for x86_64/darwin (see #17799).
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Previously the `integer-gmp` variant of `isValidNatural` would fail to
detect values `<= maxBound::Word` that were incorrectly encoded using
the `NatJ#` constructor.
|
|
|
|
| |
Scripts taken from autoconf a8d79c3130da83c7cacd6fee31b9acc53799c406
|
|
|
|
|
|
|
| |
Using `ghc-prim <= 0.6.1` is somewhat dodgy from a PVP point of view,
as it makes it awkward to support new minor releases of `ghc-prim`.
Let's instead use `< 0.7`, which is the idiomatic way of expressing
PVP-compliant upper version bounds.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This moves all URL references to Trac Wiki to their corresponding
GitLab counterparts.
This substitution is classified as follows:
1. Automated substitution using sed with Ben's mapping rule [1]
Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...
New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...
2. Manual substitution for URLs containing `#` index
Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...#Zzz
New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...#zzz
3. Manual substitution for strings starting with `Commentary`
Old: Commentary/XxxYyy...
New: commentary/xxx-yyy...
See also !539
[1]: https://gitlab.haskell.org/bgamari/gitlab-migration/blob/master/wiki-mapping.json
|
|
|
|
|
| |
This moves all URL references to Trac tickets to their corresponding
GitLab counterparts.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move implementation notes for Integer to Haddock named section
Revert documentation named chunk change [skip ci]
Haddock's named chunk feature was not used correctly in this case,
as it cannot export only parts of a Haddock top level comment.
As such, it was removed and replaced by a message informing the end-
user to browse the source code for detailed information.
|
|
|
|
|
|
| |
Although we should use 'AC_ARG_ENABLE' for boolean flags, it also
means options get named '--enable-*', not '--with-*'. This should
unbreak the --with-intree-gmp option.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This adds top-level configure flags '--with-intree-gmp' and
'--with-framework-preferred', both of which are especially relevant
on MacOS.
Besides gaining two new flags, Hadrian also had to be taught what to
do with the 'framework' in .cabal files.
Test Plan:
./boot && ./configure --with-intree-gmp && ./hadrian/build.sh
./boot && ./configure --with-gmp-framework-preferred && ./hadrian/build.sh # on macos
Reviewers: carter, snowleopard, alpmestan, hvr, goldfire, bgamari
Subscribers: rwbarton, erikd
GHC Trac Issues: #16001
Differential Revision: https://phabricator.haskell.org/D5417
|
|
|
|
|
|
|
|
| |
In `integer-simple`:
* Added an efficient `popCountInteger` and `bitInteger`
* Added an efficient `gcdInteger` and `lcmInteger`
* Made `testBitInteger` more efficient
|
|
|
|
| |
GHC Trac Issues: #15447
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: hvr, bgamari, monoidal
Reviewed By: monoidal
Subscribers: rwbarton, carter
GHC Trac Issues: #15350
Differential Revision: https://phabricator.haskell.org/D5091
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
We have more and more users of GHC as a library, for example the
Haskell-to-WebAssembly-compiler https://github.com/tweag/asterius.
These need to make different decisions about various aspects of
code generation than the host compiler, and ideally GHC-the-library
allows them to set the `DynFlags` as needed.
This patch adds a new `DynFlag` that configures which `integer`
library to use. This flag is initialized by `cIntegerLibraryType`
(as before), and is only used in `CorePrep` to decide whether to
use `S#` or not.
The other code paths that were varying based on `cIntegerLibraryType`
are no now longer varying: The trick is to use `integer-wired-in`
as the `-this-unit-id` when compiling either `integer-gmp` or
`integer-simple`.
Test Plan: Validate is happy.
Reviewers: hvr, bgamari
Reviewed By: bgamari
Subscribers: TerrorJack, adamse, simonpj, rwbarton, carter
GHC Trac Issues: #13477
Differential Revision: https://phabricator.haskell.org/D5079
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: hvr, bgamari, monoidal
Reviewed By: monoidal
Subscribers: monoidal, rwbarton, thomie, carter
GHC Trac Issues: #15350
Differential Revision: https://phabricator.haskell.org/D5042
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* All the tests in tests/ghci.debugger now pass with
-fexternal-interpreter. These tests are now run with the ghci-ext way
in addition to the normal way so we won't break it in the future.
* I removed all the unsafeCoerce# calls from RtClosureInspect. Yay!
The main changes are:
* New messages: GetClosure and Seq. GetClosure is a remote interface to
GHC.Exts.Heap.getClosureData, which required Binary instances for
various datatypes. Fortunately this wasn't too painful thanks to
DeriveGeneric.
* No cheating by unsafeCoercing values when printing them. Now we have
to turn the Closure representation back into the native representation
when printing Int, Float, Double, Integer and Char. Of these, Integer
was the most painful - we now have a dependency on integer-gmp due to
needing access to the representation.
* Fixed a bug in rts/Heap.c - it was bogusly returning stack content as
pointers for an AP_STACK closure.
Test Plan:
* `cd testsuite/tests/ghci.debugger && make`
* validate
Reviewers: bgamari, patrickdoc, nomeata, angerman, hvr, erikd, goldfire
Subscribers: alpmestan, snowleopard, rwbarton, thomie, carter
GHC Trac Issues: #13184
Differential Revision: https://phabricator.haskell.org/D4955
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This takes care of bumping the `base` and `integer-gmp`
minor version numbers in anticipation of a GHC 8.4.2 release.
While I was in town, I also filled in a `@since TODO` Haddock
annotation for `powModSecInteger` in `integer-gmp` with
`1.0.2.0`, and updated the changelog accordingly.
Test Plan: ./validate
Reviewers: hvr, goldfire, bgamari
Reviewed By: bgamari
Subscribers: thomie, carter
GHC Trac Issues: #15025
Differential Revision: https://phabricator.haskell.org/D4586
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Here's how the rube goldberg machine triggered the old bug:
1. If you have a file gmp/config.mk.in, then Cabal will
create a generated file in $DIST/build/gmp/config.mk
2. When you attempt to load inplace integer-gmp via GHCi, it will
ask gcc (aka clang on OS X) for the file name of 'gmp', with
base directory set to $DIST/build
3. There is a folder named 'gmp', and so this folder is returned
as the 'library' for gmp
4. GHCi loadArchive chokes to death trying to open a library
that is actually a folder
This patch solves the problem by breaking the chain at (1): if we
don't put config.mk in a folder named gmp, NO PROBLEM.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Test Plan: validate
Reviewers: angerman, hvr, bgamari
Reviewed By: angerman
Subscribers: erikd, thomie, carter
GHC Trac Issues: #14972
Differential Revision: https://phabricator.haskell.org/D4552
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: hvr
Subscribers: rwbarton, thomie, erikd, carter
GHC Trac Issues: #14910
Differential Revision: https://phabricator.haskell.org/D4495
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This came up when trying to build GHC HEAD with nix. We
do not set CCX for integer-gmp when running ./configure. We do
this however for libffi.
The result is, that if CCX is not set, we default to the system
one, of which there might be none (as in nixos's case). This
will not show on a debian+nix or similar setup, where the system
`cxx` is still in place, and only shows up when the system tries
hard to sandbox everything (even cxx) as nixOS does.
We use `CXX`, which is set to either `clang` or `CC_STAGE1`, and
also usedfor `CC`, similar to what we do for libffi.c
Test Plan: ./validate
Reviewers: bgamari, hvr
Reviewed By: hvr
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4473
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This wasn't spotted rightaway in
8f0b2f5eadf0fcb47c581907205a9db686214a69
because the include-site deliberately ignored include-errors as
a Hack with the justification below:
> Hack. The file gmp/config.mk doesn't exist yet after running ./configure in
> the toplevel (ghc) directory. To let some toplevel make commands such as
> sdist go through, right after ./configure, don't consider this an error.
This may have contributed to #14891.
|
|
|
|
|
|
|
|
|
|
|
| |
There weas lots of historical cruft to be found here. The `export
SHELLOPTS` breaks on NixOS due to bash syntax in the gcc wrapper script.
Reviewers: hvr
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4347
|
|
|
|
| |
(cherry picked from commit 3fa061a647d2fdc182eff9296eea02d6a7d516cd)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements the missing `{set,clear,complement}BitBigNat` primitives
and hooks them up to `Natural`'s `Bits` instance.
This doesn't yet benefit `Integer`, as we still need "negative" `BigNat`
variants of those primitives.
Addresses #7860 (partly)
Reviewed By: bgamari
Differential Revision: https://phabricator.haskell.org/D3415
|
|
|
|
|
|
|
|
|
|
|
|
| |
Just fix a few inconsistencies that I encountered.
[skip ci]
Reviewers: austin, hvr, goldfire
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D4024
|