public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2] AArch64: Fix HP_TIMING_DIFF computation
@ 2023-02-08 15:57 Tang, Jun
  2023-02-17 16:44 ` Tang, Jun
  0 siblings, 1 reply; 4+ messages in thread
From: Tang, Jun @ 2023-02-08 15:57 UTC (permalink / raw)
  To: 'GNU C Library'


[-- Attachment #1.1: Type: text/plain, Size: 203 bytes --]

Attached is the updated patch that allows max execution time to be 1024 seconds before overflowing.

Link to the bug report - https://sourceware.org/bugzilla/show_bug.cgi?id=29329.

Regards,

Jun

[-- Attachment #2: hp-timing-patchv2.diff --]
[-- Type: application/octet-stream, Size: 541 bytes --]

diff --git a/sysdeps/aarch64/hp-timing.h b/sysdeps/aarch64/hp-timing.h
index f7f7ac7cae..7c6be072c4 100644
--- a/sysdeps/aarch64/hp-timing.h
+++ b/sysdeps/aarch64/hp-timing.h
@@ -41,7 +41,7 @@ typedef uint64_t hp_timing_t;
 #define HP_TIMING_DIFF(Diff, Start, End)			\
 ({  hp_timing_t freq;						\
     __asm__ __volatile__ ("mrs %0, cntfrq_el0" : "=r" (freq));	\
-   (Diff) = ((End) - (Start)) * (UINT64_C(1000000000) / freq);	\
+   (Diff) = (((End) - (Start)) * UINT64_C(1000000000 >> 6)) / (freq >> 6); \
 })
 
 #endif	/* hp-timing.h */

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: [PATCH v2] AArch64: Fix HP_TIMING_DIFF computation
@ 2023-02-22 17:27 Wilco Dijkstra
  2023-02-22 17:29 ` Tang, Jun
  0 siblings, 1 reply; 4+ messages in thread
From: Wilco Dijkstra @ 2023-02-22 17:27 UTC (permalink / raw)
  To: Tang, Jun; +Cc: 'GNU C Library'

Hi Jun,

I've merged your patch, see commit 311a7e0256975275d97077f1af338bc9caf0c837 .

Cheers,
Wilco

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-22 17:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-08 15:57 [PATCH v2] AArch64: Fix HP_TIMING_DIFF computation Tang, Jun
2023-02-17 16:44 ` Tang, Jun
2023-02-22 17:27 Wilco Dijkstra
2023-02-22 17:29 ` Tang, Jun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).