Skip to content

Commit

Permalink
swift: don't try to use ARM intrinsics on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jtbandes committed Aug 18, 2023
1 parent 424fe6d commit fa8a8fe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions swift/crc/CRC32.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import struct Foundation.Data

#if arch(arm) || arch(arm64)
// iOS seems to lack CRC intrinsics

Check failure on line 3 in swift/crc/CRC32.swift

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (intrinsics)
// See also: https://stackoverflow.com/questions/45625725/does-clang-lack-crc32-for-armv8-aarch64
#if (arch(arm) || arch(arm64)) && !os(iOS)
import _Builtin_intrinsics.arm.acle // cspell:disable-line
#endif

Expand Down Expand Up @@ -34,7 +36,7 @@ public struct CRC32 {

@inlinable
public mutating func update(_ data: UnsafeRawBufferPointer) {
#if arch(arm) || arch(arm64)
#if (arch(arm) || arch(arm64)) && !os(iOS)
self.updateARM(data)
#else
self.update16Byte(data)
Expand Down Expand Up @@ -93,7 +95,7 @@ public struct CRC32 {
}
}

#if arch(arm) || arch(arm64)
#if (arch(arm) || arch(arm64)) && !os(iOS)
@inlinable
internal mutating func updateARM(_ data: UnsafeRawBufferPointer) {
var offset = 0
Expand Down

0 comments on commit fa8a8fe

Please sign in to comment.