Skip to content

Commit 1b78a1f

Browse files
committed
[stdlib] change String’s SIMD bits to load using loadUnaligned
1 parent 8bb22f8 commit 1b78a1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/core/StringUTF16View.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,11 +597,11 @@ extension String.UTF16View {
597597

598598
while readPtr + MemoryLayout<U>.stride < endPtr {
599599
//Find the number of continuations (0b10xxxxxx)
600-
let sValue = Builtin.loadRaw(readPtr._rawValue) as S
600+
let sValue = readPtr.loadUnaligned(as: S.self)
601601
let continuations = S.zero.replacing(with: S.one, where: sValue .< -65 + 1)
602602

603603
//Find the number of 4 byte code points (0b11110xxx)
604-
let uValue = Builtin.loadRaw(readPtr._rawValue) as U
604+
let uValue = readPtr.loadUnaligned(as: U.self)
605605
let fourBytes = S.zero.replacing(
606606
with: S.one,
607607
where: unsafeBitCast(

0 commit comments

Comments
 (0)