Commit Graph

50 Commits

Author SHA1 Message Date
Sho Ikeda
c076316722 [gardening][Overlay] Prefer macOS over OSX for @available 2018-03-23 13:36:59 +09:00
Stephen Canon
8e11af4012 Make the naming of underlying builtin for FP + Vector match Integer. (#15430)
* Make the underlying builtins for FP + Vector match Integer.

For stdlib integer types, these are named `_value` and `init(_ _value: Builtin.xxx)`. This patch adopts the same scheme for stdlib floating point and SDK overlay vector types, and removes a legacy init for integers that was only needed to support them. There should be no changes visible outside of the stdlib, and no functional change within the stdlib; the naming of some implementation details is simply more uniform now.
2018-03-22 16:43:20 -04:00
Jordan Rose
1598a21e43 DI: Warn on non-delegating cross-module struct initializers
...as detected by initializing an individual field without having
initialized the whole object (via `self = value`).

This only applies in pre-Swift-5 mode because the next commit will
treat all cross-module struct initializers as delegating in Swift 5.
2017-11-09 11:24:28 -08:00
Kuba (Brecka) Mracek
d03a575279 Unify the capitalization across all user-visible error messages (#11599)
* Unify the capitalization across all user-visible error messages (fatal errors, assertion failures, precondition failures) produced by the runtime, standard library and the compiler.

* Update some more tests to the new expectations.
2017-08-29 12:16:04 -07:00
Mishal Shah
c5ff1f2cac Update master to build with Xcode 9 beta 1, OS X 10.13, iOS 11, tvOS 11, and watchOS 4 SDKs. 2017-06-14 16:20:35 -07:00
Max Moiseev
27889c6376 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-06 15:54:44 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Max Moiseev
70b2343626 Merge branch 'master' into new-integer-protocols 2016-11-28 15:25:01 -08:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Max Moiseev
2190819e99 Breaking up complex expression to improve compilation time 2016-10-12 15:04:54 -07:00
practicalswift
8287c5dfca [gardening] Remove trailing semicolons.
Inspiration: 425138c56e
2016-07-19 00:04:53 +02:00
Robert Widmann
f97e5dcb0e [SE-0115][1/2] Rename *LiteralConvertible protocols to ExpressibleBy*Literal. This
change includes both the necessary protocol updates and the deprecation
warnings
suitable for migration.  A future patch will remove the renamings and
make this
a hard error.
2016-07-12 15:25:24 -07:00
Dmitri Gribenko
d591f9cf7a stdlib: remove most uses of @warn_unused_result, which does nothing now
I kept the one on sorted(), because that one requires a less trivial
change.
2016-05-19 18:39:39 -07:00
practicalswift
c760f6dfbf [gardening] Add whitespace: "foo,bar" → "foo, bar" 2016-04-12 22:31:46 +02:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Jordan Rose
6dd1f0a5f9 [stdlib] Apply @_fixed_layout to various stdlib and overlay types
This is a staging attribute that will eventually mean "fixed-contents"
for structs and "closed" for enums, as described in
docs/LibraryEvolution.rst.

This is pretty much the minimal set of types that must be fixed-layout,
because SILGen makes assumptions about their lowering.

If desired, some SILGen refactoring can allow some of these to be
resilient. For example, bridging value types could be made to work
with resilient types.
2016-04-01 13:07:18 -07:00
Stephen Canon
8187dfb140 Added uint[2,3,4] to simd, bridged to vector_uintN. 2016-03-24 07:56:59 -04:00
Daniel Duan
276370b599 [stdlib] apply SE-0040 to stdlib 2016-03-11 16:01:41 -08:00
Max Moiseev
a49dab6bf8 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-29 12:08:52 -08:00
Daniel Duan
2bc78b8c09 [stdlib] update for 'inout' adjustment (SE-0031) 2016-02-26 12:02:29 -08:00
Max Moiseev
40b1a0b7e0 [stdlib] all sorts of require renamed back to precondition 2016-02-19 18:21:29 -08:00
Dmitri Gribenko
efaa39ea79 stdlib: add first argument labels and some other changes to conform to API guidelines 2016-02-15 23:47:54 -08:00
Dmitri Gribenko
9bcd5a1056 Collection.length => .count 2016-01-22 18:41:19 -08:00
Doug Gregor
7d70b704e4 Merge commit '5e11e3f7287427d386636a169c4065c0373931a8' into swift-3-api-guidelines 2016-01-19 23:18:20 -08:00
practicalswift
73b63c894b Conform to standard spacing around operators, etc. 2016-01-09 01:39:22 +01:00
Max Moiseev
f51e708a8f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-04 12:25:25 -08:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Dmitri Gribenko
73ce9ae7e9 Collection.count => .length
And other API changes that naturally fall out from this, like
Array(repeating:count:) => Array(repeating:length:).
2015-12-17 15:55:29 -08:00
Maxim Moiseev
e6468a0eca _precondition => _require 2015-12-16 17:19:01 -08:00
Jordan Rose
cf8baedee2 Re-apply "Rename @transparent to @_transparent for now."
This re-applies 90fcbfe9a6. I'll be committing
the corresponding change to Foundation momentarily.
2015-11-16 10:53:56 -08:00
Xin Tong
16843684b2 Revert "Rename @transparent to @_transparent for now."
This reverts commit 90fcbfe9a6.

Seems there are still some tests that are left not modified.
2015-11-14 07:04:31 -08:00
Jordan Rose
90fcbfe9a6 Rename @transparent to @_transparent for now.
This feature has not been fully designed, let alone properly implemented.
For more information, see docs/TransparentAttr.rst.
2015-11-13 16:25:34 -08:00
Jordan Rose
6e1bf0d10d Rename @exported to @_exported for now.
At some point I want to propose a revised model for exports, but for now
just mark that support for '@exported' is still experimental and subject
to change. (Thanks, Max.)
2015-11-05 11:59:00 -08:00
Dmitri Hrybenko
4375a463a7 stdlib: rename Int**.value and Float**.value to _value per naming convention
rdar://21357661

Swift SVN r32096
2015-09-20 00:01:13 +00:00
Dmitri Hrybenko
e587ef0086 SDK overlay: adopt @warn_unused_result
Swift SVN r31051
2015-08-06 15:54:52 +00:00
Dmitri Hrybenko
c712ce3b5e simd overlay: drop label from second parameter in distance, distance_squared
Patch by Steve Canon.

Swift SVN r30695
2015-07-27 19:56:34 +00:00
Joe Groff
ae7f8bdb65 simd module: Only provide '&+', '&-', and '&*' variants of arithmetic operators.
Checked arithmetic is probably not what you want from the vector unit, but we still want code to be explicit about the fact that it's using wrapping semantics instead of trapping or UB semantics. Provide the wrapping variations of the operators, and leave behind unavailable definitions to direct users to the wrapping operations if they try to use the standard ones.

Swift SVN r30008
2015-07-09 01:20:20 +00:00
Joe Groff
0b54e21629 simd overlay: Use LLVM vector types.
This brings the David Owens benchmark from http://owensd.io/2015/06/27/performance-xcode7-beta-2.html from parity with simd.h-based C to 3x faster.

Before:

RenderGradient ([UInt32].withUnsafeMutablePointer (SIMD))                 │ 7.035851 │ 6.304739 │ 9.815832 │  1.212 │

After:

RenderGradient ([UInt32].withUnsafeMutablePointer (SIMD))                 │ 2.318357 │ 2.223325 │ 2.697981 │ 0.1490 │

This also addresses rdar://problem/21574425, since Builtin.add_VecNxIntM isn't overflow-checked, and overflow checks really aren't wanted when working with vector types directly.

Reapplying now that Nadav's fixed the ARM64 SelectionDAG issue this exposed before, and Arnold's fixed
yet another SelectionDAG issue exposed after that.

Swift SVN r30006
2015-07-09 01:20:01 +00:00
Arnold Schwaighofer
8517b7ba08 Revert "Un-XFAIL test on Linux."
Revert "simd overlay: Use LLVM vector types."

This reverts commit r29922 and r29924.

More arm64 instruction selection errors.

rdar://21703486

Swift SVN r29941
2015-07-07 16:45:08 +00:00
Joe Groff
9a23fa9040 simd overlay: Use LLVM vector types.
This brings the David Owens benchmark from http://owensd.io/2015/06/27/performance-xcode7-beta-2.html from parity with simd.h-based C to 3x faster.

Before:

RenderGradient ([UInt32].withUnsafeMutablePointer (SIMD))                 │ 7.035851 │ 6.304739 │ 9.815832 │  1.212 │

After:

RenderGradient ([UInt32].withUnsafeMutablePointer (SIMD))                 │ 2.318357 │ 2.223325 │ 2.697981 │ 0.1490 │

This also addresses rdar://problem/21574425, since Builtin.add_VecNxIntM isn't overflow-checked, and overflow checks really aren't wanted when working with vector types directly.

Reapplying now that Nadav's fixed the ARM64 SelectionDAG issue this exposed before.

Swift SVN r29922
2015-07-06 22:56:42 +00:00
Joe Groff
e692c87bbf Revert "simd overlay: Use LLVM vector types."
This reverts commit r29891. It causes an LLVM assertion failure in SelectionDAG on appletvos-arm64.

Swift SVN r29893
2015-07-02 17:31:34 +00:00
Joe Groff
8103dfb825 simd overlay: Use LLVM vector types.
This brings the David Owens benchmark from http://owensd.io/2015/06/27/performance-xcode7-beta-2.html from parity with simd.h-based C to 3x faster.

Before:

RenderGradient ([UInt32].withUnsafeMutablePointer (SIMD))                 │ 7.035851 │ 6.304739 │ 9.815832 │  1.212 │

After:

RenderGradient ([UInt32].withUnsafeMutablePointer (SIMD))                 │ 2.318357 │ 2.223325 │ 2.697981 │ 0.1490 │

This also addresses rdar://problem/21574425, since Builtin.add_VecNxIntM isn't overflow-checked, and overflow checks really aren't wanted when working with vector types directly.

Swift SVN r29891
2015-07-02 17:05:29 +00:00
Jordan Rose
5bbc879dc8 Fix simd overlay after previous revert.
I guess I missed this configuration, sorry.

Swift SVN r29445
2015-06-17 05:19:54 +00:00
Jordan Rose
955e130536 Diagnose self-imports of the module being compiled.
The case where this comes up is when people name their app and framework
targets the same thing, or when they've renamed their test target module
in an attempt to avoid issues with  NSClassFromString and differing
runtime names. We currently do various wrong things when this happens,
so just emit an error instead.

I left a hole for our overlays, which use '@exported import <the-current-module>'
to get at their Clang modules. The previous commit means this can be
replaced by -import-underlying-module, but that doesn't help our tests,
which use -enable-source-import for their overlays. Which we should stop doing.

rdar://problem/21254367

Swift SVN r29440
2015-06-17 04:48:01 +00:00
Ted Kremenek
f750954a53 Make scalar arguments to SIMD vector initializers anonymous.
Patch by Steve Canon.

Swift SVN r28932
2015-05-22 20:39:28 +00:00
Dave Abrahams
5c55682d8b [stdlib] Capitalize keywords in doc comments
Again, the text is a lot more readable that way.

Swift SVN r28472
2015-05-12 16:59:13 +00:00
Joe Groff
0722dd26ff stdlib: Roll the SIMD module back to C++ parity.
Committing on behalf of Steve Canon again. We'll hold off on innovating till we have a more complete story here.

Swift SVN r28385
2015-05-09 23:03:36 +00:00
Dmitri Hrybenko
8b392eeea9 Revert "Remove Array.count, it is redundant with protocol extensions"
This reverts commit r28247 while we discuss the change.

Swift SVN r28292
2015-05-07 21:45:30 +00:00
Dmitri Hrybenko
58601fafc8 Remove Array.count, it is redundant with protocol extensions
Swift SVN r28247
2015-05-07 00:30:41 +00:00
Joe Groff
11fcbda0e9 Add Steve Canon's simd module to the stdlib.
Swift SVN r28088
2015-05-02 15:46:38 +00:00