Commit Graph
521 Commits
Author SHA1 Message Date
Stephen Canon 0098c438eb Merge pull request #277 from gwynne/biginteger
Update BigInteger branch from main
2024-01-10 13:55:22 -05:00
Gwynne Raskind 349fdf1e01 Add preliminary version of BigUInt 2023-12-26 11:12:49 -06:00
Gwynne Raskind 0d48ff5a98 Repair BigInt module after merge 2023-12-25 22:44:32 -06:00
Gwynne Raskind 1c90bdc9a9 Merge branch 'main' into biginteger 2023-12-25 22:31:33 -06:00
Stephen Canon 0111e791a1 Merge pull request #274 from stephentyrone/link-real-libm-linux
Move the -lm link command to RealModule (from _NumericsShims).
2023-12-10 17:09:03 -05:00
Stephen Canon 1883189574 Merge pull request #273 from xwu/toil-and-trouble
[_TestSupport] Fix DoubleWidth think-o that trips an assert
2023-11-30 10:59:41 -05:00
Stephen Canon e8a3ddbb3e Move the -lm link command to RealModule (from _NumericsShims).
Hopefully this resolves some niche link errors that we've seen sporadically.
2023-11-30 09:27:03 -05:00
Xiaodi Wu a7e27e16e1 [_TestSupport] Fix DoubleWidth think-os harder 2023-11-13 15:42:07 -05:00
Xiaodi Wu a0d66e1537 [_TestSupport] Fix DoubleWidth think-os 2023-11-13 15:41:52 -05:00
Stephen Canon 182c9b246b Merge pull request #271 from stephentyrone/none-some
Replace `some BinaryInteger` with an explicit generic parameter.
2023-09-29 14:34:06 -04:00
Stephen Canon b3867a9155 Replace some BinaryInteger with an explicit generic parameter.
For compatibility with pre-Swift-5.7 language versions.
2023-09-28 15:31:25 -04:00
Stephen Canon 470e4236ff Merge pull request #269 from stephentyrone/enable-spi
Add .spi.yml file to build documentation for SPI.
2023-09-20 09:56:49 -04:00
Stephen Canon 3d13ebaf94 Add .spi.yml file to build documentation for SPI. 2023-09-20 09:55:35 -04:00
Stephen Canon 485c60c6c4 Merge pull request #268 from stephentyrone/fix-tvOS-availability
Correct tvOS availability for Float16 in _TestSupport.
2023-09-20 09:52:12 -04:00
Stephen Canon b38fcb77a6 Correct tvOS availability for Float16 in _TestSupport. 2023-09-20 09:44:53 -04:00
Stephen Canon 716e22fd64 Merge pull request #218 from stephentyrone/saturating-arithmetic
Implement saturating arithmetic on FixedWidthInteger
2023-04-29 10:02:32 -04:00
Stephen Canon 35e15a381f Additional comment fixes from Guillaume 2023-04-28 22:31:31 -04:00
Stephen CanonandGuillaume Lessard bc9f6e7368 Update Sources/IntegerUtilities/ShiftWithRounding.swift
Co-authored-by: Guillaume Lessard <glessard@users.noreply.github.com>
2023-04-28 22:29:25 -04:00
Stephen CanonandGuillaume Lessard ef6dbc6e78 Update Sources/IntegerUtilities/ShiftWithRounding.swift
Co-authored-by: Guillaume Lessard <glessard@users.noreply.github.com>
2023-04-28 22:29:13 -04:00
Stephen Canon 0bb0a9acff Only run benchmarks in Release, they're meaningless in Debug. 2023-04-28 14:36:57 -04:00
Stephen Canon d59ec36291 Only run benchmarks in Release, they're meaningless in Debug. 2023-04-28 14:36:40 -04:00
Stephen Canon a118de9878 Polish README.md 2023-04-28 13:58:37 -04:00
Stephen Canon 58f4e72d8a Documentation improvements. 2023-04-28 13:34:53 -04:00
Stephen Canon 8680be387b Update README.md 2023-04-27 16:30:31 -04:00
Stephen Canon f7075cc79a Add a link to BinaryInteger.init(clamping:) in the section on new saturating arithmetic API. 2023-04-27 16:27:37 -04:00
Stephen Canon fe151134b0 Further saturating arithmetic test and implementation cleanups 2023-04-27 16:19:40 -04:00
Stephen Canon f00824e9fa More tests for saturating arithmetic -- exhaustive sampling of [U]Int8 arguments. 2023-04-26 21:50:23 -04:00
Stephen Canon 4779aef990 Test coverage for saturating shift + fix the bug that it turned up. 2023-04-26 21:20:57 -04:00
Stephen Canon dbffff1ea5 Add some basic documentation. 2023-04-26 18:34:48 -04:00
Stephen Canon 7953ef315a First pass. 2023-04-26 16:43:50 -04:00
Stephen Canon 93e5499e54 Merge pull request #214 from stephentyrone/rilakkuma
Initial pass at "relaxed" multiply and add operations.
2023-04-26 09:14:35 -04:00
Stephen Canon 740cc5012f Some cleanups to relaxed arithmetic. 2023-04-26 09:05:28 -04:00
Stephen Canon f6b0aeb607 Remove _mulAdd in favor of Relaxed.multiplyAdd. 2023-04-26 08:56:43 -04:00
Stephen Canon 313ab7266a No longer need pre-5.4 clang workaround. 2023-04-26 08:56:43 -04:00
Steve (Numerics) Canon 30c01a9fc5 Possible spelling: Relaxed.sum/product. 2023-04-26 08:56:43 -04:00
Stephen Canon 9a23fdf1c9 Fewer iterations for debug; more for release. 2023-04-26 08:56:43 -04:00
Stephen Canon 86699a7f8a Undef what we def. 2023-04-26 08:56:43 -04:00
Stephen Canon b750c890b7 Don't use reassociate(on) on older clang toolchains. 2023-04-26 08:56:43 -04:00
Stephen Canon 79390164f5 CMake support for newer tests. 2023-04-26 08:56:43 -04:00
Stephen Canon 0fff91683a Disable _Float16 shims for relaxed operations on Intel.
The C type isn't available yet in clang on i386 or x86_64; once the calling conventions are stabilized in clang, we can reenable this.
2023-04-26 08:56:43 -04:00
Stephen Canon 9c0332d570 Initial pass at "relaxed" multiply and add operations.
This commit adds the following to the RealFunctions protocol:

    static func _relaxedAdd(_:Self, _:Self) -> Self
    static func _relaxedMul(_:Self, _:Self) -> Self

