Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync latest package changes with Quaternions branch #228

Merged
merged 129 commits into from
Jun 20, 2022

Conversation

markuswntr
Copy link
Contributor

@markuswntr markuswntr commented Apr 27, 2022

Syncs the latest changes from main with the Quaternions branch (commits up to and including 964e62c), refines the quaternion module structure (sync with #219, commit: f56d2cb) and refines documentation (sync with #224, commit: 4f97344).

stephentyrone and others added 30 commits November 9, 2020 16:41
This is kind of dubious, but necessary for performance reasons until we get dependable cross-module specialization. Also has a minor test fix for 32b platforms.
Mark all complex elementary functions inlinable
These used to be used by some test appratus, but they are no longer
used and can be removed.
In older toolchains, Float16 is marked unavailable on all mac targets; starting with the 5.4 toolchain, it is available starting in macOS 11.0 when targeting Apple Silicon.
Adjust Float16 availability for Swift 5.4 toolchains.
Update version number in sample code.
Tidying, plus a few small edits. This commit should not include any code changes.
…y-father-lies

80-column formatting for source doc comments
…-plist

Remove .xcodesamplecode.plist, which prevents editing markdown from Xcode
…ithmetic

Document the Augmented enum in RealModule in advance of 1.0
…r-1.0

Add some documentation for AlgebraicField ops, minor fix for Augmented.
Further expand documentation of `reciprocal` with some example use.
These are vestigial, and not needed to support swift-pm.
stephentyrone and others added 23 commits December 16, 2021 13:33
The standard-library documentation for `trailingZeroBitCount` states:

> If the value is zero, then `trailingZeroBitCount` is equal to `bitWidth`.

Thus, if `T` is not a fixed-width integer type, and `x == 0`, and `y` has more trailing zeros than the representation of `x`, then the gcd calculation will be incorrect.

In particular, the left-shift by `min(xtz, ytz) == xtz` will not “undo” the earlier right-shift by `ytz`,  so the final result will be incorrectly right-shifted by `ytz - xtz`.

To fix this I have added an early exit when `x == 0`. I am not sure if this is the optimal solution, and I’m open to alternatives.

***

This change ensures that `x != 0` at the top of the loop, so I have also converted it from a `while` to a `repeat-while` loop, in order to eliminate a redundant extra comparison on the first iteration.

I don’t know if this actually affects performance, and I’m happy to change it back if that’s preferred.
Move baseline supported tools version to 5.4
Minor documentation formatting cleanup.
The conformance was breaking CI testing, because the CI bots use a macOS version that predates availability of the _Differentiation module, and the compiler-generated differentation operations have neither availability attributes nor checks, so any reference to those operations simply crashes in dyld because the library is not present. We can add availability, but that's not really accurate either, because these operations are not actually binary-stable, so while we wouldn't crash in dyld, we also might not work correctly in the future. We could mark them unavailable on Apple platforms, but that's also not quite right (and further means that they're not going to get a lot of attention). The best solution seems to be to remove the conformance (which was never source-stable).
Remove conformance of Complex to Differentiable
Adjust the CMake build system to reflect the recent changes of requiring the explicit linking of libm on Linux platforms.
Update CMakeLists.txt to link math library on Linux.
Link math library on Android too
@markuswntr markuswntr changed the title Sync latest packages changes with Quaternions branch Sync latest package changes with Quaternions branch Apr 27, 2022
@stephentyrone
Copy link
Member

@swift-ci test

@stephentyrone stephentyrone merged commit 5750897 into apple:Quaternions Jun 20, 2022
@markuswntr markuswntr deleted the quaternion/sync branch June 20, 2022 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants