Commit Graph

6024 Commits

Author SHA1 Message Date
NevinBR
7477f99f24 Updated diagram to show srcHigh and destLow are the same 2021-06-14 23:04:57 -04:00
Stephen Canon
9956097927 Use the custom implementation of multipliedFullWidth on arm64_32 (#37905)
Previously we were falling back on the generic implementation for 64b integers, which resulted in the following codegen:

00000008	asr	x8, x0, #32
0000000c	asr	x9, x0, #63
00000010	cmp	x0, #0x0
00000014	cinv	w10, w0, lt
00000018	eor	w9, w10, w9
0000001c	asr	x10, x1, #32
00000020	asr	x11, x1, #63
00000024	cmp	x1, #0x0
00000028	cinv	w12, w1, lt
0000002c	eor	w11, w12, w11
00000030	umull	x12, w11, w9
00000034	mul	x11, x11, x8
00000038	add	x11, x11, x12, lsr #32
0000003c	asr	x12, x11, #63
00000040	cmp	x11, #0x0
00000044	cinv	w13, w11, lt
00000048	eor	w12, w13, w12
0000004c	madd	x9, x9, x10, x12
00000050	mul	x8, x10, x8
00000054	add	x8, x8, x11, asr #32
00000058	add	x0, x8, x9, asr #32
0000005c	ret

Instead, we should use the 64b implementation when targeting arm64_32, which allows us to generate:

00000008	smulh	x0, x1, x0
0000000c	ret

Unsurprisingly, this is considerably faster.
2021-06-14 21:38:51 -04:00
NevinBR
ed0b7737fd [nfc] Fixed typos in comments in Sort.swift
There is still an incongruity between where `srcHigh` and `destHigh` are displayed in the diagram:

`srcHigh` is shown at the location it logically represents, not its true position which is one past that, whereas `destHigh` (as well as `bufferHigh`) is shown at its true position (past the end) not at the location it logically represents.

I am not sure if that is intentional.
2021-06-11 23:27:51 -04:00
Guillaume Lessard
2bcc6a7f72 [doc] update doc-comment references to a long-renamed function
fixes SR-12938
2021-06-08 15:05:13 -06:00
Mishal Shah
23c3b15f5f Support Xcode 13 beta
* Updating availability versions
* Remove all remaining overlays in stdlib/public/Darwin/*:
   - ObjectiveC
   - Dispatch
   - CoreFoundation
   - CoreGraphics
   - Foundation
2021-06-07 12:04:31 -07:00
Guillaume Lessard
09ea2fbda5 bring customPlaygroundQuickLook availability message in line with reality
- all other instances of the customPlaygroundQuickLook availability message
  mention "a future Swift version" rather than "Swift 5.0".
2021-05-28 15:11:11 -06:00
Chris Adamson
8f76011ac4 Remove extraneous /-es from license comments. (#37632)
Co-authored-by: Chris Adamson <cadamson@apple.com>
2021-05-26 14:20:17 -04:00
Kyle Macomber
c09bdead88 Fixes copyright comment
rdar://78178197
2021-05-25 21:08:42 -07:00
ensan
b24892becf rename hasPrefix(_ prefix: String) -> Bool to hasSuffix(_ suffix: String) -> Bool (#37336) 2021-05-08 12:31:14 -04:00
swift-ci
512be2cec6 Merge pull request #36945 from tbkka/tbkka/rdar76728925 2021-04-20 18:12:34 -07:00
Robert Widmann
b65777eabe Merge pull request #36963 from CodaFi/arm64_32
Add arm64_32 support for Swift
2021-04-20 17:42:56 -07:00
Alex Martini
4b2f4874b3 Use markup for a note box. 2021-04-20 15:46:45 -07:00
Tim Kientzle
fbec09bd56 Consolidate format-independent discussion at the end 2021-04-20 15:40:39 -07:00
Robert Widmann
0149ccd0ca Add arm64_32 support for Swift
Commit the platform definition and build script work necessary to
cross-compile for arm64_32.

arm64_32 is a variant of AARCH64 that supports an ILP32 architecture.
2021-04-20 14:59:04 -07:00
Stephen Canon
8736683cf7 Prevent arbitrary objects from conforming to RNG. (#36969)
Me, sobbing: "Look, you can't just point at an empty struct and call it a RandomNumberGenerator."
Swift 5.4, pointing at anything: "RNG."
2021-04-20 16:39:16 -04:00
Tim Kientzle
2a476586d7 Backwards compatibility note 2021-04-20 11:25:03 -07:00
Tim Kientzle
1d5eb5b2be Wordsmithing 2021-04-19 10:30:31 -07:00
Tim Kientzle
0c7f85c56d Feedback 2021-04-19 10:25:09 -07:00
Tim Kientzle
33226b0505 Distinguish "string" (input), "value" or "number" (abstract real number that the string represents), and "instance" (the resulting ${Self}). 2021-04-19 09:09:11 -07:00
Tim Kientzle
b183c7d6c3 present, not future 2021-04-16 16:12:12 -07:00
Tim Kientzle
20ba149dc3 More wordsmithing. 2021-04-16 14:00:11 -07:00
Tim Kientzle
98cec1321d Document how out-of-range inputs are handled
This changed recently so that overflow and underflow consistently return signed
infinity or zero instead of nil.  (Previously, overflow returned nil, underflow
returned zero.)

Among other benefits:
 * The new behavior distinguishes malformed input (nil) from valid but out-of-range input.
 * The new behavior preserves the sign of the input
 * The new behavior is consistent with how floating-point parsing behaves in other langauges

Resolves rdar://76728925
2021-04-16 10:22:59 -07:00
Doug Gregor
194536472a [AnyHashable] Work around older compiler limitation.
An older Swift compiler failed to account for the witnesses in a
conformance with platform availability having their own availability,
which causes that compiler to reject the Swift module's .swiftinterface
file when it includes `AnyHashable` 's conformance to
`_HasCustomAnyHashableRepresentation`. Work around the issue by making
the one witness (`_toCustomAnyHashable`, which is trivial)
always-emit-into-client, so it does not need any availability.

Fixes rdar://76370138.
2021-04-15 21:21:41 -07:00
heoblitz
20ffc036ed Add whitespace to markup 2021-04-14 14:43:14 +09:00
Benzi
4e0c6f99b8 [stdlib] Set.intersection iterate over smaller set (#36678)
* [stdlib] Set.intersection iterate over smaller set

When intersecting two sets, it is beneficial to iterate over the smaller sized set of the two, and check membership on the other. This speeds up runtime dramatically for cases where the current set is significantly larger than the set you are intersecting against.

* Review comments - variable names, implicit swap
2021-04-11 11:42:10 -04:00
Ben Cohen
125902923c Revert lazy mirror children (#36722) 2021-04-08 16:34:50 -10:00
Doug Gregor
fcd5d43457 Revert "stdlib: Add reasync variants of '&&', '||' and '??'" 2021-04-05 16:45:44 -07:00
Alex Martini
1c5c111aab Merge pull request #36709 from amartini51/main
Doc comment corrections
2021-04-05 15:46:31 -07:00
Michael Ilseman
9ab21d3215 Merge pull request #36623 from xwu/better-atoi
[stdlib][SR-7556] Re-implement string-to-integer parsing
2021-04-03 08:30:25 -06:00
Michael Ilseman
f495c02afe Merge pull request #36667 from milseman/small_differential
[stdlib] Fix bug in small string uninitialized init
2021-04-02 16:46:51 -06:00
Xiaodi Wu
cef11cd82e [stdlib][NFC] Final renamings for new integer parsing implementations. 2021-04-02 10:20:04 -04:00
Karoy Lorentey
63d0b734c0 Merge pull request #36669 from lorentey/fix-float16-sendable
[stdlib] Float16/Intel: Add an explicit Sendable conformance to work around a swiftinterface issue
2021-04-02 01:37:07 -07:00
Alex Martini
4b3064ede5 Simplify prose in doc comment.
Incorporates PR feedback from @tbkka.
2021-04-01 16:05:48 -07:00
Alex Martini
1bfce98e8d Revise finite/infinite note for NaN.
Incorporates PR feedback from @tbkka.
2021-04-01 16:05:48 -07:00
Xiaodi Wu
c40c90402a [stdlib] Address reviewer comments and make some minor edits to string-to-integer parsing. 2021-04-01 13:03:56 -04:00
Karoy Lorentey
cb67f45394 [stdlib] Float16: Add explicit Sendable conformance to work around swiftinterface issue 2021-04-01 00:51:14 -07:00
Slava Pestov
c473869141 stdlib: Add reasync variants of '&&', '||' and '??'
Fixes rdar://problem/72770687.
2021-03-31 19:21:08 -04:00
Karoy Lorentey
ec7258e2fc [stdlib] Fix incorrect Float16 extension
This extension (introduced in https://github.com/apple/swift/pull/35264) was placed in a file location where it wasn’t correctly guarded against mentioning Float16 on macOS/x86_64, so the generated .swiftinterface file included a reference to an unavailable declaration. (The dummy stand-in Float16 type that we currently use on Intel macOS.)

Moving the declaration out of the “AnyHashable” section and into a file region that’s more suitable for it (i.e., enclosed in `#if !((os(macOS) || targetEnvironment(macCatalyst)) && arch(x86_64))`) resolves the issue.

rdar://76025365
2021-03-30 18:43:16 -07:00
Michael Ilseman
49eddbf318 [stdlib] Fix bug in small string uninitialized init
Fix a bug and enforce the invariant that all bits between the last code unit
and the descriminator in a small string should be unset.
2021-03-30 18:24:28 -06:00
Xiaodi Wu
5d943f46bd [stdlib] Further simplify string-to-integer parsing and change some inlining choices. 2021-03-29 12:08:28 -04:00
Xiaodi Wu
0319bdc966 [gardening] Fix tab size inconsistency. 2021-03-29 11:30:48 -04:00
Xiaodi Wu
529891c911 [stdlib] Simplify implementation of string-to-integer parsing. 2021-03-29 11:27:21 -04:00
Xiaodi Wu
ebad4bbb5d [stdlib] Specialize FixedWidthInteger.init(_:radix:). 2021-03-29 10:19:22 -04:00
Xiaodi Wu
cc8a351cc1 [stdlib] Never inline two more string-to-integer parsing methods. 2021-03-29 09:02:41 -04:00
Xiaodi Wu
7c333b8e44 [stdlib] Never inline fallback helper methods when parsing strings to integers. 2021-03-28 22:22:50 -04:00
Xiaodi Wu
a9c57c3bcd [stdlib] Make FixedWidthInteger.init?(_:radix:) always inlined, and fix a think-o. 2021-03-28 20:44:11 -04:00
Xiaodi Wu
ad992f48dd [stdlib][SR-7556] Re-implement string-to-integer parsing. 2021-03-28 16:49:09 -04:00
Stephen Canon
09cd45d4c2 Remove a small helper function that took a Builtin.VecNxInt1 type.
It saved some boilerplate, but if it doesn't get inline (as in debug builds), Swift doesn't know how to legalize the type at the call boundary, and we crash.
2021-03-24 23:34:28 -04:00
Stephen Canon
5afe404707 Concrete simd mask operations (#36571)
* Replace lhs/rhs with a/b for clarity of documentation and to match concrete ops.

* Concretize additional SIMDMask operations:

.&=, .|=, .^=, .==, .!=

Also reflect documentation changes back to generic implementations.
2021-03-24 23:15:46 -04:00
Karoy Lorentey
390cebe88b Merge pull request #36004 from lorentey/document-copyContents
[stdlib] Document a fatal surprise with `Sequence._copyContents`
2021-03-22 16:49:18 -07:00