-
Notifications
You must be signed in to change notification settings - Fork 13.4k
HP PA-RISC architecture initial build support #121220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Fix this configure stage error: -- LLVM host triple: hppa1.1-unknown-linux-gnu CMake Error at cmake/config-ix.cmake:516 (message): Unknown architecture hppa1.1
Add support for time measurements on hppa, otherwise build breaks with this compiler error: You need to define CycleTimer for your OS and CPU
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-third-party-benchmark Author: Helge Deller (hdeller) ChangesTwo small patches, which allows to sucessfully build the basic LLVM tools on the HP PA-RISC (hppa) architecture. Full diff: https://github.com/llvm/llvm-project/pull/121220.diff 2 Files Affected:
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index 64878d28d9e1e5..1dbb468a460447 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -512,6 +512,10 @@ elseif (LLVM_NATIVE_ARCH STREQUAL "m68k")
set(LLVM_NATIVE_ARCH M68k)
elseif (LLVM_NATIVE_ARCH MATCHES "loongarch")
set(LLVM_NATIVE_ARCH LoongArch)
+elseif (LLVM_NATIVE_ARCH MATCHES "hppa1.1")
+ set(LLVM_NATIVE_ARCH HPPA)
+elseif (LLVM_NATIVE_ARCH MATCHES "hppa64")
+ set(LLVM_NATIVE_ARCH HPPA)
else ()
message(FATAL_ERROR "Unknown architecture ${LLVM_NATIVE_ARCH}")
endif ()
diff --git a/third-party/benchmark/src/cycleclock.h b/third-party/benchmark/src/cycleclock.h
index d4f1330b671db9..723a3bd17094de 100644
--- a/third-party/benchmark/src/cycleclock.h
+++ b/third-party/benchmark/src/cycleclock.h
@@ -228,6 +228,16 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
struct timeval tv;
gettimeofday(&tv, nullptr);
return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
+#elif defined(__hppa__)
+ // HP PA-RISC provides a user-readable clock counter (cr16), but
+ // it's not syncronized across CPUs and only 32-bit wide when programs
+ // are built as 32-bit binaries.
+ // Use clock_gettime(CLOCK_MONOTONIC, ...) instead of gettimeofday
+ // because is provides nanosecond resolution.
+ // Initialize to always return 0 if clock_gettime fails.
+ struct timespec ts = {0, 0};
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ return static_cast<int64_t>(ts.tv_sec) * 1000000000 + ts.tv_nsec;
#else
// The soft failover to a generic implementation is automatic only for ARM.
// For other platforms the developer is expected to make an attempt to create
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please reference in the commit message the corresponding commit in the google/benchmark repo? It'll make life easier when we sync. Thanks.
Here is the pull request for the commit in google/benchmark repo: |
Info: The pull request for benchmark project has been resolved & closed since the changes were just merged into mainline repo. |
Two small patches, which allows to sucessfully build the basic LLVM tools on the HP PA-RISC (hppa) architecture.
Please pull.
Thanks!
Helge