Commit Graph

13406 Commits

Author SHA1 Message Date
Simon Gladman
2ee19145df Merge remote-tracking branch 'origin/accelerate-vDSP-polynomialEvaluation' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:47:31 +01:00
Simon Gladman
87ab1d614b Merge remote-tracking branch 'origin/accelerate-vDSP-miscConversions' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:46:02 +01:00
Simon Gladman
eabf7d46ac Merge remote-tracking branch 'origin/accelerate-vDSP-elementwiseVectorArithmetic' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:44:55 +01:00
Simon Gladman
a2ad79fc9e Merge remote-tracking branch 'origin/accelerate-vDSP-vectorReduction' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:43:29 +01:00
Simon Gladman
95eaa0d3ad Merge remote-tracking branch 'origin/accelerate-vDSP-differenceEquationAndDownsampling' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:41:42 +01:00
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
Alex Langford
3d9a28925b [CMake] Modify swift_install_in_component to support cmake install components
CMake supports the notion of installation components. Right now we have some
custom code for supporting swift components. I think that for installation
purposes, it would be nice to use the CMake component system.

This should be a non-functional change. We should still only be generating
install rules for targets and files in components we want to install, and we
still use the install ninja target to install everything.
2019-04-19 14:06:11 -07:00
Joe Groff
7bab318238 Merge pull request #24159 from jckarter/protocol-extension-context-lookup
MetadataLookup: Use extension's generic context for non-nominal extensions.
2019-04-19 13:37:48 -07:00
Saleem Abdulrasool
9f96244855 Merge pull request #24074 from gmittert/LetMeKnow
Provide inotify from glibc
2019-04-19 13:00:21 -07: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
Joe Groff
9a411bea6a MetadataLookup: Use extension's generic context for non-nominal extensions
In protocol extensions, and in the future parameterized extensions, have their own generic arguments
independent of an originating nominal type's formal generic parameters. Instead of crashing, handle
this gracefully. rdar://problem/50038754
2019-04-19 10:30:43 -07:00
swift-ci
bd1ce98e4b Merge pull request #24148 from gmittert/WinHandles 2019-04-19 09:10:42 -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
Gwen Mittertreiner
47517ab544 Add Std Handle Values to WinSDK
Added the values of STD_*_HANDLE to WinSDK for use with GetStdHandle
2019-04-18 16:56:07 -07:00
Joe Groff
a8c2b50bd8 Merge pull request #22072 from jckarter/opaque-type-runtime
Opaque types with resilience
2019-04-18 14:52:31 -07:00
Keita Nonaka
9411a0823a change var to let 2019-04-18 15:39:40 -04:00
Keita Nonaka
2771eb520c fix warnings 2019-04-18 13:11:57 -04: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
Simon Gladman
74e7413b28 Remove spurious parameter from comments for clear() function. 2019-04-18 09:50:24 +01: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
Joe Groff
95c43f4e18 Decode opaque types in the runtime demangler. 2019-04-17 14:44:40 -07:00
Joe Groff
a3c17bd080 Runtime: Implement entry points for opaque type support 2019-04-17 14:44:40 -07:00
Joe Groff
05dfec0cda Push the conformance accessor hack down into getTypeByMangledName. 2019-04-17 14:44:40 -07:00
swift-ci
4dc763aa4b Merge pull request #23964 from atrick/fix-prespecialize 2019-04-16 16:57:57 -07: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
Gwen Mittertreiner
c79bb5b607 Provide inotify from glibc 2019-04-16 15:54:34 -07:00
swift-ci
fb29702abf Merge pull request #24056 from colemancda/windowsPosixError 2019-04-16 10:48:39 -07:00
Andrew Trick
d8a3b1eef5 Guard _ArrayBuffer with #if _runtime(_ObjC) 2019-04-16 10:14:22 -07:00
Alsey Coleman Miller
32fb4980e8 Compile POSIXError.swift for Windows 2019-04-16 02:06:45 -05:00
Alsey Coleman Miller
371b7ca764 Added POSIXErrorCode for Windows
https://docs.microsoft.com/en-us/cpp/c-runtime-library/errno-doserrno-sy
s-errlist-and-sys-nerr
2019-04-16 01:59:04 -05:00
Andrew Trick
700f81613b Rewrite SwiftOnoneSupport and add missing required prespecialization symbols.
In the prior revision, this file combined two approaches:

- the old approach of doing some fun things with arrays and hoping
  that any important public and internal generic symbols will happen
  to be specialized

- the new approach of explicitly specializing a generic symbol by
  annotating a dummy "proxy" function with the actual generic mangled
  name, then calling that proxy with an argument of the type to be
  specialized.

