473 Commits
Author SHA1 Message Date
Stephen Canon bbadd4b853 Merge pull request #326 from stephentyrone/wasm-testing-1.1
[1.1] enable wasm testing
1.1.0-prerelease 1.1.0
2025-08-14 13:11:52 -04:00
Stephen Canon e46ddfe087 Merge pull request #325 from stephentyrone/enable-wasm-testing
Enable workflows testing for wasm.
2025-08-14 12:59:30 -04:00
Stephen Canon 1653d35461 Merge pull request #323 from stephentyrone/docc-stuff-1.1
[1.1] pull in documentation revamp from main
2025-08-14 09:36:49 -04:00
Stephen Canon 207fea2fc1 Pull documentation revamp from main into release/1.1 2025-08-13 23:18:57 -04:00
Stephen Canon c16e7a9617 Merge pull request #322 from stephentyrone/augmented-sum-assert-1.1
[1.1] Remove assert in Augmented.sum(large:small:)
2025-08-11 19:52:47 -04:00
Stephen Canon 416b94a80e Merge pull request #321 from stephentyrone/remove-2sum-assert
Remove precondition assert from Augmented.sum(large:small:)
2025-08-11 19:35:39 -04:00
Stephen Canon 1a19d0d28d Merge pull request #318 from stephentyrone/constrain-algebraic-field-1.1
[1.1] Constrain algebraic field to Magnitude: AlgebraicField
2025-08-09 12:48:26 -04:00
Stephen Canon d91884bb27 Merge pull request #315 from stephentyrone/algebraic-field-magnitude
Constrain AlgebraicField to required Magnitude:AlgebraicField
2025-08-08 17:19:36 -04:00
Stephen Canon 6bd8a0cc08 Merge pull request #317 from apple/stephentyrone-patch-1
Update README.md
2025-08-08 17:16:58 -04:00
Stephen Canon 05472f917c Update README.md
Move baseline to 1.1.0 in the how to adopt section
2025-08-08 17:16:45 -04:00
Stephen Canon 658bcd12f4 Merge pull request #313 from stephentyrone/relax-f16-x86-1.1
[1.1] Enable relaxed f16 arithmetic for x86
2025-08-08 10:07:13 -04:00
Stephen Canon b95ca135a6 Restore relaxed mul/add bindings for Float16 on x86
The ABI is stable, so these operations can be turned on.
2025-08-08 09:47:03 -04:00
Stephen Canon fd82b65b04 Create release/1.1 branch to prepare for tag.
This is a cut of main with IntegerUtilities removed; I plan to tag 1.1 with non-integer feature work from main, and 1.2 will be the first tag with IntegerUtilities.
2025-08-08 09:37:13 -04:00
Stephen Canon 6356eb395b Merge pull request #307 from j-hui/add-extern-c
Add extern "C" to shim header file
2025-05-28 15:27:45 -04:00
John Hui 1be6eb5b47 Add extern "C" to shim header file
Adding this allows this package to be used with C++ interop enabled.
Otherwise, building a package that depends on this leads to linker
errors

rdar://113756245
2025-05-22 18:09:11 -07:00
Stephen Canon 2b458e8aeb Merge pull request #305 from stephentyrone/remove-stochastic-rounding
Remove stochastic rounding mode
2025-04-10 11:51:13 -04:00
Stephen Canon 31fe14d084 Remove stochastic rounding mode
It's a useful operation, but it deserves its own API to allow the use of a custom random source.
Also, the existing API blocks some constant-folding operations because the call to the system random source is an opaque optimization barrier, so removing it allows us to produce better codegen for the other rounding modes.

