From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 65B1638582B0; Thu, 7 Jul 2022 16:42:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 65B1638582B0 From: "juntangc at amazon dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/29330] New: hp-timing not correct for graviton Date: Thu, 07 Jul 2022 16:42:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: juntangc at amazon dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2022 16:42:24 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29330 Bug ID: 29330 Summary: hp-timing not correct for graviton Product: glibc Version: unspecified Status: UNCONFIRMED Severity: minor Priority: P2 Component: libc Assignee: unassigned at sourceware dot org Reporter: juntangc at amazon dot com CC: drepper.fsp at gmail dot com Target Milestone: --- hp-timing is only used on benchtests today, but it can be used on other thi= ngs in the future. It's broken on graviton beacuse the freq we have is 10500000= 00. 1000000000ULL/1050000000ULL =3D 0 and thus benchtests output are all 0. The following patch can fix the bug: ``` diff --git a/sysdeps/aarch64/hp-timing.h b/sysdeps/aarch64/hp-timing.h index f7f7ac7cae..270e0c2e24 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" : "=3Dr" (freq)); \ - (Diff) =3D ((End) - (Start)) * (UINT64_C(1000000000) / freq); \ + (Diff) =3D (hp_timing_t)((End) - (Start)) * ((1000000000.0) / freq); \ }) #endif /* hp-timing.h */ ``` --=20 You are receiving this mail because: You are on the CC list for the bug.=