From c8b7d4c0da0ad5a112a5108256cf100dab067c0b Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Thu, 15 Aug 2024 02:12:35 +0000 Subject: automatic import of perftest --- 0007-add-loongarch-support-for-perftest.patch | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 0007-add-loongarch-support-for-perftest.patch (limited to '0007-add-loongarch-support-for-perftest.patch') diff --git a/0007-add-loongarch-support-for-perftest.patch b/0007-add-loongarch-support-for-perftest.patch new file mode 100644 index 0000000..515f8bf --- /dev/null +++ b/0007-add-loongarch-support-for-perftest.patch @@ -0,0 +1,35 @@ +From 9600d3bae7e8f116aff303df7e13f23e67274096 Mon Sep 17 00:00:00 2001 +From: Wenlong Zhang +Date: Sat, 7 Jan 2023 03:23:20 +0000 +Subject: [PATCH] add loongarch support for perftest + +add function get_cycles for loongarch64 + +Signed-off-by: Wenlong Zhang +--- + src/get_clock.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/get_clock.h b/src/get_clock.h +index dacbcd0..5b7b48b 100755 +--- a/src/get_clock.h ++++ b/src/get_clock.h +@@ -105,6 +105,15 @@ static inline cycles_t get_cycles() + return cval; + } + ++#elif defined(__loongarch64) ++typedef unsigned long cycles_t; ++static inline cycles_t get_cycles() ++{ ++ cycles_t count; ++ asm volatile("rdtime.d %0, $zero" : "=r" (count)); ++ return count; ++} ++ + #else + #warning get_cycles not implemented for this architecture: attempt asm/timex.h + #include +-- +2.33.0 + -- cgit v1.2.3