From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by sourceware.org (Postfix) with ESMTPS id A73D83858D32 for ; Tue, 14 Mar 2023 02:01:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A73D83858D32 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-yb1-xb30.google.com with SMTP id p203so6776852ybb.13 for ; Mon, 13 Mar 2023 19:01:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678759265; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=E5XkhuOGUbkoyFdQSsK4kZO/Ax6iFvWcI1iBkB1MgdA=; b=c5ChXFJzHfXFEz+GBIl9dHhQnyg3rS3xmcP/FNHlAOU1B1b8BC7ai+CGczQN3tK6RG dhD66sQnFrJGWyGYApUC1+P5PujOasLrPmBTqsKNg1HjvcpebmG0PCqhNgMeZ8DDvYgk XUVqNX7pFaGTzrOMJuOmkuPNASC3rHZOhSdKWkN5kt5fho4lixu1AMPWNS6jfkGSsOu4 eyysuUcRHDIfBkgxNh6WV9PfxoOnOLSy9jbY9y36piYc8R7r3eSa53714+ToUJigr++w gG6ZP1/dR72K7HCpOurD9Ii9cd2zCqjJ9n6u+zkfsrdM1ks4jnblBjA3/Kww5N/4BgUt gzFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678759265; 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=E5XkhuOGUbkoyFdQSsK4kZO/Ax6iFvWcI1iBkB1MgdA=; b=uRrZ44Mu/xcnxYLRoUsx9QTMpGwAnMr048Vzr/1L6M52ICc557y2+m4n2mpzVpX2mO 7nTbtCBp1i7dX5PlpFQ3Dseb9zMfGE5/afvyD6p6S/aMyfTjpHf8EbOKpW4DbNazJULs wtUMRKRo3fg8mJjTPFNG0gCpC6xakX05VDo3IGlUOccZNVjErd9GhQAKo0rF3KGrOrde fCP22TEOnEvFMO1PbklJHkUco8mM/pMDLUp6Oy9krv6L23a4GZF/8L9Rw2goxJXqrQrl HxB3beFr9aQmw7nmzy/GN2aV7KaIJ+YjWkIGf9E0i0enPHZ4NgSeamXA7zSsil7Ivd+S 208g== X-Gm-Message-State: AO0yUKX/FzK4oEB1DrZGmW95vd0+Dz75669dbr0SHfnzi71sE0aU9xVz s4yNmoaRGU+Vm3mgYV2vYugWwLnHZbLkr3bstUg/USji7q0= X-Google-Smtp-Source: AK7set+1OoesirtVUNdNX5NHPZU94XkL2jG/YGD8wKi7UZNv3Fil6KzI6w/pnU/MsmDwAu+XV3UoM4Nhe/QG9Z50bhM= X-Received: by 2002:a25:ad02:0:b0:b3b:4fbe:4899 with SMTP id y2-20020a25ad02000000b00b3b4fbe4899mr4218150ybi.0.1678759264956; Mon, 13 Mar 2023 19:01:04 -0700 (PDT) MIME-Version: 1.0 References: <20230310024420.521941-1-goldstein.w.n@gmail.com> <20230313205056.419587-1-goldstein.w.n@gmail.com> In-Reply-To: <20230313205056.419587-1-goldstein.w.n@gmail.com> From: "H.J. Lu" Date: Mon, 13 Mar 2023 19:00:29 -0700 Message-ID: Subject: Re: [PATCH v2] x86-64: Replace `and %ah` write with `test %ah` 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.3 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 Mon, Mar 13, 2023 at 1:51 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 read only `testl $0x4, %ah` is preferable > to `andb $0x4, %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..e9a76178f9 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 > + testb $0x4,%ah > jnz 1b > fstp %st(1) > ret > -- > 2.34.1 > OK. Thanks. -- H.J.