Commit Graph

3245 Commits

Author SHA1 Message Date
Simon Gladman
1f76b6d0fd Merge remote-tracking branch 'origin/accelerate-vDSP-geometry' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:39:59 +01:00
Simon Gladman
737528763d Merge remote-tracking branch 'origin/accelerate-vDSP-convolution' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:38:27 +01:00
Simon Gladman
98cc389556 Merge remote-tracking branch 'origin/accelerate-vDSP-complexOperations' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:36:40 +01:00
Simon Gladman
d5fca4f073 Merge remote-tracking branch 'origin/accelerate-vDSP-linearInterpolation' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:35:07 +01:00
Simon Gladman
ff15bdd108 Merge remote-tracking branch 'origin/accelerate-vDSP-slidingWindow' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:31:42 +01:00
Stephen Canon
d05cd67816 Accelerate vForce (#24152)
* [Accelerate] [vForce] New vForce Overlay

This PR contains a suite of overlays to the vForce transcendental and trigonometric functions on vectors of any length. The overlays simplify the API to the existing functions and accept collections that implement a new protocol called AccelerateBuffer. Conformances are provided for the most useful stdlib Collections.
2019-04-19 21:59:32 +02:00
Karoy Lorentey
0800819d98 Merge pull request #24112 from lorentey/reenable-small-string-tests
[test] Re-enable SmallString tests with updated platform checks
2019-04-18 19:27:59 -07:00
simon gladman
802d516ad5 [Accelerate] [Quadrature] New Quadrature Overlay (#23127)
* [Accelerate] [Quadrature] New Quadrature Overlay

A class that simplifies approximating the definite integral of a function.

* Fixes in response to PR Review.

Change `@_exported import Accelerate` to `import Accelerate`.
Correct date in copyright comment.

* Code Review Fixes.

* Remove mutable integrator, simply set options in init().
* Remove mutable `maxIntervals` and `qagPointsPerInterval`.
* Update tests.

* Code Review Fixes.

* Use standard library `Result`.
* Implement `QAGPointsPerInterval` as a struct.

* Tidy up Passing Integrand to `quadrature_integrate_function`.

Pass the integrand closure directly to the `quadrature_integrate_function` initialiser rather than attaching as a property of the `Quadrature` class.

* Make `Quadrature` a struct, and remove requirement for `integrand` to be escaping.

* Code Review Changes

* Add long-form integrator algorithm aliases (update tests to use these aliases).
* Make quadrature error description public.
* New tests for error description and `QAGPointsPerInterval`.

* Vectorized Integrand for Quadrature

Create an alternative implementation of `integrate` that accepts an integrand of type `(_ input: UnsafeBufferPointer<Double>, _ result: UnsafeMutableBufferPointer<Double>)`.

* Vectorized Integrand for Quadrature

Create an alternative implementation of `integrate` that accepts an integrand of type `(_ input: UnsafeBufferPointer<Double>, _ result: UnsafeMutableBufferPointer<Double>)`.

* Vectorized Integrand for Quadrature

Remove _ContiguousCollection - it's no longer used.

* Delete ContiguousCollection.swift

Not required.

* Refactor tests.
2019-04-19 02:09:41 +02:00
Karoy Lorentey
deeff6b55e [test] SmallString: Don’t import Foundation where it’s not available 2019-04-18 11:44:17 -07:00
Simon Gladman
364a143b5e As per code review, rename convert(_:to:) to convertElements(of:to:). Also, remove unnecessary import. 2019-04-18 10:22:50 +01:00
Karoy Lorentey
a2f8ba691c [test] Re-enable SmallString tests with correct platform checks 2019-04-17 16:45:23 -07:00
Stephen Canon
57a4553832 SE-0246: Protocols and static functions (#23824)
This implements the protocols and static functions proposed in SE-0246, plus some initial test coverage. It also has some rough accompanying cleanup of tgmath. It does not include the globals (on scalars or SIMD types) nor does it deprecate much in tgmath.h.
2019-04-17 23:57:33 +02:00
Max Moiseev
bd59b2220f Merge pull request #23860 from ebainville/dev/DataProtocol-inputs
DataProtocol inputs in Compression overlay
2019-04-16 16:11:29 -07:00
Karoy Lorentey
13bc567085 [Foundation] Notification: Add note on == not being reflexive and stabilize hashing
The `ObjectIdentifier(object as AnyObject)` is not necessarily stable; this breaks reflexivity for ==, and it makes the hash encoding nondeterministic.
2019-04-12 15:26:40 -07:00
Slava Pestov
61f21a7195 IRGen: Emit field reflection descriptors for types with custom alignment
The code to decide if field descriptors were going to be emitted was
confusing, so I've refactored it a bit.
2019-04-12 01:46:23 -04:00
Ben D. Jones
5f1384342a [TestJSONEncoder] - Originally we thought the level of precision requested internally by JSONSerialization (via snprintf) could always be two or more digits larger. Turns out it can be any level of precision larger than requested. 2019-04-09 10:59:32 -07:00
Karoy Lorentey
582b65b993 Revert "[Foundation] Data: Hash the entire contents, not just an arbitrary subset"
This reverts commit b711ed9f90.
2019-04-08 18:48:52 -07:00
John McCall
4f4d64b93e Various improvements to the variable-is-never-mutated diagnostic.
The main fixes here are:
- we weren't looking through open-existentials in the l-value
- we weren't handling mutating gets correctly unless CSApply wrapped
  the base in an InOutExpr, which seems to be multifile-sensitive
- we were missing diagnostics in some cases involving subscripts

A better fix would be to re-introduce LValueAccessKind, but I wanted
a workable short-term fix that I could try to get into 5.1.

Fixes rdar://49482742, which is specific to the lazy-getter problem.
2019-04-08 18:43:24 -04:00
Eric Bainville
be2e93aa7a Merge branch 'master' into dev/DataProtocol-inputs 2019-04-08 09:15:21 -07:00
Karoy Lorentey
b711ed9f90 [Foundation] Data: Hash the entire contents, not just an arbitrary subset 2019-04-05 18:07:30 -07:00
Karoy Lorentey
6f40a4abf9 [Foundation] Measurement: Fix hashing 2019-04-05 18:07:30 -07:00
Karoy Lorentey
28e4688c05 [Foundation] PersonNameComponents: Modernize hashing 2019-04-05 18:07:30 -07:00
Karoy Lorentey
a23c3f36bd [Foundation] UUID: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
c1049e7b79 [Foundation] DateInterval: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
741122ae65 [Foundation] Date: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
8b7adb35d3 [Foundation] AffineTransform: modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
0867f7e17f [Foundation] String.Encoding: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
81567ed85e [Foundation] CharacterSet: Modernize hashing 2019-04-05 18:07:26 -07:00
Karoy Lorentey
73ad830e40 [Foundation] Calendar: Modernize hashing 2019-04-05 18:07:21 -07:00
ravikandhadai
6317b17188 Merge pull request #23437 from ravikandhadai/loggingAPI-PR
[os_log][stdlib-private] Add tests for checking the correctness of buffer and format string construction in the new OS log APIs.
2019-04-05 16:29:51 -07:00
Karoy Lorentey
569e380337 [Foundation] NSRange: Add an explicit definition for hash(into:)
This replaces the compiler-generated variant (based on hashValue) with a better implementation.
2019-04-05 15:21:24 -07:00
Karoy Lorentey
46225d728a [Foundation] IndexPath: Add explicit hash(into:) definition, hashing *all* components
The new definition diverges from the existing hashValue: it feeds all path components to the hasher, rather than just a limited subset.

Hashing all the bits that are compared in == is necessary to ensure proper operation of the hash table.
2019-04-05 15:21:24 -07:00
Ben D. Jones
9c0de5aa3b [TestJSONEncoder] Re-enable tests and add a special case to handle a rare condition caused by snprintf's %g which JSONSerialization uses internally for double values. This bug effects Darwin, FreeBSD, and Linux currently. (#23721) 2019-04-04 16:38:58 -07:00
Stephen Canon
c5e3f85378 Revert SE-0246 (#23800)
* Revert "Merge pull request #23791 from compnerd/you-know-nothing-clang"

This reverts commit 5150981150, reversing
changes made to 8fc305c03e.

* Revert "Merge pull request #23780 from compnerd/math-is-terrible"

This reverts commit 2d7fedd25f, reversing
changes made to 0205150b8f.

* Revert "Merge pull request #23140 from stephentyrone/mafs"

This reverts commit 777750dc51, reversing
changes made to 0c8920e747.
2019-04-04 19:35:25 -04:00
Eric Bainville
b1d4d40516 take DataProtocol as input; simplified errors; fixed availability 2019-04-03 15:20:40 -07:00
Steve (Numerics) Canon
2bc6040556 More test fixup for Linux. 2019-04-03 09:32:44 -04:00
simon gladman
4721423535 Added floatToDouble and doubleToFloat 2019-04-03 13:49:58 +01:00
Steve (Numerics) Canon
0c7c1f0365 Update tgmath.swift.gyb to work with Glibc and MSVCRT. 2019-04-03 08:17:05 -04:00
simon gladman
1df6ad87fe Remove breaking test 2019-04-03 12:57:19 +01:00
simon gladman
a0f504b821 Add conversion operations that return the result. 2019-04-03 11:37:33 +01:00
Ravi Kandhadai
2f2afd034d [os_log][stdlib-private] Add tests for checking the correctness of
buffer and format string construction in the new OS log APIs.
2019-04-02 17:31:40 -07:00
Steve (Numerics) Canon
10fd131964 Test fixes. 2019-04-02 18:49:31 -04:00
Steve (Numerics) Canon
3fda509805 Implementation of ElementaryFunctions / Real protocols.
This commit implements SE-0246, by adding conformance to Real to the Float, CGFloat, Double, and Float80 types, implemented either in terms of the system's C math library, existing standard library functionality, or LLVM intrinsics. It includes basic test coverage for these new functions, and deprecates and obsoletes *some* existing functionality in the Platform overlay. We still need to make a decision about how to handle the remaining "tgmath" functions, because obsoleting them is technically a source-breaking change (if users have unqualified names like "exp(1)", it's fine, but it would break users who have used qualified names like "Darwin.exp(1)".)
2019-04-02 18:49:31 -04:00
simon gladman
4cfbaa90b8 Add conversion functions that return the result. 2019-04-02 17:29:26 +01:00
simon gladman
0606fdd98b Create versions of window and ramp generation operations that return a result. 2019-04-02 16:13:01 +01:00
Michael Ilseman
c36daeb106 [tests] Adjust tests for Linux 2019-04-01 09:29:20 -07:00
simon gladman
9f752aa0d9 Add versions of operations that return the result. 2019-04-01 14:31:05 +01:00
Michael Ilseman
3923fb2268 [String] String.Index.init(_:within:) bounds checks
Bounds check the given index for String.Index's generic initializer
that makes sure a passed index is a valid one for the given
StringProtocol.
2019-03-29 15:43:00 -07:00
Michael Ilseman
0ece62d911 [String] Add Substring.base
Adds Substring.base, analogous to Slice.base, to access the entire
String.

Tests added.
2019-03-29 15:43:00 -07:00
Michael Ilseman
aa519362f3 [String] Add Character.UTF16View and Character.UTF8View
Adds these collections, which are just String's views.

Tests added.
2019-03-29 15:43:00 -07:00