Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 764065 Details for
Bug 761715
>=dev-db/mysql-8.0.22: failed build on ppc, riscv (error: static assertion failed: (unsigned) long long type on this platform does not have an always-lock-free property. Bailing out ...)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
mysql-8.0.27-riscv-cycle-timer.patch
mysql-8.0.27-riscv-cycle-timer.patch (text/plain), 2.20 KB, created by
Alex Fan
on 2022-02-01 00:05:53 UTC
(
hide
)
Description:
mysql-8.0.27-riscv-cycle-timer.patch
Filename:
MIME Type:
Creator:
Alex Fan
Created:
2022-02-01 00:05:53 UTC
Size:
2.20 KB
patch
obsolete
>https://bugs.gentoo.org/761715 >https://github.com/MariaDB/server/pull/1981 > >From: alexfanqi <alex.fan.q@gmail.com> >Date: Tue, 1 Feb 2022 10:42:58 +1100 >Subject: [PATCH] implement cycle accuracy timer for riscv > >Status: upstream not likely accept for unsupported arch > >Signed-off-by: alexfanqi <alex.fan.q@gmail.com> >--- > include/my_rdtsc.h | 1 + > mysys/my_rdtsc.cc | 24 ++++++++++++++++++++++++ > 2 files changed, 25 insertions(+) > >--- a/include/my_rdtsc.h >+++ b/include/my_rdtsc.h >@@ -128,5 +128,6 @@ void my_timer_init(MY_TIMER_INFO *mti); > #define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26 > /* #define MY_TIMER_ROUTINE_ASM_SUNPRO_X86_64 27 - No longer used */ > #define MY_TIMER_ROUTINE_ASM_AARCH64 28 >+#define MY_TIMER_ROUTINE_ASM_RISCV 29 > > #endif > >--- a/mysys/my_rdtsc.cc >+++ b/mysys/my_rdtsc.cc >@@ -168,6 +168,28 @@ ulonglong my_timer_cycles(void) { > __asm __volatile__("mrs %[rt],cntvct_el0" : [ rt ] "=r"(result)); > return result; > } >+#elif defined(__GNUC__) && defined(__riscv) // RISC-V >+ // Use RDCYCLE (and RDCYCLEH on riscv32) >+ { >+#if __riscv_xlen == 32 >+ ulong result_lo, result_hi0, result_hi1; >+ // Implemented in assembly because Clang insisted on branching. >+ __asm __volatile__( >+ "rdcycleh %0\n" >+ "rdcycle %1\n" >+ "rdcycleh %2\n" >+ "sub %0, %0, %2\n" >+ "seqz %0, %0\n" >+ "sub %0, zero, %0\n" >+ "and %1, %1, %0\n" >+ : "=r"(result_hi0), "=r"(result_lo), "=r"(result_hi1)); >+ return (static_cast<ulonglong>(result_hi1) << 32) | result_lo; >+#else >+ ulonglong result; >+ __asm __volatile__("rdcycle %0" : "=r"(result)); >+ return result; >+ } >+#endif > #elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME) > /* gethrtime may appear as either cycle or nanosecond counter */ > return (ulonglong)gethrtime(); >@@ -453,6 +475,8 @@ void my_timer_init(MY_TIMER_INFO *mti) { > mti->cycles.routine = MY_TIMER_ROUTINE_ASM_GCC_SPARC64; > #elif defined(__GNUC__) && defined(__aarch64__) > mti->cycles.routine = MY_TIMER_ROUTINE_ASM_AARCH64; >+#elif defined(__GNUC__) && defined(__riscv) >+ mti->cycles.routine = MY_TIMER_ROUTINE_ASM_RISCV; > #elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME) > mti->cycles.routine = MY_TIMER_ROUTINE_GETHRTIME; > #else >-- >2.25.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 761715
:
679503
|
761331
|
761332
|
761333
|
761334
|
764064
| 764065