@@ -3,15 +3,122 @@ import Foundation
33public extension DeviceModel . Processor {
44 var architecture : String {
55 switch self {
6- default :
7- return " arm64 " // Not really, check: https://apple.fandom.com/wiki/List_of_Apple_processors
6+ // Early 32-bit ARMv7 processors
7+ case . APL0278, . APL0298, . APL2298,
8+ . appleA4, . appleA5, . appleA5X:
9+ return " armv7 "
10+
11+ // Custom 32-bit ARMv7s architecture by Apple
12+ case . appleA6, . appleA6X:
13+ return " armv7s "
14+
15+ // First generation of 64-bit ARMv8-A processors
16+ case . appleA7, . appleA8, . appleA8X, . appleA9, . appleA9X,
17+ . appleA10Fusion, . appleA10XFusion, . appleA11Bionic:
18+ return " arm64 "
19+
20+ // Processors with ARMv8.3-A (Pointer Authentication - arm64e) and newer
21+ case . appleA12Bionic, . appleA12XBionic, . appleA12ZBionic,
22+ . appleA13Bionic, . appleA14Bionic, . appleA15Bionic,
23+ . appleA16Bionic, . appleA17Pro:
24+ return " arm64e "
25+
26+ // Future processors (estimated to be arm64e or a successor)
27+ case . appleA18, . appleA18Pro, . appleA19, . appleA19Pro:
28+ return " arm64e " // Estimation
29+
30+ // Apple Silicon for Mac/iPad
31+ case . appleM1, . appleM1Pro, . appleM1Max, . appleM1Ultra,
32+ . appleM2, . appleM2Pro, . appleM2Max, . appleM2Ultra,
33+ . appleM3, . appleM3Pro, . appleM3Max,
34+ . appleM4, . appleM4Pro, . appleM4Max:
35+ return " arm64e "
36+
37+ // Vision Pro Co-processor
38+ case . appleR1:
39+ return " arm64 " // Specific architecture not public, but it's an ARM-based co-processor.
40+
41+ // Apple Watch processors
42+ case . appleS1, . appleS1P, . appleS2:
43+ return " armv7k " // 32-bit architecture for WatchOS
44+ case . appleS3:
45+ return " armv8-a " // 64-bit (32-bit compatibility mode)
46+ case . appleS4, . appleS5,
47+ . appleS6, . appleS7, . appleS8,
48+ . appleS9, . appleS10:
49+ return " arm64e " // 64-bit with Pointer Authentication
50+
51+ // Very early 32-bit ARMv6 processor
52+ case . APL0098:
53+ return " armv6 "
854 }
955 }
10-
56+
57+ /// The year the processor was introduced.
1158 var introducedYear : Int ? {
1259 switch self {
13- default :
14- return nil //Check the same list
60+ // Initial Samsung processors
61+ case . APL0098: return 2007
62+ case . APL0278: return 2008
63+ case . APL0298: return 2009
64+ case . APL2298: return 2010
65+
66+ // A-series
67+ case . appleA4: return 2010
68+ case . appleA5: return 2011
69+ case . appleA5X: return 2012
70+ case . appleA6: return 2012
71+ case . appleA6X: return 2012
72+ case . appleA7: return 2013
73+ case . appleA8: return 2014
74+ case . appleA8X: return 2014
75+ case . appleA9: return 2015
76+ case . appleA9X: return 2015
77+ case . appleA10Fusion: return 2016
78+ case . appleA10XFusion: return 2017
79+ case . appleA11Bionic: return 2017
80+ case . appleA12Bionic: return 2018
81+ case . appleA12XBionic: return 2018
82+ case . appleA12ZBionic: return 2020
83+ case . appleA13Bionic: return 2019
84+ case . appleA14Bionic: return 2020
85+ case . appleA15Bionic: return 2021
86+ case . appleA16Bionic: return 2022
87+ case . appleA17Pro: return 2023
88+ case . appleA18, . appleA18Pro: return 2024 // Estimated
89+ case . appleA19, . appleA19Pro: return 2025 // Estimated
90+
91+ // M-series
92+ case . appleM1: return 2020
93+ case . appleM1Pro: return 2021
94+ case . appleM1Max: return 2021
95+ case . appleM1Ultra: return 2022
96+ case . appleM2: return 2022
97+ case . appleM2Pro: return 2023
98+ case . appleM2Max: return 2023
99+ case . appleM2Ultra: return 2023
100+ case . appleM3: return 2023
101+ case . appleM3Pro: return 2023
102+ case . appleM3Max: return 2023
103+ case . appleM4: return 2024
104+ case . appleM4Pro: return 2024 // Estimated
105+ case . appleM4Max: return 2024 // Estimated
106+
107+ // R-series
108+ case . appleR1: return 2024
109+
110+ // S-series
111+ case . appleS1: return 2015
112+ case . appleS1P: return 2016
113+ case . appleS2: return 2016
114+ case . appleS3: return 2017
115+ case . appleS4: return 2018
116+ case . appleS5: return 2019
117+ case . appleS6: return 2020
118+ case . appleS7: return 2021
119+ case . appleS8: return 2022
120+ case . appleS9: return 2023
121+ case . appleS10: return 2024 // Estimated
15122 }
16123 }
17124}
0 commit comments