summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorEtienne Guesnet <etienne.guesnet.external@atos.net>2021-02-26 16:22:24 +0100
committerDaniel Black <daniel@mariadb.org>2021-03-18 14:40:54 +1100
commit60d1461a28cb49e8d4e9e7c57963c5d0391d484d (patch)
tree6522a9f649e11312c389efcbe77f8db510b692a0 /mysys
parent9c7bd4f283b5d866e08566a3ffb6954413b0513f (diff)
downloadmariadb-git-60d1461a28cb49e8d4e9e7c57963c5d0391d484d.tar.gz
CRC32 on AIX
Diffstat (limited to 'mysys')
-rw-r--r--mysys/CMakeLists.txt2
-rw-r--r--mysys/crc32/crc32c.cc11
2 files changed, 12 insertions, 1 deletions
diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt
index d73d1c68b52..c6d476c9fa4 100644
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -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")
diff --git a/mysys/crc32/crc32c.cc b/mysys/crc32/crc32c.cc
index f11a80fb5d8..8135c211d2e 100644
--- a/mysys/crc32/crc32c.cc
+++ b/mysys/crc32/crc32c.cc
@@ -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() {