Skip to content

Commit 6c5d2e9

Browse files
authored
Merge pull request #15470 from moiseev/proto-dw
[stdlib] Move DoubleWidth to test/Prototypes
2 parents 67de216 + 8f63508 commit 6c5d2e9

File tree

8 files changed

+449
-446
lines changed

8 files changed

+449
-446
lines changed

stdlib/public/core/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ set(SWIFTLIB_ESSENTIAL
4848
CTypes.swift
4949
DebuggerSupport.swift
5050
Dictionary.swift
51-
DoubleWidth.swift.gyb
5251
DropWhile.swift
5352
Dump.swift
5453
EmptyCollection.swift

stdlib/public/core/GroupInfo.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@
134134
"BuiltinMath.swift",
135135
{
136136
"Integers": [
137-
"DoubleWidth.swift",
138137
"Integers.swift",
139138
"IntegerParsing.swift"],
140139
"Floating": [

stdlib/public/core/Integers.swift.gyb

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3552,23 +3552,11 @@ ${assignmentOperatorComment(x.operator, True)}
35523552
) -> (quotient: ${Self}, remainder: ${Self}) {
35533553
// FIXME(integers): tests
35543554
% # 128-bit types are not provided by the 32-bit LLVM
3555-
% #if word_bits == 32 and bits == 64:
3555+
% if word_bits == 32 and bits == 64:
35563556
% # FIXME(integers): uncomment the above after using the right conditional
35573557
% # compilation block to exclude 64-bit Windows, which does not support
35583558
% # 128-bit operations
3559-
% if bits == 64:
3560-
% HalfWidth = 'Int32' if signed else 'UInt32'
3561-
let lhsHigh =
3562-
unsafeBitCast(dividend.high, to: DoubleWidth<${HalfWidth}>.self)
3563-
let lhsLow = unsafeBitCast(dividend.low, to: DoubleWidth<UInt32>.self)
3564-
let rhs_ = unsafeBitCast(self, to: DoubleWidth<${HalfWidth}>.self)
3565-
3566-
let (quotient_, remainder_) = rhs_.dividingFullWidth((lhsHigh, lhsLow))
3567-
3568-
let quotient = unsafeBitCast(quotient_, to: ${Self}.self)
3569-
let remainder = unsafeBitCast(remainder_, to: ${Self}.self)
3570-
3571-
return (quotient: quotient, remainder: remainder)
3559+
fatalError("Operation is not supported")
35723560
% else:
35733561
// FIXME(integers): handle division by zero and overflows
35743562
_precondition(self != 0, "Division by zero")

test/Constraints/diagnostics_swift4.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,5 @@ class R<K: Hashable, V> {
5454
infix operator +=+ : AdditionPrecedence
5555
func +=+(_ lhs: Int, _ rhs: Int) -> Bool { return lhs == rhs }
5656
func +=+<T: BinaryInteger>(_ lhs: T, _ rhs: Int) -> Bool { return lhs == rhs }
57-
let _ = DoubleWidth<Int>(Int.min) - 1 +=+ Int.min // Ok
57+
// FIXME: DoubleWidth is no longer part of the standard library
58+
// let _ = DoubleWidth<Int>(Int.min) - 1 +=+ Int.min // Ok

0 commit comments

Comments
 (0)