Skip to content

Commit 839c49b

Browse files
committed
Microoptimize _lowWord and fix else branch
1 parent 68952e8 commit 839c49b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

stdlib/public/core/Int128.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,11 +450,11 @@ extension Int128: BinaryInteger {
450450
@_transparent
451451
public var _lowWord: UInt {
452452
#if _pointerBitWidth(_64)
453-
UInt(_low._value)
453+
UInt(Builtin.trunc_Int128_Int64(_value))
454454
#elseif _pointerBitWidth(_32)
455-
UInt(Builtin.trunc_Int64_Int32(_low._value))
455+
UInt(Builtin.trunc_Int128_Int32(_value))
456456
#else
457-
UInt(truncatingIfNeeded: _low)
457+
UInt(truncatingIfNeeded: self)
458458
#endif
459459
}
460460
}

stdlib/public/core/UInt128.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,11 +442,11 @@ extension UInt128: BinaryInteger {
442442
@_transparent
443443
public var _lowWord: UInt {
444444
#if _pointerBitWidth(_64)
445-
UInt(_low._value)
445+
UInt(Builtin.trunc_Int128_Int64(_value))
446446
#elseif _pointerBitWidth(_32)
447-
UInt(Builtin.trunc_Int64_Int32(_low._value))
447+
UInt(Builtin.trunc_Int128_Int32(_value))
448448
#else
449-
UInt(truncatingIfNeeded: _low)
449+
UInt(truncatingIfNeeded: self)
450450
#endif
451451
}
452452
}

0 commit comments

Comments
 (0)