File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,14 @@ public struct Int128: Sendable {
3131 @available ( SwiftStdlib 6 . 0 , * )
3232 @_transparent
3333 public var _low : UInt64 {
34- UInt64 ( truncatingIfNeeded : self )
34+ UInt64 ( Builtin . trunc_Int128_Int64 ( _value ) )
3535 }
3636
3737 @available ( SwiftStdlib 6 . 0 , * )
3838 @_transparent
3939 public var _high : Int64 {
40- Int64 ( truncatingIfNeeded: self &>> 64 )
40+ let shifted : Int128 = self &>> 64
41+ return Int64 ( Builtin . trunc_Int128_Int64 ( shifted. _value) )
4142 }
4243
4344 @available ( SwiftStdlib 6 . 0 , * )
@@ -450,7 +451,7 @@ extension Int128: BinaryInteger {
450451#elseif _pointerBitWidth(_32)
451452 UInt ( Builtin . trunc_Int128_Int32 ( _value) )
452453#else
453- UInt ( truncatingIfNeeded : self )
454+ #error("Unsupported platform" )
454455#endif
455456 }
456457}
Original file line number Diff line number Diff line change @@ -31,13 +31,14 @@ public struct UInt128: Sendable {
3131 @available ( SwiftStdlib 6 . 0 , * )
3232 @_transparent
3333 public var _low : UInt64 {
34- UInt64 ( truncatingIfNeeded : self )
34+ UInt64 ( Builtin . trunc_Int128_Int64 ( _value ) )
3535 }
3636
3737 @available ( SwiftStdlib 6 . 0 , * )
38- @_transparent @ usableFromInline
38+ @_transparent
3939 public var _high : UInt64 {
40- UInt64 ( truncatingIfNeeded: self &>> 64 )
40+ let shifted : UInt128 = self &>> 64
41+ return UInt64 ( Builtin . trunc_Int128_Int64 ( shifted. _value) )
4142 }
4243
4344 @available ( SwiftStdlib 6 . 0 , * )
@@ -385,7 +386,7 @@ extension UInt128: BinaryInteger {
385386
386387 @available ( SwiftStdlib 6 . 0 , * )
387388 @_transparent
388- init ( _value: UInt128 ) {
389+ public init ( _value: UInt128 ) {
389390 self . _value = _value
390391 }
391392 }
@@ -442,7 +443,7 @@ extension UInt128: BinaryInteger {
442443#elseif _pointerBitWidth(_32)
443444 UInt ( Builtin . trunc_Int128_Int32 ( _value) )
444445#else
445- UInt ( truncatingIfNeeded : self )
446+ #error("Unsupported platform" )
446447#endif
447448 }
448449}
You can’t perform that action at this time.
0 commit comments