From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by sourceware.org (Postfix) with ESMTPS id 34B953858C62 for ; Wed, 11 Jan 2023 17:22:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 34B953858C62 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=owlfolio.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=owlfolio.org Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id C4EE432005CA for ; Wed, 11 Jan 2023 12:22:32 -0500 (EST) Received: from imap45 ([10.202.2.95]) by compute1.internal (MEProxy); Wed, 11 Jan 2023 12:22:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=owlfolio.org; h= cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1673457752; x=1673544152; bh=o1izC1oJ30 n3HraIxkHVHv1SUnj/gyW3FopYSk5nZFE=; b=RezhGMd4AsMGHxi18Hs/4s6v6d RhmLAVHCJ1SSvLz5t6e62dsI0Z975g9t/QgR2wo2yDLe7KyTGPUJe9812KzO4t4B 4tjblvymJAFaRq1NFILbyJVbZg3e6v+WKrYWPaehyfAdKv5D7IXJjj65IrtCIqSt a11HhkuN8F55PHYDiE8v7TIq+EtIjszMXrkRzmRIhRX17ubV/a4sC7KiltBgx7Oe 9dbsp2o4iaj0rZDRpFUWPTw0UMG+TVEZWZvPjstPEQagHoHbkJjnhtQGEawTie8g mQp+iUMgyiSgL5dYWr1wNro3rC1g3yrRdBuCdPjYx0EDhVeMK5vkrpvST5Tg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1673457752; x=1673544152; bh=o1izC1oJ30n3HraIxkHVHv1SUnj/ gyW3FopYSk5nZFE=; b=RIymTVYY6FzyY82+GvzKm0peKtnmj9nGmJ60giQEEsZY 9FXT8dRfufjlEGUB6Qs0q/NSTYgenLMuhnfUY14wypXUvpS+pvFG7mx5SfTkNawi RQf1uYdlBvbqcCFNXSTsodC6QCKNMB8bpcibLnvEPUqFPre6owgqVUPkzQZ3PzLo grXZR9IWdjVgU2L9Gm1Se06eXprTajo7crwHdsBHR6/1gDuh4IGt+9jdNWszJDSf JsF+59bIh87ZeJTeGgD43NcAnx+p9wQ2+BeiyhANj0vMBueEkrtOQqfqOuMTCmOJ eRq6AZcvO3RD1fqYLjLIOmcaEkAloUZqEwZDfa15JQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrleeggdellecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfkggrtghk ucghvghinhgsvghrghdfuceoiigrtghksehofihlfhholhhiohdrohhrgheqnecuggftrf grthhtvghrnhephfeuhfevueffteffgfejtefgkeekheeftdeflefgheffffevheekleef gfehffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epiigrtghksehofihlfhholhhiohdrohhrgh X-ME-Proxy: Feedback-ID: i876146a2:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 22DA2272007A; Wed, 11 Jan 2023 12:22:32 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1185-g841157300a-fm-20221208.002-g84115730 Mime-Version: 1.0 Message-Id: <3dd92ee4-00b4-4bf2-ae8c-908a29752198@app.fastmail.com> In-Reply-To: <8ae95272accb441aad774a5f10d27d57@amazon.com> References: <8ae95272accb441aad774a5f10d27d57@amazon.com> Date: Wed, 11 Jan 2023 12:22:11 -0500 From: "Zack Weinberg" To: "GNU libc development" Subject: Re: bug fix for hp-timing.h (aarch64) Content-Type: text/plain X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, Jan 11, 2023, at 11:44 AM, Tang, Jun wrote: > On Graviton 3 the frequency is 1050000000 and the original function > hp-timing.h no longer gives the correct answer. The following patch can > fix the bug: Please try this instead: > - (Diff) = ((End) - (Start)) * (UINT64_C(1000000000) / freq); \ > + (Diff) = (((End) - (Start)) * UINT64_C(1000000000)) / freq; \ This avoids using floating-point arithmetic but should still do the rescale correctly. (The multiplier and divisor are both guaranteed to be less than 2**32, so, as long as we do the multiplication in 64-bit arithmetic, we cannot lose bits via overflow.) zw