From patchwork Fri Mar 10 02:44:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 1754941 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=P9hVz1g6; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PXr4Q2HPcz1yWp for ; Fri, 10 Mar 2023 13:44:54 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E911F3858439 for ; Fri, 10 Mar 2023 02:44:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E911F3858439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678416291; bh=21fA3WRlrWKdZbVvqK99kzw4cp9gnigs1mcTLoX4EIs=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=P9hVz1g6XZLWQzEy3EmatgeEt7SL9befrJM2diSN5vF6DhqbIVecpT/vIPZlYxyE7 nYQIeFbvyyBlFQULZdH0zCjQpovo3W4+0FT1vUJDffPXLDy/ld4npD//9mDBz7e4ed b3rXKwnZukejDpp9E6drpx/HTpUubhESUp3jyXK4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by sourceware.org (Postfix) with ESMTPS id 39C7A3858C5E for ; Fri, 10 Mar 2023 02:44:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 39C7A3858C5E Received: by mail-pj1-x1032.google.com with SMTP id 6-20020a17090a190600b00237c5b6ecd7so8355687pjg.4 for ; Thu, 09 Mar 2023 18:44:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678416274; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=21fA3WRlrWKdZbVvqK99kzw4cp9gnigs1mcTLoX4EIs=; b=quoAcZEG4jCofsjcTtw2zX4Ve01BW1nVr066rNFCCH8/kad/WZ1YlxFekLCXc8REJS HqvxJSXKlvxVVf3D+bcWBIntSl32TQAgnpY4J6lgyMB4oS+l/qSKojv6O6nldmNIQkri 713e41dTa1StatOyuvBfdHU79zdKzG+fz+Hxs31KFgFaGLU/Hkwpbbv7L4PyARAG1v1n Wc+hVa+/YQcYi3gSv+YC0rlwiLTHDs/miyW2zEVl5B3V/TpAcMieYTAi7Ba/HNm7bkZk o2H2nggJ2p2tvL8TSZKmBeZG43BYHdRRfLm2iAPnyx+0/KxVp2+OAcs5sMkB6WigFpUZ 21DA== X-Gm-Message-State: AO0yUKWJYw4T3UovlR5YZFKwByVe+h20ddqlutDgsfn6sfeMThSSj8SK QOKxysvGBnwgZONL2zidxA2RjIiQKQE= X-Google-Smtp-Source: AK7set9ynSanoZZg1gDUW70Ov4QHF7Lw9EYy06Zw1J0HxfJbY9DyQNXlU+A+WHzaNjq6LWYwvCkFYw== X-Received: by 2002:a17:902:f54a:b0:19e:6e00:4676 with SMTP id h10-20020a170902f54a00b0019e6e004676mr28720471plf.61.1678416273872; Thu, 09 Mar 2023 18:44:33 -0800 (PST) Received: from noahgold-desk.. ([192.55.60.37]) by smtp.gmail.com with ESMTPSA id p16-20020a170902ebd000b001963bc7bdb8sm281129plg.274.2023.03.09.18.44.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 18:44:33 -0800 (PST) To: libc-alpha@sourceware.org Cc: goldstein.w.n@gmail.com, hjl.tools@gmail.com, carlos@systemhalted.org Subject: [PATCH v1] x86-64: Replace `%ah` write with `%eax` read Date: Thu, 9 Mar 2023 20:44:20 -0600 Message-Id: <20230310024420.521941-1-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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 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: Noah Goldstein via Libc-alpha From: Noah Goldstein Reply-To: Noah Goldstein Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" High8 partial registers can incur a stall when being modified (if not renamed seperately), or at the very least incur extra backend uops (if renamed seperately). Either way `testl $0x0400, %eax` is preferable to `andb $0x04, %ah`. Function size is unchanged when accounting for 16-byte padding. --- sysdeps/x86_64/fpu/e_fmodl.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/x86_64/fpu/e_fmodl.S b/sysdeps/x86_64/fpu/e_fmodl.S index d754668bce..d45f984e1a 100644 --- a/sysdeps/x86_64/fpu/e_fmodl.S +++ b/sysdeps/x86_64/fpu/e_fmodl.S @@ -13,7 +13,7 @@ ENTRY(__ieee754_fmodl) fldt 8(%rsp) 1: fprem fstsw %ax - and $04,%ah + testl $0x400,%eax jnz 1b fstp %st(1) ret