From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x112d.google.com (mail-yw1-x112d.google.com [IPv6:2607:f8b0:4864:20::112d]) by sourceware.org (Postfix) with ESMTPS id 6C9B33858D32 for ; Fri, 10 Mar 2023 16:39:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6C9B33858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-540cb2fb5b9so3505447b3.3 for ; Fri, 10 Mar 2023 08:39:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678466359; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=kD/N0Sbsu5Eq4GTlltI6stfne3R/wr6Z5m5g+8PenKo=; b=eCS7MVj/t7Dj6S4sKAq0WC3DUegpKNCGbadOhVD6AwEvnbj5edguyT4YqZPZQE71wL YgK9ruWW1cf+Dk2nXWxJ3F3BDifMMJHH2Yy4ovZFA6hmIWZR4b4jV/gzg0qdMLPpSRL3 R45+zWkwBWL3ObaXDu8xDruTTU/27kF7trYLRZX9qdzCUg3YCwCeEe6zXGkUxp8MOqRT 9huDBxWqU9ajYjo5AxWEdQjMXiDSsuOnJ9nU+UK0/m43Jr2vmqiU2Vr69dbUEsIKpytH YBFZlC/I+EXprzj9kTV4XlJpEN+Va0uyHXTvzgg7JY8U52UFXYP9M/J7h5lBM27Y+25L 0PLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678466359; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kD/N0Sbsu5Eq4GTlltI6stfne3R/wr6Z5m5g+8PenKo=; b=GD6knhWcmarWy5AZ63rkv4aJdOxkhDKUYuCyFKOPTBAzGHe1+07dzzR1T1IXFIwfUk kqgJz3oytHaqsvH40DV79yBLeslZ8Nqt7smnqqfBy2Hmg8WILA9n722Oi4PcqToZ/joQ IoJYcUL/TNO6WXZKXpDHr5WlTKugXZRxrkvRD165FubXcxeHF5BWoCILTDO7JF2EK0/M 1ejiQlDK2lk1yboQAtfrGOhUvOTFb/FY7fHK6UhyMPiIJE4pOMs10dztvDLL74j4JIGV ky2siD0kRDEkEhmc6JNNli+/FcME74wIHdtd6F9Kn6uzLnDfIz31AJQQSI+w6u8ZNo5W 4myQ== X-Gm-Message-State: AO0yUKX0pPxAoWmCK1sqf/w3grMyeRr2u5/cdEZBOvAOOVHM0L6OnLhx 0D0K+o2IZG4JUxYXonZ5orjs768xZByPFIBRvTo= X-Google-Smtp-Source: AK7set8gmWGUSzxS6nxZqTSvEjh4H2BrlPsFarRJurXw/uhMAUFG+d9W/s9ahPuVLTnH+FG7ulwbnMSo8owFlLu8F4g= X-Received: by 2002:a81:ac1a:0:b0:533:cf4e:9a80 with SMTP id k26-20020a81ac1a000000b00533cf4e9a80mr16403730ywh.6.1678466358769; Fri, 10 Mar 2023 08:39:18 -0800 (PST) MIME-Version: 1.0 References: <20230310024420.521941-1-goldstein.w.n@gmail.com> In-Reply-To: <20230310024420.521941-1-goldstein.w.n@gmail.com> From: "H.J. Lu" Date: Fri, 10 Mar 2023 08:38:42 -0800 Message-ID: Subject: Re: [PATCH v1] x86-64: Replace `%ah` write with `%eax` read To: Noah Goldstein Cc: libc-alpha@sourceware.org, carlos@systemhalted.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3022.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 List-Id: On Thu, Mar 9, 2023 at 6:44 PM Noah Goldstein wrote: > > 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 > -- > 2.34.1 > OK. Thanks. -- H.J.