Skip to content
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
1 change: 0 additions & 1 deletion stdlib/public/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ set(SWIFTLIB_ESSENTIAL
CTypes.swift
DebuggerSupport.swift
Dictionary.swift
DoubleWidth.swift.gyb
DropWhile.swift
Dump.swift
EmptyCollection.swift
Expand Down
1 change: 0 additions & 1 deletion stdlib/public/core/GroupInfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@
"BuiltinMath.swift",
{
"Integers": [
"DoubleWidth.swift",
"Integers.swift",
"IntegerParsing.swift"],
"Floating": [
Expand Down
16 changes: 2 additions & 14 deletions stdlib/public/core/Integers.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -3552,23 +3552,11 @@ ${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 word_bits == 32 and bits == 64:
% # FIXME(integers): uncomment the above after using the right conditional
% # compilation block to exclude 64-bit Windows, which does not support
% # 128-bit operations
% if bits == 64:
% HalfWidth = 'Int32' if signed else 'UInt32'
let lhsHigh =
unsafeBitCast(dividend.high, to: DoubleWidth<${HalfWidth}>.self)
let lhsLow = unsafeBitCast(dividend.low, to: DoubleWidth<UInt32>.self)
let rhs_ = unsafeBitCast(self, to: DoubleWidth<${HalfWidth}>.self)

let (quotient_, remainder_) = rhs_.dividingFullWidth((lhsHigh, lhsLow))

let quotient = unsafeBitCast(quotient_, to: ${Self}.self)
let remainder = unsafeBitCast(remainder_, to: ${Self}.self)

return (quotient: quotient, remainder: remainder)
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: DoubleWidth is no longer part of the standard library
// let _ = DoubleWidth<Int>(Int.min) - 1 +=+ Int.min // Ok
Loading