From patchwork Fri Feb 3 13:29:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 64253 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EA6D33858284 for ; Fri, 3 Feb 2023 13:30:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EA6D33858284 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675431032; bh=dOkLW7XkEoi12L+GkD4ONYprGK1tfYg2PxjoGA576UE=; h=To:CC:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=LGJG/N1nuWZwiyj/AgZ+02qIKdrXa2N7DIrJ48uIrH0TmwRroUGCEocUeV73+GjBN ScSk2/Q6kevEHL1y9EypfBR1wU3svwpVcZnCqBDWaFd0tW3IO/F8x0OUXWy9aC0U6g sTDZT5O68RUgaawU3OSKwehX0ZVMX1VUnbfe6+0M= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2057.outbound.protection.outlook.com [40.107.247.57]) by sourceware.org (Postfix) with ESMTPS id 69C1A3858C5F for ; Fri, 3 Feb 2023 13:30:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 69C1A3858C5F Received: from AS9PR07CA0002.eurprd07.prod.outlook.com (2603:10a6:20b:46c::20) by AS8PR08MB6392.eurprd08.prod.outlook.com (2603:10a6:20b:31a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.28; Fri, 3 Feb 2023 13:29:54 +0000 Received: from AM7EUR03FT016.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46c:cafe::23) by AS9PR07CA0002.outlook.office365.com (2603:10a6:20b:46c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.9 via Frontend Transport; Fri, 3 Feb 2023 13:29:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT016.mail.protection.outlook.com (100.127.140.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.28 via Frontend Transport; Fri, 3 Feb 2023 13:29:54 +0000 Received: ("Tessian outbound b1d3ffe56e73:v132"); Fri, 03 Feb 2023 13:29:53 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 390fcc750e7dc7c9 X-CR-MTA-TID: 64aa7808 Received: from 1a25d43d87a2.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5F5233DA-4D54-4BCF-9ADD-630566E3A9D5.1; Fri, 03 Feb 2023 13:29:47 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1a25d43d87a2.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 03 Feb 2023 13:29:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bQXDq3lPb8Ul6iJN0jdX1gch38s6aLEcuCMEbYd5hhxTmL+a7mksaezqtfejca44phn7NvADTSORrq7a4UR2qsJxBkbAZF6VXliDckjri+4GRD/eQLW2TlQLuLHEfI8HKp7GJIBO/UCT7/HEELr+1HeGfbkzPA8E/IL9bp1LjLd0gjcQWKgLTT2iIK6KN8TP8K4lFdXoYPQStuXlMqgcDDeZ3iUTZ6BIlrisKyo0Ju27p9bkVWnjVU8xnnwN0E7aJxKEEWhLoDVM10LlNTq5ZunD1mvwjMx5as/Pn2bX87WrwqXwRSoPcSbLowUxYzkmjdAkVe51scHBlOFQN3zYQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dOkLW7XkEoi12L+GkD4ONYprGK1tfYg2PxjoGA576UE=; b=OGc6j37Y8xrbF8+P18WG/icra9lumgXsYDTq1YMT9y6v+pdgUTdnlQLQgBe3MNcYaXPFiKdfkUDlbLQ/xHsAFKZ3lEsizI3ygJnxdTqhEhh7bVtPqDSSlLsN+H88iYvicYk/RIJxL8CzkKAsNeNZCY6bw03yPOtkO9Qs9WpGwcEEdVmeY9cOz4he6zo6GopXXy4hibvNo3JirHkWsGKX8MqGAxOm3CuaJ7wqMZlkLswi3pg5UW5y59Ljux36Ky2e1Hlmf7yxF7Pm+aAyeHYu8yN/ntd7/9oNzZDNxqoiNV6DyTQdg9dv/gSEAGcfPMVAcifK2KMtQ9tpk7dWYhdBvQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Received: from PAWPR08MB8982.eurprd08.prod.outlook.com (2603:10a6:102:33f::20) by PA4PR08MB6046.eurprd08.prod.outlook.com (2603:10a6:102:e4::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.29; Fri, 3 Feb 2023 13:29:36 +0000 Received: from PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::dc17:8fa2:cce5:3573]) by PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::dc17:8fa2:cce5:3573%8]) with mapi id 15.20.6064.024; Fri, 3 Feb 2023 13:29:35 +0000 To: "Tang, Jun" CC: 'GNU C Library' Subject: patch for hp-timing.h Thread-Topic: patch for hp-timing.h Thread-Index: AQHZN9IvAXQnMYXJZEuLk2moftMhwA== Date: Fri, 3 Feb 2023 13:29:35 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: PAWPR08MB8982:EE_|PA4PR08MB6046:EE_|AM7EUR03FT016:EE_|AS8PR08MB6392:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f450126-e7b1-4195-fc09-08db05eabc38 x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: hV9b6OBWaqwKzcZ5jlvGQjU5fkL5trDIchAw1xswh96MINLSAIckCt78bRshaXABROGIDoGkQaZ3eOhU4bVNiutLQPOS+8oxsz2F2qCoUYq5LWrfv51ElduPAb1aKogXnlRsoIYbj7QGUWv922voo9JzTqUdq4kS9OIuX2z4+AeFwOaDG3O375RgubhfH2hT9eYf/sOW+LUQTDYg6ZvbFe/bSRF8JpKhee3WrowfE+w2AuQVCsN/UEzAwr/Xu87rBggchB0jTY9V4saSNipd30APbdmbbWmPogGCQXaWm3MxbMurwgWthnS7QkyrgDANuhmXtAjLdo/Vn4fg0rtWoc1tPR3srrjC53y7Fb65v4p4s7rFt5DWELcYz7Gx9nKMN79eJHfgSWi/K0VzW166FgImJyQBwMZ34+ny7jm7+WJm5X985sqNJYIl97czfOsikMWorbJuXtTAO1Kom9+jXt1dfreQlKg+dGxbpK2hPf8xfBlTf6g+o1SMO1gTwXEtrCZSe6gBPYbWQZ/twFYG6MeSQtChSRXarEo6xTHOroFISCJqudG1lYR9harx+90oxLGrqv8OM/LNHcQtET+Bc5KxLDTMxnGU7UFdVA+zGvwXuNZ1vjZyxZgIOs+K+SFvTEHU1DI7XLThQr/YnbkBTSLeEXVkJ1TDGMFFcILuXo7zvDIdH57/OhZT5fIrAOEtOaFufeOmbQzx5i8MNTga1A== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAWPR08MB8982.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(396003)(366004)(346002)(136003)(39860400002)(451199018)(55016003)(26005)(9686003)(86362001)(186003)(122000001)(38100700002)(38070700005)(33656002)(76116006)(41300700001)(8936002)(52536014)(66946007)(7696005)(71200400001)(66446008)(64756008)(66556008)(66476007)(6916009)(316002)(2906002)(6506007)(478600001)(8676002)(4326008)(91956017)(5660300002); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6046 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT016.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: ad5672fd-b33c-463a-7cbe-08db05eab10a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4HVdJ7HmvigOHoEYeNSyaYPnEI9wXdsbD4X1iynrM0zuACXu+BxFZkj9jmSP/x0OnoTgbr/JBipARxPavKa5s6kqy7eTCBi7BfI3650D1gSd9h4ttZA+z8MzqIcIoK57YjeTF/S82cpPHFJxF0U4/UOPGXnXyHFndqyD6pi/lOjdpUQoFP5tvBywWTCLS6uBv/UJTpv9LrVfcM9GAcSzZ+4qZe0dZCrNSCLJ4Zr7h1a1241/x7/TFuBSqNuykr1xCnbm+gXyglaDOQWC1ChFilw9ZfzxwuPf/L4JJw2EaJx/0XIXFFaxarA6wfdzWvgNo1b+vwfVbIVfedwX1RIQTLTXJxMYGPs8rcLFZ/HpBFTbjb3hnEGXTgSS9eLj4hQKJ8GlDXVNHKIqv34AkClvL5OJoMFSgEXwrsS7bGeqiZGhFUi7GAZ1OcIi0e9UxV6SmG+RGOEnAVp0t9MSg+3Hs3nLlMq5jVsj8zUP/rgw4ClKXkrqOJ4KAbkdUgFcHAJC0LC2tkp9r4+GRiVzticGM5pLq3JcqCnrgKHxVtzhg6OrLXc9JqWbuo/CZx1bcyRtlU9YtLxjs1/fqZFw0A2q4Uv8Ndxgzq+q4rhKY9l9JuV/n3BsELhA+f1T4JUJgTju0p542gXHt27ePmZ8OVZ94K3u+Z7GQDHMrM4eB0tFzhgExhqH5e6yKHnEcVweESfjfmDJNhRrXeYn4IdAdKWIlw== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230025)(4636009)(39860400002)(346002)(396003)(136003)(376002)(451199018)(36840700001)(40470700004)(46966006)(336012)(36860700001)(82740400003)(33656002)(82310400005)(316002)(52536014)(5660300002)(47076005)(186003)(81166007)(86362001)(40460700003)(55016003)(40480700001)(356005)(2906002)(26005)(9686003)(478600001)(70206006)(6862004)(70586007)(4326008)(7696005)(6506007)(8676002)(41300700001)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2023 13:29:54.0925 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8f450126-e7b1-4195-fc09-08db05eabc38 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT016.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6392 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Wilco Dijkstra via Libc-alpha From: Wilco Dijkstra Reply-To: Wilco Dijkstra Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Hi Jun, > hp-timing is only used on benchtest today, but it can be used on other > measurements in the future. It can't as proposed below since this would overflow in ~16 seconds. We could improve this by removing the zero bits from the multiply and doing some shifts, maybe that will make the interval long enough for integer multiply. Otherwise I'd suggest the floating point version since it's not like the benchtests don't already use floating point. Cheers, Wilco diff --git a/benchtests/Makefile b/benchtests/Makefile index 292976b26b..a624614207 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -499,4 +499,5 @@ $(objpfx)bench-%.c: %-inputs $(bench-deps) cat $($*-INCLUDE); \ fi; \ $(PYTHON) scripts/bench.py $(patsubst %-inputs,%,$<); } > $@-tmp + cp -f $@-tmp $@-bak Unintended change I guess? mv -f $@-tmp $@ diff --git a/sysdeps/aarch64/hp-timing.h b/sysdeps/aarch64/hp-timing.h index f7f7ac7cae..c699effe6a 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)) / freq; \ }) #endif /* hp-timing.h */