We're also bumping required Swift version to 5.9, and removing the executable test targets for log/log1p, as they're really only useful for development of those algorithms.
2025-04-10 10:39:51 -04:00
Stephen Canon c327d04b01 Merge pull request #304 from stephentyrone/language-cleanup
s/sanity check/basic check/
2025-03-11 11:41:53 -04:00
Stephen Canon 9b36b1ce46 s/sanity check/basic check/ 2025-03-11 10:08:58 -04:00
Mishal Shah 7888cf22cc Merge pull request #301 from apple/github-actions-support
[CI] Add support for GitHub Actions
2025-03-10 17:07:58 -07:00
Mishal Shah 1d23717b47 Disable license and format checks 2025-03-09 18:01:10 -07:00
Mishal Shah 0d774a5bc3 Update RelaxedArithmeticTests.swift to include ignore-unacceptable-language 2025-03-07 16:40:28 -08:00
Mishal Shah 7ba979e24b Update project name 2025-03-07 16:37:47 -08:00
Mishal Shah d0ffe3c0e0 Update RealModule README.md to use new swift-evolution link 2025-03-07 16:32:30 -08:00
Mishal Shah e750ab6419 Update README.md to use main 2025-03-07 16:29:58 -08:00
Mishal Shah 06e2bf1f76 [CI] Add support for GitHub Actions 2025-03-04 23:29:29 -08:00
Stephen Canon c4cc31ea95 Merge pull request #300 from stephentyrone/more-availability-fixes
Fix-up availability for Float16 in tests for tvOS and watchOS.
2025-03-04 14:21:48 -05:00
Stephen Canon 7b1e0db437 Fix-up availability for Float16 in tests for tvOS and watchOS. 2025-03-04 10:18:08 -05:00
Stephen Canon e30276bff2 Merge pull request #297 from stephentyrone/floating-point-rounding
Make all (IntegerUtilities) rounding rules available to FloatingPoint
2024-08-15 12:06:06 -04:00
Stephen Canon ddc8ce302b Make all rounding rules (from IntegerUtilities) available on FloatingPoint
IntegerUtilities has RoundingRule that is a superset of FloatingPointRoundingRule; many of these are also useful when working with floating-point. This change provides a `rounding(_:)` function similar to the standard libraries `rounded(_:)` that makes all of them available. It has a different name instead of being a shadow because otherwise existing use sites like `rounded(.down)` would become ambiguous.
2024-08-15 11:58:38 -04:00
Stephen Canon b5adc8c39b Merge pull request #296 from stephentyrone/round-out-rounding
Add new rounding modes: toNearestOr[Down,Up,Zero,Away]
2024-07-20 08:10:52 -04:00
Stephen Canon 683c8f210a Cleanup and bug fix for wide stochastic rounding path. 2024-07-19 21:42:54 -04:00
Stephen Canon c69fea9be8 Remove Int128 tests for now
Most people are not yet using a toolchain with support for Int128; we'll re-enable these when we bump the baseline to Swift 6.0
2024-07-19 16:15:50 -04:00
Stephen Canon 3ee07816b2 Add new rounding modes: toNearestOr[Down,Up,Zero,Away]
These were omitted in the first pass over integer rounding rules, but are generally useful and make good sense to have available. In particular, toNearestOrUp is the natural mode for a lot of fixed-point arithmetic, and frequently has HW support on SIMD units, so it makes good sense to have a name for that. Once you add that, having nearestOrDown also makes sense, and then nearestOrZero should exist by analogy to nearestOrAway. Also beefed up testing and refactored the division rounding code somewhat.
2024-07-19 16:12:55 -04:00
Stephen Canon 53afff107a Merge pull request #295 from stephentyrone/double-width-improvements
Improvements and bugfixes for DoubleWidth
2024-07-12 14:00:55 -04:00
Stephen Canon 1043e9ed38 Improvements and bugfixes for DoubleWidth prototype
These are used only in TestSupport, but it's still nice to get them right. Signed types had a long-standing bug in how overflow was computed for multiplication, and masking shifts would do the wrong thing when the bitwdith was not a power of two and the shift count was negative. I also added implementations of &*, &+, and &-.
2024-07-12 13:30:13 -04:00
Stephen Canon e7af7dffbc Merge pull request #294 from stephentyrone/fixup-file-headers
Some file headers have the Swift.org text instead of Swift Numerics
2024-07-01 12:51:51 -04:00
Stephen Canon da661919b9 Fixup some file headers that had the Swift.org text instead of Swift Numerics
These are a copy-pasto from introduced when I originally imported approximate equality (which was originally proposed for the standard library).
2024-07-01 12:46:42 -04:00
Stephen Canon 6deae1b98f Merge pull request #292 from futurejones/add-riscv64-support
add support for riscv64
2024-07-01 09:40:22 -04:00
Neil Jones 155cfc306c add support for riscv64 2024-06-17 14:48:24 +09:00
Stephen Canon 877fd0aa9a Merge pull request #289 from stephentyrone/rework-complex-division
Replaces the rescaling algorithm for Complex division to one inspired by Doug Priest's "Efficient Scaling for Complex Division," with some further tweaks to:

- allow it to work for arbitrary FloatingPoint types, including Float16
- get exactly the same rounding behavior as the un-rescaled path, so that z/w = tz/tw when tz and tw are computed exactly.
- allow future optimizations to hoist a rescaled reciprocal for more speedups.

Unlike Priest, we do not try to avoid spurious overflow in the final computation when the result is very near the overflow boundary but cancellation brings us just inside it. We do not believe that this is a good tradeoff, as complex multiplication overflows in exactly the same way. We will investigate providing opt-in API to avoid this overflow case in a future PR.
2024-05-16 22:24:22 -04:00
Stephen Canon 262cbea1f2 review feedback. 2024-05-16 22:12:24 -04:00
Stephen CanonandGuillaume Lessard 84c41a0bef Update Sources/ComplexModule/Complex+AlgebraicField.swift
Co-authored-by: Guillaume Lessard <glessard@tffenterprises.com>
2024-05-16 19:46:17 -04:00
Stephen Canon a883d95a4d Fixup guard on Float16 Complex divide tests. 2024-05-16 15:50:32 -04:00
Stephen Canon 3d6de9f3ef Reworked complex divide scaling. 2024-05-16 15:44:11 -04:00
Stephen Canon 3fa18ae9b5 Test improvements
Improved how tolerance is applied close to infinity for complex division
(this still could use a more principled approach, but at least we're in
the right ballpark now). Tightened up the tolerance for semi-exhaustive
testing too, since that can be done now.
2024-05-16 08:39:12 -04:00
Stephen Canon 1ba2178227 Further progress on complex division 2024-05-14 17:22:50 -04:00
Steve Canon 97bab250eb WIP 2024-05-14 10:24:31 -04:00
Stephen Canon ab63ebd7b2 Merge pull request #286 from stephentyrone/drop-support-5.4
Drop support for Swift <= 5.4 on main
2024-04-19 21:27:05 -04:00
Stephen Canon 347f1e31fe Drop support for Swift < 5.4 on main
5.4 will continue to be supported on 1.0.x if needed.
2024-04-19 21:07:58 -04:00