Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add apple A17 and M3 family macro #5405

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 41 additions & 13 deletions src/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,25 +93,33 @@
#ifndef CPUFAMILY_ARM_LIGHTNING_THUNDER
#define CPUFAMILY_ARM_LIGHTNING_THUNDER 0x462504d2
#endif
// A14
// A14 / M1
#ifndef CPUFAMILY_ARM_FIRESTORM_ICESTORM
#define CPUFAMILY_ARM_FIRESTORM_ICESTORM 0x1b588bb3
#endif
// A15
// A15 / M2
#ifndef CPUFAMILY_ARM_AVALANCHE_BLIZZARD
#define CPUFAMILY_ARM_AVALANCHE_BLIZZARD 0xda33d83d
#endif
// A16
#ifndef CPUFAMILY_ARM_EVEREST_SAWTOOTH
#define CPUFAMILY_ARM_EVEREST_SAWTOOTH 0x8765edea
#endif
// M1
#ifndef CPUFAMILY_AARCH64_FIRESTORM_ICESTORM
#define CPUFAMILY_AARCH64_FIRESTORM_ICESTORM 0x1b588bb3
// A17
#ifndef CPUFAMILY_ARM_COLL
#define CPUFAMILY_ARM_COLL 0x2876f5b5
#endif
// M2
#ifndef CPUFAMILY_AARCH64_AVALANCHE_BLIZZARD
#define CPUFAMILY_AARCH64_AVALANCHE_BLIZZARD 0xda33d83d
// M3
#ifndef CPUFAMILY_ARM_IBIZA
#define CPUFAMILY_ARM_IBIZA 0xfa33415e
#endif
// M3 Pro
#ifndef CPUFAMILY_ARM_LOBOS
#define CPUFAMILY_ARM_LOBOS 0x5f4dea93
#endif
// M3 Max
#ifndef CPUFAMILY_ARM_PALMA
#define CPUFAMILY_ARM_PALMA 0x72015832
#endif
#endif // __APPLE__

Expand Down Expand Up @@ -2146,7 +2154,11 @@ int cpu_support_arm_asimdhp()
|| g_hw_cpufamily == CPUFAMILY_ARM_LIGHTNING_THUNDER
|| g_hw_cpufamily == CPUFAMILY_ARM_FIRESTORM_ICESTORM
|| g_hw_cpufamily == CPUFAMILY_ARM_AVALANCHE_BLIZZARD
|| g_hw_cpufamily == CPUFAMILY_ARM_EVEREST_SAWTOOTH;
|| g_hw_cpufamily == CPUFAMILY_ARM_EVEREST_SAWTOOTH
|| g_hw_cpufamily == CPUFAMILY_ARM_COLL
|| g_hw_cpufamily == CPUFAMILY_ARM_IBIZA
|| g_hw_cpufamily == CPUFAMILY_ARM_LOBOS
|| g_hw_cpufamily == CPUFAMILY_ARM_PALMA;
#else
return 0;
#endif
Expand Down Expand Up @@ -2186,7 +2198,11 @@ int cpu_support_arm_asimddp()
|| g_hw_cpufamily == CPUFAMILY_ARM_LIGHTNING_THUNDER
|| g_hw_cpufamily == CPUFAMILY_ARM_FIRESTORM_ICESTORM
|| g_hw_cpufamily == CPUFAMILY_ARM_AVALANCHE_BLIZZARD
|| g_hw_cpufamily == CPUFAMILY_ARM_EVEREST_SAWTOOTH;
|| g_hw_cpufamily == CPUFAMILY_ARM_EVEREST_SAWTOOTH
|| g_hw_cpufamily == CPUFAMILY_ARM_COLL
|| g_hw_cpufamily == CPUFAMILY_ARM_IBIZA
|| g_hw_cpufamily == CPUFAMILY_ARM_LOBOS
|| g_hw_cpufamily == CPUFAMILY_ARM_PALMA;
#else
return 0;
#endif
Expand All @@ -2208,7 +2224,11 @@ int cpu_support_arm_asimdfhm()
|| g_hw_cpufamily == CPUFAMILY_ARM_LIGHTNING_THUNDER
|| g_hw_cpufamily == CPUFAMILY_ARM_FIRESTORM_ICESTORM
|| g_hw_cpufamily == CPUFAMILY_ARM_AVALANCHE_BLIZZARD
|| g_hw_cpufamily == CPUFAMILY_ARM_EVEREST_SAWTOOTH;
|| g_hw_cpufamily == CPUFAMILY_ARM_EVEREST_SAWTOOTH
|| g_hw_cpufamily == CPUFAMILY_ARM_COLL
|| g_hw_cpufamily == CPUFAMILY_ARM_IBIZA
|| g_hw_cpufamily == CPUFAMILY_ARM_LOBOS
|| g_hw_cpufamily == CPUFAMILY_ARM_PALMA;
#else
return 0;
#endif
Expand All @@ -2228,7 +2248,11 @@ int cpu_support_arm_bf16()
#elif __APPLE__
return g_hw_optional_arm_FEAT_BF16
|| g_hw_cpufamily == CPUFAMILY_ARM_AVALANCHE_BLIZZARD
|| g_hw_cpufamily == CPUFAMILY_ARM_EVEREST_SAWTOOTH;
|| g_hw_cpufamily == CPUFAMILY_ARM_EVEREST_SAWTOOTH
|| g_hw_cpufamily == CPUFAMILY_ARM_COLL
|| g_hw_cpufamily == CPUFAMILY_ARM_IBIZA
|| g_hw_cpufamily == CPUFAMILY_ARM_LOBOS
|| g_hw_cpufamily == CPUFAMILY_ARM_PALMA;
#else
return 0;
#endif
Expand All @@ -2248,7 +2272,11 @@ int cpu_support_arm_i8mm()
#elif __APPLE__
return g_hw_optional_arm_FEAT_I8MM
|| g_hw_cpufamily == CPUFAMILY_ARM_AVALANCHE_BLIZZARD
|| g_hw_cpufamily == CPUFAMILY_ARM_EVEREST_SAWTOOTH;
|| g_hw_cpufamily == CPUFAMILY_ARM_EVEREST_SAWTOOTH
|| g_hw_cpufamily == CPUFAMILY_ARM_COLL
|| g_hw_cpufamily == CPUFAMILY_ARM_IBIZA
|| g_hw_cpufamily == CPUFAMILY_ARM_LOBOS
|| g_hw_cpufamily == CPUFAMILY_ARM_PALMA;
#else
return 0;
#endif
Expand Down
Loading