Skip to content

Commit 77bd39a

Browse files
committed
crc32 Aarch64 add crc feature to crc32_aarch64 from clang
Closes #8916.
1 parent 6ab897c commit 77bd39a

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

ext/standard/crc32.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ static inline int has_crc32_insn() {
6464
# endif
6565
}
6666

67-
# if defined(__GNUC__) && !defined(__clang__)
68-
# pragma GCC push_options
69-
# pragma GCC target ("+nothing+crc")
67+
# if defined(__GNUC__)
68+
# if!defined(__clang__)
69+
# pragma GCC push_options
70+
# pragma GCC target ("+nothing+crc")
71+
# else
72+
# pragma clang attribute push(__attribute__((target("+nothing+crc"))), apply_to=function)
73+
# endif
7074
# endif
7175
static uint32_t crc32_aarch64(uint32_t crc, const char *p, size_t nr) {
7276
while (nr >= sizeof(uint64_t)) {
@@ -89,8 +93,12 @@ static uint32_t crc32_aarch64(uint32_t crc, const char *p, size_t nr) {
8993
}
9094
return crc;
9195
}
92-
# if defined(__GNUC__) && !defined(__clang__)
93-
# pragma GCC pop_options
96+
# if defined(__GNUC__)
97+
# if !defined(__clang__)
98+
# pragma GCC pop_options
99+
# else
100+
# pragma clang attribute pop
101+
# endif
94102
# endif
95103
#endif
96104

0 commit comments

Comments
 (0)