Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
simde
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
simde
Commits
d1afb3db
Commit
d1afb3db
authored
Sep 13, 2024
by
Michael R. Crusoe
Committed by
Michael R. Crusoe
Sep 13, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arm crc32: define SIMDE_ARCH_ARM_CRC32 and consistently use it
parent
592f8f0c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
13 deletions
+22
-13
arm/neon/crc32.h
arm/neon/crc32.h
+13
-8
simde-arch.h
simde-arch.h
+3
-0
x86/sse4.2.h
x86/sse4.2.h
+6
-5
No files found.
arm/neon/crc32.h
View file @
d1afb3db
...
...
@@ -29,6 +29,11 @@
#include "types.h"
#if defined(__ARM_ACLE) || (defined(__GNUC__) && defined(SIMDE_ARCH_ARM_CRC32))
#include <arm_acle.h>
#endif
// ^^ Due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70974
HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
SIMDE_BEGIN_DECLS_
...
...
@@ -55,7 +60,7 @@ uint32_t simde_crc32_eor_mask(uint32_t a, uint32_t b, uint32_t mask) {
SIMDE_FUNCTION_ATTRIBUTES
uint32_t
simde___crc32b
(
uint32_t
a
,
uint8_t
b
)
{
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(
__ARM_ACLE
)
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(
SIMDE_ARCH_ARM_CRC32
)
return
__crc32b
(
a
,
b
);
#else
uint32_t
r_acc
=
HEDLEY_STATIC_CAST
(
uint32_t
,
simde_crc32_reverseBits
(
a
,
32
));
...
...
@@ -81,7 +86,7 @@ simde___crc32b(uint32_t a, uint8_t b) {
SIMDE_FUNCTION_ATTRIBUTES
uint32_t
simde___crc32h
(
uint32_t
a
,
uint16_t
b
)
{
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(
__ARM_ACLE
)
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(
SIMDE_ARCH_ARM_CRC32
)
return
__crc32h
(
a
,
b
);
#else
uint32_t
r_acc
=
HEDLEY_STATIC_CAST
(
uint32_t
,
simde_crc32_reverseBits
(
a
,
32
));
...
...
@@ -107,7 +112,7 @@ simde___crc32h(uint32_t a, uint16_t b) {
SIMDE_FUNCTION_ATTRIBUTES
uint32_t
simde___crc32w
(
uint32_t
a
,
uint32_t
b
)
{
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(
__ARM_ACLE
)
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(
SIMDE_ARCH_ARM_CRC32
)
return
__crc32w
(
a
,
b
);
#else
uint32_t
r_acc
=
HEDLEY_STATIC_CAST
(
uint32_t
,
simde_crc32_reverseBits
(
a
,
32
));
...
...
@@ -132,7 +137,7 @@ simde___crc32w(uint32_t a, uint32_t b) {
SIMDE_FUNCTION_ATTRIBUTES
uint32_t
simde___crc32d
(
uint32_t
a
,
uint64_t
b
)
{
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(
__ARM_ACLE
)
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(
SIMDE_ARCH_ARM_CRC32
)
return
__crc32d
(
a
,
b
);
#else
uint32_t
r_acc
=
HEDLEY_STATIC_CAST
(
uint32_t
,
simde_crc32_reverseBits
(
a
,
32
));
...
...
@@ -167,7 +172,7 @@ simde___crc32d(uint32_t a, uint64_t b) {
SIMDE_FUNCTION_ATTRIBUTES
uint32_t
simde___crc32cb
(
uint32_t
a
,
uint8_t
b
)
{
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(
__ARM_ACLE
)
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(
SIMDE_ARCH_ARM_CRC32
)
return
__crc32cb
(
a
,
b
);
#else
uint32_t
r_acc
=
HEDLEY_STATIC_CAST
(
uint32_t
,
simde_crc32_reverseBits
(
a
,
32
));
...
...
@@ -193,7 +198,7 @@ simde___crc32cb(uint32_t a, uint8_t b) {
SIMDE_FUNCTION_ATTRIBUTES
uint32_t
simde___crc32ch
(
uint32_t
a
,
uint16_t
b
)
{
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(
__ARM_ACLE
)
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(
SIMDE_ARCH_ARM_CRC32
)
return
__crc32ch
(
a
,
b
);
#else
uint32_t
r_acc
=
HEDLEY_STATIC_CAST
(
uint32_t
,
simde_crc32_reverseBits
(
a
,
32
));
...
...
@@ -219,7 +224,7 @@ simde___crc32ch(uint32_t a, uint16_t b) {
SIMDE_FUNCTION_ATTRIBUTES
uint32_t
simde___crc32cw
(
uint32_t
a
,
uint32_t
b
)
{
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(
__ARM_ACLE
)
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(
SIMDE_ARCH_ARM_CRC32
)
return
__crc32cw
(
a
,
b
);
#else
uint32_t
r_acc
=
HEDLEY_STATIC_CAST
(
uint32_t
,
simde_crc32_reverseBits
(
a
,
32
));
...
...
@@ -244,7 +249,7 @@ simde___crc32cw(uint32_t a, uint32_t b) {
SIMDE_FUNCTION_ATTRIBUTES
uint32_t
simde___crc32cd
(
uint32_t
a
,
uint64_t
b
)
{
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(
__ARM_ACLE
)
#if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && defined(
SIMDE_ARCH_ARM_CRC32
)
return
__crc32cd
(
a
,
b
);
#else
uint32_t
r_acc
=
HEDLEY_STATIC_CAST
(
uint32_t
,
simde_crc32_reverseBits
(
a
,
32
));
...
...
simde-arch.h
View file @
d1afb3db
...
...
@@ -130,6 +130,9 @@
#if defined(__ARM_FEATURE_CRYPTO) && __ARM_FEATURE_CRYPTO
# define SIMDE_ARCH_ARM_CRYPTO
#endif
#if defined(__ARM_FEATURE_CRC32) && __ARM_FEATURE_CRC32
# define SIMDE_ARCH_ARM_CRC32
#endif
#if defined(__ARM_FEATURE_DOTPROD) && __ARM_FEATURE_DOTPROD
# define SIMDE_ARCH_ARM_DOTPROD
#endif
...
...
x86/sse4.2.h
View file @
d1afb3db
...
...
@@ -30,9 +30,10 @@
#include "sse4.1.h"
#if defined(__ARM_ACLE) || (defined(__GNUC__) && defined(
__ARM_FEATURE
_CRC32))
#if defined(__ARM_ACLE) || (defined(__GNUC__) && defined(
SIMDE_ARCH_ARM
_CRC32))
#include <arm_acle.h>
#endif
// ^^ Due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70974
HEDLEY_DIAGNOSTIC_PUSH
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
...
...
@@ -295,7 +296,7 @@ simde_mm_crc32_u8(uint32_t prevcrc, uint8_t v) {
#if defined(SIMDE_X86_SSE4_2_NATIVE)
return
_mm_crc32_u8
(
prevcrc
,
v
);
#else
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(
__ARM_FEATURE
_CRC32)
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(
SIMDE_ARCH_ARM
_CRC32)
return
__crc32cb
(
prevcrc
,
v
);
#else
uint32_t
crc
=
prevcrc
;
...
...
@@ -328,7 +329,7 @@ simde_mm_crc32_u16(uint32_t prevcrc, uint16_t v) {
#if defined(SIMDE_X86_SSE4_2_NATIVE)
return
_mm_crc32_u16
(
prevcrc
,
v
);
#else
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(
__ARM_FEATURE
_CRC32)
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(
SIMDE_ARCH_ARM
_CRC32)
return
__crc32ch
(
prevcrc
,
v
);
#else
uint32_t
crc
=
prevcrc
;
...
...
@@ -348,7 +349,7 @@ simde_mm_crc32_u32(uint32_t prevcrc, uint32_t v) {
#if defined(SIMDE_X86_SSE4_2_NATIVE)
return
_mm_crc32_u32
(
prevcrc
,
v
);
#else
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(
__ARM_FEATURE
_CRC32)
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(
SIMDE_ARCH_ARM
_CRC32)
return
__crc32cw
(
prevcrc
,
v
);
#else
uint32_t
crc
=
prevcrc
;
...
...
@@ -368,7 +369,7 @@ simde_mm_crc32_u64(uint64_t prevcrc, uint64_t v) {
#if defined(SIMDE_X86_SSE4_2_NATIVE) && defined(SIMDE_ARCH_AMD64)
return
_mm_crc32_u64
(
prevcrc
,
v
);
#else
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(
__ARM_FEATURE
_CRC32)
#if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && defined(
SIMDE_ARCH_ARM
_CRC32)
return
__crc32cd
(
HEDLEY_STATIC_CAST
(
uint32_t
,
prevcrc
),
v
);
#else
uint64_t
crc
=
prevcrc
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment