summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib/integer/integerGmpInternals.hs
Commit message (Collapse)AuthorAgeFilesLines
* Bignum: implement integerRecipMod (#18427)Sylvain Henry2020-10-021-4/+0
|
* Update testsuiteSylvain Henry2020-06-171-2/+2
| | | | | | | | | | | | | | * support detection of slow ghc-bignum backend (to replace the detection of integer-simple use). There are still some test cases that the native backend doesn't handle efficiently enough. * remove tests for GMP only functions that have been removed from ghc-bignum * fix test results showing dependent packages (e.g. integer-gmp) or showing suggested instances * fix test using Integer/Natural API or showing internal names
* Split integerGmpInternals test in several partsSylvain Henry2020-01-041-130/+0
| | | | | This is to prepare for ghc-bignum which implements some but not all of gmp functions.
* Update Trac ticket URLs to point to GitLabRyan Scott2019-03-151-1/+1
| | | | | This moves all URL references to Trac tickets to their corresponding GitLab counterparts.
* Correct limb length and assertion for gcdExtIntegerDavidEichamnn2018-08-211-0/+19
| | | | | | | | | | | | Reviewers: hvr, bgamari, monoidal Reviewed By: monoidal Subscribers: monoidal, rwbarton, thomie, carter GHC Trac Issues: #15350 Differential Revision: https://phabricator.haskell.org/D5042
* Restore function powModSecIntegerOlivier Chéron2017-09-191-3/+1
| | | | | | | | | | | | | | | The function existed in integer-gmp-0.5.1.0 but was removed as part of integer-gmp2 rewrite in #9281. This is to bring it back. Test Plan: Case integerGmpInternals, with GMP 4.3.2 and GMP 6.1.2 Reviewers: austin, hvr, goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3947
* Make function intToSBigNat# preserve sign (fixes #14085)Olivier Chéron2017-08-171-1/+4
| | | | | | | | | | | | | | | | | | | Impacts only functions gcdExtInteger, powModInteger and recipModInteger which gave invalid results on negative S# inputs. Also fixes gcdExtInteger assertion when first argument is negative. Test Plan: Updated test case integerGmpInternals Reviewers: austin, hvr, goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #14085 Differential Revision: https://phabricator.haskell.org/D3826
* Reimplement `gcdExtInteger` (#9281)Herbert Valerio Riedel2014-11-291-11/+1
| | | | | `gcdExtInteger` has been available since `integer-gmp-0.5.1` (added via 71e29584603cff38e7b83d3eb28b248362569d61)
* Re-implement `recipModInteger` (#9281)Herbert Valerio Riedel2014-11-291-10/+1
| | | | | | | | | | | | This also exposes the following two type-specialised modular exponentiation variants of `recipModInteger` useful for implementing a `recipModNatural` operation. recipModBigNat :: BigNat -> BigNat -> BigNat recipModWord :: Word# -> Word# -> Word# `recipModInteger` has been available since `integer-gmp-0.5.1` (added via 4d516855241b70eb687d95e3c121428de885e83e)
* Re-implement `powModInteger` (#9281)Herbert Valerio Riedel2014-11-291-12/+1
| | | | | | | | | | | | | This also exposes the following type-specialised modular exponentiation variants of `powModInteger` useful for implementing a `powModNatural` operation. powModBigNat :: BigNat -> BigNat -> BigNat -> BigNat powModBigNatWord :: BigNat -> BigNat -> Word# -> Word# powModWord :: Word# -> Word# -> Word# -> Word# `powModInteger` has been available since `integer-gmp-0.5.1` (added via 4d516855241b70eb687d95e3c121428de885e83e)
* Re-activate `integerGmpInternals` test (#9281)Herbert Valerio Riedel2014-11-281-24/+54
| | | | | | | | | | | | | | | | | | The `integerGmpInternals` test was disabled in c774b28f76ee4c220f7c1c9fd81585e0e3af0e8a as many of the primitives tested in that test weren't available yet w/ `integer-gmp2`. However, most operations have been reimplemented by now, with the exception of recipModInteger :: Integer -> Integer -> Integer gcdExtInteger :: Integer -> Integer -> (Integer, Integer) powModSecInteger :: Integer -> Integer -> Integer -> Integer powModInteger :: Integer -> Integer -> Integer -> Integer powInteger :: Integer -> Word -> Integer which are still missing, and will (time permitting) be reimplemented over time.
* Reimplement im/export primitives for integer-gmp2Herbert Valerio Riedel2014-11-191-19/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The import/export operations were available in `integer-gmp-0.5.1` already, but need to be reimplemented from scratch for the `integer-gmp-1.0.0` rewrite. This also adds a few more operations than were previously available for use w/ the `BigNat` type (which will be useful for implementing serialisation for the upcoming `Natural` type) Specifically, the following operations are (re)added (albeit with slightly different type-signatures): - `sizeInBaseBigNat` - `sizeInBaseInteger` - `sizeInBaseWord#` - `exportBigNatToAddr` - `exportIntegerToAddr` - `exportWordToAddr` - `exportBigNatToMutableByteArray` - `exportIntegerToMutableByteArray` - `exportWordToMutableByteArray` - `importBigNatFromAddr` - `importIntegerFromAddr` - `importBigNatFromByteArray` - `importIntegerFromByteArray` NOTE: The `integerGmpInternals` test-case is updated but not yet re-enabled as it contains tests for other primitives which aren't yet reimplemented. This addresses #9281 Reviewed By: austin, duncan Differential Revision: https://phabricator.haskell.org/D480
* Set up framework for generalising Data.List to FoldablesHerbert Valerio Riedel2014-09-201-1/+1
| | | | | | | | | | | | | | | | | | | | | This renames the Data.List module to Data.OldList, and puts a new Data.List module into its place re-exporting all list functions. The plan is to leave the monomorphic versions of the list functions in Data.OldList to help smooth the transition. The new Data.List module then will simply re-export entities from Data.OldList and Data.Foldable. This refactoring has been placed in a separate commit to be able to better isolate any regressions caused by the actual list function generalisations when implementing #9586 This also updates the haskell2010, haskell98, and array submodules Reviewed By: austin, ekmett Differential Revision: https://phabricator.haskell.org/D228
* Add tests for new import/export GMP primitivesHerbert Valerio Riedel2013-11-071-22/+124
| | | | Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Add tests for new internal GMP primitivesHerbert Valerio Riedel2013-10-281-0/+11
| | | | | | | This adds some simple tests for the primitives introduced in [4d7cd68b/integer-gmp] and [d466dfc8/integer-gmp]. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Add tests for new internal GMP primitivesHerbert Valerio Riedel2013-10-011-0/+50
See [ce8ec963/integer-gmp] and [97c101b7/integer-gmp] for more details