Skip to content

[stdlib] Temporarily exclude DoubleWidth from the standard library #13182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion stdlib/public/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ set(SWIFTLIB_ESSENTIAL
CString.swift
CTypes.swift
DebuggerSupport.swift
DoubleWidth.swift.gyb
# FIXME(double-width): <rdar://problem/32726173>
#DoubleWidth.swift.gyb
DropWhile.swift.gyb
Dump.swift
EmptyCollection.swift
Expand Down
13 changes: 7 additions & 6 deletions stdlib/public/core/Integers.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -3378,14 +3378,15 @@ ${assignmentOperatorComment(x.operator, True)}
) -> (quotient: ${Self}, remainder: ${Self}) {
// FIXME(integers): tests
% # 128 bit types are not provided by the 32-bit LLVM
% #if word_bits == 32 and bits == 64:
% if bits == 64:
let lhs = DoubleWidth<${Self}>(dividend)
let rhs = DoubleWidth<${Self}>(self)
% if word_bits == 32 and bits == 64:
% #if bits == 64: #FIXME(double-width): uncomment when DoubleWidth is back
// let lhs = DoubleWidth<${Self}>(dividend)
// let rhs = DoubleWidth<${Self}>(self)

let (quotient, remainder) = lhs.quotientAndRemainder(dividingBy: rhs)
// let (quotient, remainder) = lhs.quotientAndRemainder(dividingBy: rhs)
// FIXME(integers): check for high words in quotient and remainder
return (${Self}(quotient.low), ${Self}(remainder.low))
// return (${Self}(quotient.low), ${Self}(remainder.low))
fatalError("Operation is not supported")
% else:
// FIXME(integers): handle division by zero and overflows
_precondition(self != 0, "Division by zero")
Expand Down
3 changes: 2 additions & 1 deletion test/Constraints/diagnostics_swift4.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ class R<K: Hashable, V> {
infix operator +=+ : AdditionPrecedence
func +=+(_ lhs: Int, _ rhs: Int) -> Bool { return lhs == rhs }
func +=+<T: BinaryInteger>(_ lhs: T, _ rhs: Int) -> Bool { return lhs == rhs }
let _ = DoubleWidth<Int>(Int.min) - 1 +=+ Int.min // Ok
// FIXME: uncomment when <rdar://problem/32726173> is resolved and DoubleWidth is back
// let _ = DoubleWidth<Int>(Int.min) - 1 +=+ Int.min // Ok
2 changes: 2 additions & 0 deletions test/stdlib/DoubleWidth.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// RUN: %target-run-simple-swift
// REQUIRES: executable_test
// FIXME(double-width): <rdar://problem/32726173>
// REQUIRES: rdar32726173

import StdlibUnittest

Expand Down