summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorMatheus Castanho <msc@linux.ibm.com>2020-05-25 18:10:29 -0300
committerHans Kristian Rosbach <hk-github@circlestorm.org>2020-06-08 14:47:17 +0200
commitb81f4ee96dcbdf1db34b00727b6f1829a2ba1edb (patch)
tree19f67906f91f84ff477da4d416500ad92deea238 /cmake
parent0ebe2fafdda0470d0a11aa0e5b84f8b6c500d584 (diff)
Preparation for POWER optimizations
Add the scaffolding for future optimizations for POWER processors. Now the build is capable of correctly detecting multiple processor sub-architectures (ppc, ppc64 and ppc64le) and also if features needed for the optimizations are available during build and runtime. With these changes, adding a new optimized function for POWER should be as simple as adding a new file under arch/power/, appending build instructions to the build files and editing functable.c accordingly. The UNALIGNED_OK flag is now also added by default for powerpc64le targets.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/detect-arch.c6
-rw-r--r--cmake/detect-arch.cmake2
2 files changed, 6 insertions, 2 deletions
diff --git a/cmake/detect-arch.c b/cmake/detect-arch.c
index 32a8db8..d7017d8 100644
--- a/cmake/detect-arch.c
+++ b/cmake/detect-arch.c
@@ -34,7 +34,11 @@
// PowerPC
#elif defined(__powerpc__) || defined(_ppc__) || defined(__PPC__)
#if defined(__64BIT__) || defined(__powerpc64__) || defined(__ppc64__)
- #error archfound ppc64
+ #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ #error archfound ppc64le
+ #else
+ #error archfound ppc64
+ #endif
#else
#error archfound ppc
#endif
diff --git a/cmake/detect-arch.cmake b/cmake/detect-arch.cmake
index f4eb99f..b80d666 100644
--- a/cmake/detect-arch.cmake
+++ b/cmake/detect-arch.cmake
@@ -52,7 +52,7 @@ if("${ARCH}" MATCHES "(x86_64|AMD64|i[3-6]86)")
elseif("${ARCH}" MATCHES "(arm(v[0-9])?|aarch64)")
set(BASEARCH "arm")
set(BASEARCH_ARM_FOUND TRUE)
-elseif("${ARCH}" MATCHES "ppc(64)?|powerpc(64)?")
+elseif("${ARCH}" MATCHES "ppc(64(le)?)?|powerpc(64(le)?)?")
set(BASEARCH "ppc")
set(BASEARCH_PPC_FOUND TRUE)
elseif("${ARCH}" MATCHES "alpha")