Commit Graph

32 Commits

Author SHA1 Message Date
Xiaodi Wu
8014793cf1 Remove final _mixInt in synthesized hashValue and improve the _combineHashValues magic number 2018-02-03 00:06:48 -06:00
Xiaodi Wu
78875d934c Update and fill in documentation for DoubleWidth and integer protocols 2018-01-30 20:52:24 -06:00
Xiaodi Wu
4b9ff41303 Address reviewer comments 2018-01-30 18:55:19 -06:00
Xiaodi Wu
cc0e64dec4 Implement efficient DoubleWidth division and fix division-related bugs 2018-01-28 14:01:06 -06:00
Max Moiseev
5650f80937 [stdlib] Annotate types with @_fixed_layout
This will allows us to build the standard library in resilient mode by
default, hopefully, without performance regression.

<rdar://problem/36362648>
2018-01-09 14:46:30 -08:00
Nate Cook
0782b482b3 [stdlib] Documentation improvements
- Revise Equatable and Hashable for synthesized requirements
- Complete Strideable and stride(from:...:by:) documentation
- Revise DoubleWidth type docs
- Add complexity notes for Set.index(of:) and .contains(_:)
- Fix typos in Set.formUnion docs
- Add missing axioms for SetAlgebra (SR-6319)
- Improve guidance for description and debugDescription
- Add note about the result of passing duplicate keys to
  Dictionary(uniqueKeysWithValues:)
- Fix typo in BinaryInteger docs
- Update Substring docs with better conversion example
- Improve docs for withMemoryRebound and isKnownUniquelyReferenced
- Add missing docs not propagated from protocols
2018-01-05 17:06:44 -06:00
Xiaodi Wu
5236a37df8 Make some improvements to DoubleWidth.&<<= and &>>= 2018-01-03 21:54:05 -06:00
Xiaodi Wu
b7ef345c88 Update DoubleWidth.hashValue to align with derived hashValue algorithm 2018-01-01 14:56:16 -06:00
Xiaodi Wu
869b9257cc Clean up DoubleWidth implementation 2018-01-01 14:56:16 -06:00
Xiaodi Wu
81311bebf8 Match memory layout of DoubleWidth to base integer types 2017-12-10 02:30:40 -06:00
Nate Cook
45c4c47393 [stdlib] Make DoubleWidth conform to Unsigned/SignedInteger 2017-11-30 21:58:26 -06:00
Ben Cohen
dcab9493ae Removed some warnings (#12753) 2017-11-30 15:12:56 -08:00
Nate Cook
abb75bca1a Allow large integer literals for DoubleWidth 2017-11-24 22:48:35 -06:00
Max Moiseev
a24998a5b1 [stdlib] Add missing @_fixed_layout attributes to fix resilience build 2017-10-02 15:19:06 -07:00
Max Moiseev
53b8419279 [stdlib] Make all the stdlib APIs @_inlineable
This change in theory should allow us to remove a special stdlib-only
sil-serialize-all compilation mode.

<rdar://problem/34138683>
2017-09-29 11:26:56 -07:00
Roman Levenstein
762731940d Force specialization of a very big function quotientAndRemainder for the most popular values of generic type parameters.
This reduces the amount of work to be done on the client side, because specializations from the stdlib can be used there.
2017-08-21 16:16:16 -07:00
Nate Cook
4e45358a49 Merge branch 'master' into nc-dwformatting 2017-08-02 14:54:56 -05:00
Nate Cook
a7ce287a53 Merge branch 'master' into integers-revised 2017-07-28 12:23:48 -05:00
Nate Cook
1952128dca DoubleWidth feedback from @moiseev 2017-07-27 22:51:46 -05:00
Maxim Moiseev
47e78c071a Merge pull request #11044 from apple/rationalize-bitshifting
[stdlib] Rationalize bitshifting in protocols
2017-07-27 14:50:14 -07:00
Max Moiseev
1c3e597928 [stdlib] Get rid of ArithmeticOverflow type 2017-07-26 11:09:36 -07:00
Maxim Moiseev
5d47a0d98d [stdlib] init<T : FloatingPoint> ==> init<T : BinaryFloatingPoint> 2017-07-26 11:09:36 -07:00
Maxim Moiseev
a5ff35cd41 [stdlib] extendingOrTruncating: => truncatingIfNeeded: 2017-07-26 11:09:36 -07:00
Nate Cook
7e5c78c1d4 [stdlib] DoubleWidth formatting and bit shift audit 2017-07-24 19:37:32 -05:00
Nate Cook
47d050ecb3 [gardening] Fix inconsistencies in DoubleWidth 2017-07-24 19:35:59 -05:00
Dave Abrahams
33e9ec4690 [stdlib] Rationalize bitshifting in protocols
Only FixedWidthInteger, not BinaryInteger, should have masking shifts.
BinaryInteger should have a non-masking shift requirement.

Removed some dead code.
2017-07-18 16:00:44 -07:00
Dave Abrahams
c497969987 [stdlib] Swift4 Modernizations Compatible with Swift 3.2 2017-07-14 17:54:33 -07:00
Károly Lőrentey
826f8daf4a [stdlib] _lowUWord => _lowWord 2017-07-10 22:40:52 +02:00
Károly Lőrentey
c8d4fd4242 [stdlib] Remove BinaryInteger._word(at:)
Removes BinaryInteger's _word(at:) requirement and its
countOfRepresentedWords property, making the words property the
sole way to access an integer's words.

This is a better fix for https://bugs.swift.org/browse/SR-5275.
2017-07-10 22:40:52 +02:00
Károly Lőrentey
7836268d45 [stdlib] Implement BinaryInteger.words in standard integer types.
Introduces the following new collection types as lightweight
views of a corresponding integer value:

- UInt.Words
- UInt64.Words (on 32-bit platforms)
- DoubleWidth.Words

The rest of the standard integer types define Words as a typealias
to one of the first two of these, based on their width.
2017-07-10 19:03:34 +02:00
Xiaodi Wu
f8688d2f97 Update DoubleWidth.swift.gyb 2017-06-21 20:03:48 -05:00
Nate Cook
6133adc413 [stdlib] Move DoubleWidth into its own file 2017-06-06 08:54:15 -07:00