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
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 Canon and Guillaume 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 Canon and Guillaume 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
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
Stephen Canon
2baff8fc30
Also fixup real edge cases for pow(0,0).
2022-09-15 16:10:17 -04:00
Stephen Canon
b9e8b970f2
Fixup indentation.
2022-09-15 15:39:34 -04:00
Stephen Canon
d34f5636c4
Fix the edge-case handling of Complex.pow(.zero, <int>)
2022-09-15 15:07:06 -04:00
Stephen Canon
2624562948
Merge pull request #233 from xymus/missing-import-for-conformance
...
Add missing import required to use a conformance
2022-07-12 14:31:29 -04:00
Alexis Laferrière
c8e3d9f54b
Add missing import required to use a conformance
...
A new compiler check reports a missing import for a conformance
implicitly imported:
```
Sources/_TestSupport/Error.swift:21:13: error: cannot use conformance of
'Float' to 'Real' here; 'RealModule' was not imported by this file
public func componentwiseError(_ tst: Complex<Float>, _ ref:
Complex<Double>) -> Double {
^
```
Address this issue in the project by adding the missing import.
2022-07-11 14:44:42 -07:00
Stephen Canon
a7ceb774fe
Merge pull request #231 from markuswntr/patch-1
...
Fix broken link to `IntegerUtilities` in README.md
2022-06-20 09:26:24 -10:00
Markus Winter
0ea36c3109
Update README.md
2022-06-16 08:16:18 +02:00
Stephen Canon
0dc8fef6e9
Merge pull request #227 from buttaface/math
...
Link math library on Android too
2022-04-07 22:35:51 -04:00
Stephen Canon
98a8a166df
Merge pull request #226 from compnerd/patch-1
...
Update CMakeLists.txt to link math library on Linux.
2022-04-07 17:25:38 -04:00
Saleem Abdulrasool
0d9f0b2a98
Update CMakeLists.txt
...
Adjust the CMake build system to reflect the recent changes of requiring the explicit linking of libm on Linux platforms.
2022-04-07 14:24:06 -07:00