Commit Graph

48 Commits

Author SHA1 Message Date
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
Jordan Rose
979e4a8e34 stdlib: Rename {Float,Double.CGFloat}.NaN to 'nan'
This follows the API guidelines and is consistent with the printed form.
'quietNaN' does not change, though.
2016-02-24 17:46:12 -08:00
Max Moiseev
40b1a0b7e0 [stdlib] all sorts of require renamed back to precondition 2016-02-19 18:21:29 -08:00
Dmitri Gribenko
dd75aed67a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-17 14:40:05 -08:00
Dmitri Gribenko
bf34b047d8 stdlib: lowercase cases of FloatingPointClassification enum 2016-02-15 23:48:02 -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
Nate Cook
32f81e8238 Add missing abstracts for types and protocols. 2016-02-11 11:47:27 -06:00
Dmitri Gribenko
9bcd5a1056 Collection.length => .count 2016-01-22 18:41:19 -08:00
Max Moiseev
08e1e4a043 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-11 16:51:11 -08:00
Maxim Moiseev
bf969a385f Merge pull request #894 from nonsensery/fix-inc-if-signed-logic
[stdlib] Remove confusing `incIfSigned` control flow
2016-01-08 17:27:13 -08:00
nonsensery
e76dbd5798 Remove confusing incIfSigned control flow
This function was named exactly backwards (it incremented only when
*not* signed). Investigating this naming error revealed that the call
site was also unclear: `incIfSigned` was called from a block where
`signed` was known to be False). So, I inlined the logic in the one
place where it was actually used, and removed the function.
2016-01-08 15:35:15 -08:00
Doug Gregor
1a38e0ad3b Merge branch 'master' into swift-3-api-guidelines 2016-01-06 15:32:55 -08:00
nonsensery
a23e16199f [stdlib] Fix conversion from (signed) int to float in default init
The default initializer for a float types initializes the value to `0`
by calling a “builtin” function to convert an integer with value `0`
into an “FPIEEE” float with value `0`. The integer value is signed, but
the code was calling a function that expected an unsigned integer.
2016-01-05 16:08:02 -08: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
Max Moiseev
200be71583 Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-23 10:28:04 -08:00
Max Moiseev
a7339e67ac Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-22 11:36:07 -08:00
ken0nek
fcd8fcee91 Convert [Cc]an not -> [Cc]annot 2015-12-23 00:55:48 +09:00
Chris Lattner
be53728691 Mark the ++ and -- operators in the standard library as deprecated for Swift 2.2,
to be removed in Swift 3.0.  I plan to improve the QoI of this deprecation in a
subsequent commit.
2015-12-21 22:10:25 -08: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
Max Moiseev
2021dd5a4d Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-15 12:49:22 -08:00
Wojtek Czekalski
10b61b7d8c Made floating point numbers conform to CustomDebugStringConvertible
debugDescription prints numbers with greater precision
2015-12-14 19:25:14 +01:00
Maxim Moiseev
50fba4b770 floating point types renamed 2015-12-10 17:05:11 -08:00
Joe Groff
fbd2e4d872 Rename @asmname to @_silgen_name.
This reflects the fact that the attribute's only for compiler-internal use, and isn't really equivalent to C's asm attribute, since it doesn't change the calling convention to be C-compatible.
2015-11-17 14:13:48 -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
Dmitri Hrybenko
9383927356 stdlib: trap correctly in floating-point to unsigned integer conversion
Uncovered by Dave's fixes to gyb.

<rdar://problem/23247773>

Swift SVN r32879
2015-10-25 04:53:37 +00: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
dd3194a18c stdlib: adopt @warn_unused_result
rdar://20957486

Swift SVN r31048
2015-08-06 14:53:18 +00:00
Joe Groff
eaa1ef8e35 stdlib: Fix sign bug in Float*(integerLiteral:).
Int is signed, not unsigned, so should be converted using sitofp. Fixes rdar://problem/20467684.

Swift SVN r30487
2015-07-22 02:44:37 +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
Dmitri Hrybenko
313701286b stdlib: Various punctuation and markup improvements to the comments.
Patch by Brian Lanier.

Swift SVN r28659
2015-05-16 03:04:51 +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
Dave Abrahams
106b39a497 [stdlib] Indent bullet continuations in doc comments
The text is a lot more readable that way.

Swift SVN r28471
2015-05-12 16:59:08 +00:00
Chris Lattner
c1df892d47 improve stdlib hygiene a bit.
Swift SVN r28392
2015-05-10 02:55:18 +00:00
Dmitri Hrybenko
7776ba5a71 stdlib: clean up capitalization in doc comments
Patch by Brian Lanier and Alex Martini.

Swift SVN r28335
2015-05-08 23:44:05 +00:00
David Farler
9e28dc777a Update standard library doc comments to Markdown
rdar://problem/20180478

Swift SVN r27726
2015-04-26 00:07:11 +00:00
Dave Abrahams
ac3f047496 [stdlib] Renaming fallout from Mirror API review
toString(x)      => String(x)
toDebugString(x) => String(reflecting: x)
Printable        => CustomStringConvertible
DebugPrintable   => CustomDebugStringConvertible

Also updated comments to clarify these protocols

Swift SVN r27090
2015-04-07 20:32:26 +00:00
Doug Gregor
c69294562e Clean up explicit protocol conformances in the standard library.
Eliminates redundant conformances and resolves ambiguous implied
conformances. NFC.

Swift SVN r26066
2015-03-12 21:11:12 +00:00
Dmitri Hrybenko
b13758e6f4 Move floating point parsing APIs to SwiftExperimental
These APIs did not go through API review.

Swift SVN r25891
2015-03-09 19:04:22 +00:00
Dmitri Hrybenko
350248dae5 Reorganize the directory structure under 'stdlib'
The standard library has grown significantly, and we need a new
directory structure that clearly reflects the role of the APIs, and
allows future growth.

See stdlib/{public,internal,private}/README.txt for more information.

Swift SVN r25876
2015-03-09 05:26:05 +00:00