public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Tang, Jun" <juntangc@amazon.com>
To: 'GNU C Library' <libc-alpha@sourceware.org>
Subject: [PATCH v2] AArch64: Fix HP_TIMING_DIFF computation
Date: Wed, 8 Feb 2023 15:57:46 +0000	[thread overview]
Message-ID: <973fda3c2f5b4d71b205c853e4b34af9@amazon.com> (raw)


[-- 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 */

             reply	other threads:[~2023-02-08 15:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08 15:57 Tang, Jun [this message]
2023-02-17 16:44 ` Tang, Jun
2023-02-22 17:27 Wilco Dijkstra
2023-02-22 17:29 ` Tang, Jun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=973fda3c2f5b4d71b205c853e4b34af9@amazon.com \
    --to=juntangc@amazon.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).