From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 29225 invoked from network); 5 Aug 2021 13:40:59 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 5 Aug 2021 13:40:59 -0000 Received: (qmail 30539 invoked by uid 550); 5 Aug 2021 13:40:57 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 30521 invoked from network); 5 Aug 2021 13:40:56 -0000 Date: Thu, 5 Aug 2021 16:40:45 +0300 (MSK) From: Alexander Monakov To: Stefan Kanthak cc: Szabolcs Nagy , musl@lists.openwall.com In-Reply-To: Message-ID: References: <04BD4026EE364FF7AFBAF8C593E9A2E7@H270> <20210803202735.GA37904@port70.net> User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [musl] [Patch] src/math/i386/remquo.s: remove conditional branch, shorter bit twiddling On Wed, 4 Aug 2021, Stefan Kanthak wrote: > The change just follows by removing 6 LOC/instructions.-) Have you considered collecting the three bits in one go via a multiplication? You can first isolate the necessary bits with 'and $0x4300, %eax', then do 'imul $0x910000, %eax, %eax' to put the required bits in EAX[31:29] in the right order, then shift right by 29. Three instructions, 14 bytes. Alexander