-
Notifications
You must be signed in to change notification settings - Fork 300
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
Added Apple Silicon Mac support #164
Changes from 1 commit
c7328c8
d6ec9e6
e904c34
afa64d0
6b59dac
75115c8
d68f604
ecf1e81
84d2132
30b9639
df8eb0a
22211f8
5eab6c1
599615e
cd25b1f
2d7dd04
6875af9
e31c00f
3646af7
5bce07f
b878e6d
acd48c0
855112d
225b6bd
de6af92
825d080
33a7a42
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,8 @@ DEFINE_INTERFACE_DISPATCHER(crc16_t10dif) | |
unsigned long auxval = getauxval(AT_HWCAP); | ||
if (auxval & HWCAP_PMULL) | ||
return PROVIDER_INFO(crc16_t10dif_pmull); | ||
#elif defined(__aarch64__) | ||
return PROVIDER_INFO(crc16_t10dif_pmull); | ||
#endif | ||
return PROVIDER_BASIC(crc16_t10dif); | ||
|
||
|
@@ -45,6 +47,8 @@ DEFINE_INTERFACE_DISPATCHER(crc16_t10dif_copy) | |
unsigned long auxval = getauxval(AT_HWCAP); | ||
if (auxval & HWCAP_PMULL) | ||
return PROVIDER_INFO(crc16_t10dif_copy_pmull); | ||
#elif defined(__aarch64__) | ||
return PROVIDER_INFO(crc16_t10dif_copy_pmull); | ||
#endif | ||
return PROVIDER_BASIC(crc16_t10dif_copy); | ||
|
||
|
@@ -57,6 +61,8 @@ DEFINE_INTERFACE_DISPATCHER(crc32_ieee) | |
if (auxval & HWCAP_PMULL) { | ||
return PROVIDER_INFO(crc32_ieee_norm_pmull); | ||
} | ||
#elif defined(__aarch64__) | ||
return PROVIDER_INFO(crc32_ieee_norm_pmull); | ||
#endif | ||
return PROVIDER_BASIC(crc32_ieee); | ||
|
||
|
@@ -81,6 +87,8 @@ DEFINE_INTERFACE_DISPATCHER(crc32_iscsi) | |
if (auxval & HWCAP_PMULL) { | ||
return PROVIDER_INFO(crc32_iscsi_refl_pmull); | ||
} | ||
#elif defined(__aarch64__) | ||
return PROVIDER_INFO(crc32_iscsi_refl_pmull); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this function might not be best choice . As I know, crc32_iscsi_crc_ext or crc32_iscsi_3crc_fold should be better choice. You can test the real performance and pick up the best one There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, I'm sorry. Although I have asked an acquaintance of mine to test the same binary on ARM mac (it worked, so "it does support ARM mac"), my primary machine is Intel mac and my test environment is iPad (well, jailbroken and sshd enabled). Also, at least crc32 instruction caused SIGILL on my iPad (from libslz). The worse thing, as far as I know, there are no There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems undocumented Now my concern is https://developer.apple.com/documentation/xcode/writing_arm64_code_for_apple_platforms There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
And it looks Could you review |
||
#endif | ||
return PROVIDER_BASIC(crc32_iscsi); | ||
|
||
|
@@ -105,6 +113,8 @@ DEFINE_INTERFACE_DISPATCHER(crc32_gzip_refl) | |
|
||
if (auxval & HWCAP_PMULL) | ||
return PROVIDER_INFO(crc32_gzip_refl_pmull); | ||
#elif defined(__aarch64__) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above comment. crc32_gzip_refl_crc_ext and crc32_gzip_refl_3crc_fold are better choice. |
||
return PROVIDER_INFO(crc32_gzip_refl_pmull); | ||
#endif | ||
return PROVIDER_BASIC(crc32_gzip_refl); | ||
|
||
|
@@ -117,6 +127,8 @@ DEFINE_INTERFACE_DISPATCHER(crc64_ecma_refl) | |
|
||
if (auxval & HWCAP_PMULL) | ||
return PROVIDER_INFO(crc64_ecma_refl_pmull); | ||
#elif defined(__aarch64__) | ||
cielavenir marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return PROVIDER_INFO(crc64_ecma_refl_pmull); | ||
#endif | ||
return PROVIDER_BASIC(crc64_ecma_refl); | ||
|
||
|
@@ -128,6 +140,8 @@ DEFINE_INTERFACE_DISPATCHER(crc64_ecma_norm) | |
unsigned long auxval = getauxval(AT_HWCAP); | ||
if (auxval & HWCAP_PMULL) | ||
return PROVIDER_INFO(crc64_ecma_norm_pmull); | ||
#elif defined(__aarch64__) | ||
return PROVIDER_INFO(crc64_ecma_norm_pmull); | ||
#endif | ||
return PROVIDER_BASIC(crc64_ecma_norm); | ||
|
||
|
@@ -139,6 +153,8 @@ DEFINE_INTERFACE_DISPATCHER(crc64_iso_refl) | |
unsigned long auxval = getauxval(AT_HWCAP); | ||
if (auxval & HWCAP_PMULL) | ||
return PROVIDER_INFO(crc64_iso_refl_pmull); | ||
#elif defined(__aarch64__) | ||
return PROVIDER_INFO(crc64_iso_refl_pmull); | ||
#endif | ||
return PROVIDER_BASIC(crc64_iso_refl); | ||
|
||
|
@@ -150,6 +166,8 @@ DEFINE_INTERFACE_DISPATCHER(crc64_iso_norm) | |
unsigned long auxval = getauxval(AT_HWCAP); | ||
if (auxval & HWCAP_PMULL) | ||
return PROVIDER_INFO(crc64_iso_norm_pmull); | ||
#elif defined(__aarch64__) | ||
return PROVIDER_INFO(crc64_iso_norm_pmull); | ||
#endif | ||
return PROVIDER_BASIC(crc64_iso_norm); | ||
|
||
|
@@ -161,6 +179,8 @@ DEFINE_INTERFACE_DISPATCHER(crc64_jones_refl) | |
unsigned long auxval = getauxval(AT_HWCAP); | ||
if (auxval & HWCAP_PMULL) | ||
return PROVIDER_INFO(crc64_jones_refl_pmull); | ||
#elif defined(__aarch64__) | ||
return PROVIDER_INFO(crc64_jones_refl_pmull); | ||
#endif | ||
return PROVIDER_BASIC(crc64_jones_refl); | ||
|
||
|
@@ -172,6 +192,8 @@ DEFINE_INTERFACE_DISPATCHER(crc64_jones_norm) | |
unsigned long auxval = getauxval(AT_HWCAP); | ||
if (auxval & HWCAP_PMULL) | ||
return PROVIDER_INFO(crc64_jones_norm_pmull); | ||
#elif defined(__aarch64__) | ||
return PROVIDER_INFO(crc64_jones_norm_pmull); | ||
#endif | ||
return PROVIDER_BASIC(crc64_jones_norm); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion is add it like
And another thing I must confirm with you . If the transparent layer can be remove , I think this file should not be compiled in Apple Silicon Mac.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might not be answering correct question, but removing
__MACH__
causesgetauxval undefined
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have rewritten dispatchers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in above condition, removing 12575f5 solves "aarch64_multibinary.h issue" in workaround way.