Skip to content

Commit

Permalink
CRC32 on AIX
Browse files Browse the repository at this point in the history
  • Loading branch information
Etienne Guesnet authored and grooverdan committed Mar 18, 2021
1 parent 9c7bd4f commit 60d1461
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mysys/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64")
COMPILE_FLAGS "-march=armv8-a+crc+crypto")
ENDIF()
ENDIF()
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64|powerpc64")
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64|powerpc64" OR CMAKE_SYSTEM_NAME MATCHES AIX)
SET(MYSYS_SOURCES ${MYSYS_SOURCES} crc32/crc32_ppc64.c crc32/crc32c_ppc.c)
SET_SOURCE_FILES_PROPERTIES(crc32/crc32_ppc64.c crc32/crc32c_ppc.c PROPERTIES
COMPILE_FLAGS "${COMPILE_FLAGS} -maltivec -mvsx -mpower8-vector -mcrypto -mpower8-vector")
Expand Down
11 changes: 11 additions & 0 deletions mysys/crc32/crc32c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,17 @@ static int arch_ppc_probe(void) {

return arch_ppc_crc32;
}
#elif _AIX
static int arch_ppc_probe(void) {
arch_ppc_crc32 = 0;

#if defined(__powerpc64__)
// AIX 7.1+ has vector crypto features on all POWER 8+
arch_ppc_crc32 = 1;
#endif /* __powerpc64__ */

return arch_ppc_crc32;
}
#endif // __linux__

static bool isAltiVec() {
Expand Down

0 comments on commit 60d1461

Please sign in to comment.