Unfortunately, the symbols exposed by SwiftOnoneSupport have become
ABI. Therefore, the old approach can break over time because changes
to the compiler and standard library will affect which symbols happen
to be specialized. It can be extremely difficult to debug why those
symbols have gone missing.

The new approach will work to ensure ABI stability, but the
implementation was incomplete and the style of implementation would
not work in many cases. It was still relying on the old approach to
cover the generic symbols that weren't explicitly specialized. Also,
it wasn't clear to anyone reading the source what specializations of
those generic symbols are intended and required by the ABI.

This commit completely removes the old approach to prespecialization.

All generic symbols required by the ABI are now explicitly listed.

There are now several different proxy functions declared as methods
within the generic type that they represent. The parameter types of
each proxy function now match the parameter types of the generic
function. This guarantees that the compiler can correctly apply the
proxy function's subsitution map to the generic function's generic
signature. For example, it now handles subtitution of dependent types
(like Range<T>), substitutions that are not in the first parameter
position, and subsitition that occur in multiple parameters.

The proxy functions are now directly invoked with the concrete
argument type needed for specialization. There's no other incidental
code.

It is now possible to read this source and understand which standard
library functions need to be prespecialized on which types.
2019-04-15 20:51:35 -07:00
Zhuowei Zhang
5cdb32f624 [stdlib] fix prototype declaration in RuntimeShims.h
_swift_stdlib_getHardwareConcurrency's declaration isn't a proper prototype:
it's missing `void` inside the brackets.

Found while compiling the stdlib to WebAssembly, which fails with:

Functions with 'no-prototype' attribute must take varargs: _swift_stdlib_getHardwareConcurrency

This shouldn't impact existing platforms.
2019-04-15 19:03:28 -07:00
swift-ci
388c21ac64 Merge pull request #24000 from Catfish-Man/thread-specific-doh 2019-04-15 18:08:06 -07:00
Saleem Abdulrasool
b6ca2fb786 Merge pull request #24028 from colemancda/posixErrorGlibc
[stdlib] Include POSIXError as part of Glibc
2019-04-15 17:05:12 -07:00
swift-ci
73edb17824 Merge pull request #23802 from Catfish-Man/transparently-false 2019-04-15 16:28:58 -07:00
David Smith
584fbfc245 Avoid the overhead of looking up the current CFAllocator in String bridging 2019-04-15 15:28:00 -07:00
Karoy Lorentey
e08b219448 Merge pull request #23683 from lorentey/casting-improvements
[stdlib] Fix Set/Dictionary casting issues
2019-04-15 10:56:38 -07:00
David Smith
7db8cb1ea3 SR-10294: convertBoolToDarwinBool and friends should be inlined 2019-04-15 09:00:29 -07:00
simon gladman
f454132641 Add pseudo code to inverted clip description. 2019-04-15 13:25:50 +01:00
Alsey Coleman Miller
787bc36f6d [stdlib] Include POSIXError as part of Glibc 2019-04-14 17:03:06 -05:00
Yigitcan Yurtsever
68c00792df Fix doc typo on yearForWeekOfYear case in DateComponents 2019-04-12 18:58:52 -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
Stephen Canon
9e61aaefba Temporarily remove the global min(a,b) and max(a,b) SIMD functions. (#23960)
These are triggering a bad compile-time regression for some expressions; that's a bug that should be fixed, but we don't know how to fix it yet, so we'll need to remove these in the short-term, and possibly spell them differently in the medium term.
2019-04-12 16:30:32 +02:00
Andrew Trick
3571f583fc Add -disable-access-control to the SwiftOnoneSupport library build.
The purpose of this module is to prespecialize generic methods in the
stdlib. All symbols exposed by the ABI must be explicitly identified
to maintain ABI compatibility. Some of those ABI-exposed symbols
reference internal stdlib types.

Given that we want the prespecialized code to live in the separate
SwiftOnoneSupport library, and we want the module to explicitly list
all the symbols required for ABI stability, there's no way around
disabling access control when building it. In fact, that flag does
precisely what we want.

This should be harmless because
- no one imports SwiftOnoneSupport.swiftmodule
- these internal symbols were always being exposed in
SwiftOnoneSupport.dylib, so nothing changes there
2019-04-11 12:14:35 -07:00
Ross Bayer
a316fa9590 Merge pull request #23903 from Rostepher/shims-with-stdlib
[Build System: CMake] Install the Swift shims in the stdlib component.
2019-04-09 19:11:53 -07:00
Ross Bayer
ecd3af833d Merge pull request #23898 from Rostepher/layouts-install-with-compiler
[Build System: CMake] Install the layouts-*.yaml files in the compiler component.
2019-04-09 19:11:41 -07:00