These are equivalent to + and *, but have "relaxed semantics"; specifically, they license the compiler to reassociate them and to form FMA nodes, which are both significant optimizations that can easily make many common loops 8-10x faster. These transformation perturb results slightly, so they should not be enabled without care, but the results with the relaxed operations are--for most purposes--"just as good as" (and often better than) what strict operations produce. The main thing to beware of is that they are no longer portable; different compiler versions and different targets and optimization flags will result in different results.

They are underscored because they are not stable API. In particular:
- `RealFunctions` is not really the right protocol for these (and neither is `Real`). I need to do some thinking about where to attach them.
- Even if it were the right protocol, these are more like implementation hooks than the API I really want people to use (TBD).
- I like "relaxed" more than other commonly used idioms ("fast"), but I'm not sure it's the name I ultimately want.
2023-04-26 08:56:43 -04:00
Stephen Canon 97c716ba37 Merge pull request #240 from stephentyrone/bump-to-5.5
Bump tools version to 5.5, add @swift-5.4 for legacy support.
2022-12-28 18:33:20 -05:00
Steve (Numerics) Canon 8353ce4c3d Bump tools version to 5.5, add @swift-5.4 for legacy support. 2022-12-28 18:25:22 -05:00
Stephen Canon fd9722e609 Merge pull request #84 from rothomp3/BigInt
Arbitrary-precision BigInt preliminary work
2022-10-28 15:40:10 -04:00
Stephen Canon f11ce9b248 Merge branch 'biginteger' into BigInt 2022-10-28 15:39:47 -04:00
Stephen Canon 5428505255 Merge pull request #237 from stephentyrone/send-it
Mark Complex Sendable when the underlying RealType is.
2022-09-30 18:48:03 -04:00
Stephen Canon e601f16e20 Mark Complex Sendable when the underlying RealType is. 2022-09-30 14:07:49 -04:00
Stephen Canon 6c4accd836 Merge pull request #236 from stephentyrone/further-complex-pow-tweaks
Further improvement to Complex.pow(_:Self,_:Self) edge cases.
2022-09-17 15:01:40 -04:00
Stephen Canon 60a3edbaa9 Further improvement to Complex.pow(_:Self,_:Self) edge cases.
Bring pow(zero, w) in line with the behavior of pow for the underlying real type.
2022-09-17 14:56:29 -04:00
Stephen Canon 89cfa62803 Merge pull request #235 from stephentyrone/complex-pow
Fix edge-cases for Complex.pow(.zero, <Int>), and Real.pow(zero, zero)
2022-09-15 19:05:35 -04:00