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=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25217 invoked from network); 28 Dec 2021 08:42:46 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 28 Dec 2021 08:42:46 -0000 Received: (qmail 14030 invoked by uid 550); 28 Dec 2021 08:42:44 -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 13998 invoked from network); 28 Dec 2021 08:42:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1640680952; bh=uZFntCqkQG6VKizlXds9Giv5w60s/q4gANBWtWiBX+I=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=NwwdMQZEbl2GNzNXQV2NNMT2K4kvVuUa8PAhtcPMX8GUJPGDxGkMjE/jKhyjJ38rK 6nXzq3dXfI57OZuS2Y+ye1ueidgS4LNoHSl/7enqNbNXS/E4/LMc6+UkbZ6+w5oYaF 1OtoUjTegI1Kq7bzSZZEpkzWGfVUdECQgeCppoL8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Date: Tue, 28 Dec 2021 09:42:30 +0100 From: Markus Wichmann To: musl@lists.openwall.com Cc: musl@lists.openwall.com Message-ID: <20211228084230.GF1949@voyager> References: <20211226204238.GA1949@voyager> <20211227150010.GU7074@brightrain.aerifal.cx> <20211227163056.GV7074@brightrain.aerifal.cx> <20211227180437.GE1949@voyager> <20211227184137.GY7074@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211227184137.GY7074@brightrain.aerifal.cx> User-Agent: Mutt/1.9.4 (2018-02-28) X-Provags-ID: V03:K1:0wfkg80Wy0lyeQFP5xOi+foOZ6QY288iSw4c/NJ5hw/JFo2xU6p oI5GUreBO7n4HUVsfUryRteGohZNvWrir94OnMVFmmQpuj+/yirNOnMI+nmlSlwg3txklgm DPN+XuFWl8kzAwL+abI8jFVbV27EyEo0cSNXcms8UUEUzH7hZzQt54g23NkyhRk9R1EaNOb Hx5B7l/42Op40ErLzqZsA== X-UI-Out-Filterresults: notjunk:1;V03:K0:bQNlD23LAvI=:Jq0kgOF72VvR+zEby+ikp6 g9WEQAGAf1MdI5KNJ+y9tLF9r/enH/tzooXyZAeJItpFfjFr8qoc0zfbDXYyb8/pzuc00bSzi 3Ncfu4bFOW2atM/LU3L9ptBToSpjeIkBqEyAfG8z4fSpE75YlPKlvtfe/uM8Vp8pyT8knd0i8 kRmThNSLjTlamPTbGX1hws7Pdt2SVQKX6DJG+If/Kavo/z2T9J+6FjT9I5zKUv5ngWb2ViUpR N45RNU4vXiR4D5o53KOd0+F0xC+PXQA9+CPy5MymG6rc/1/vHCOWCCQZN4H1nLQerjwIvLZ00 FTVJPxG5NdlfhLqEACTfktLXoiBLKZl0Jfpqe6B1h1q5HQGYdqHLfWWQKXXnTHqhVoYuuuQpl g2RJlGiw8H0U+2udEsrVRG8ZKi7qxtXWM83Z2ksCntG+/PaXIEGarOK2duGtkmNPEJdFPmgIQ DahCYFvU3Z3GYR78gtFf5oxqKJs6M6P3mtG/ndTGUlmh1FbWPz35DdoQqkDX+xU2QJ2NOAeGV cFUssZC143WT03PiM/kSntbuqL5eKa44ulYTY6TRmiGd5DVuqYTNrqeoNXf/NJHeJ8e153m1n H2plcWYi7+qos0HmZvM/vZDMX3DuguqahYbhUyeZcdkkNiRUWVbYROn91X4p9aOIPV5w0i/qM LZvkY3rPuyhWCznrEmZsDvWPqRLJoNXYX4n4qrDnhN+5vtQ4kLQw2dkm6fHr/us9zFzMlJeRM 508B8ntQ4ib8Khh38FNvxHJBlStOnDQjk1F9nJcjDfko4J0Iq1qToEZec7Yqv4o+NqXp9Dkzm YtXyJJDn3Zwtxg50eBbjkEvyjoY2lBNEaJMAyQdocpcFO43MCQnp0sYgUwtggJF8wvw6BW7gU pZBaFQqa4RXfn7Njm1QOEDxoTSYbajphVk6wYheUSdZZ7D+QncpiVxKAQOhO9aUgZ/hDTll0F gyBh9+wxU6PxayXdF5EUhgJCShjgLg0i7ZSUxgtQ+sdmQHHcVZXuj7XJrp00X7owWAvlRFAAu /AMOUU+YHgpxAu7RH54jZTApp0JPD7yTMofrzKFf8fPmIOiuhCznLwsK6Qx4wrPJSk4lf7EMU oc86AtQhFEJW0Q= Content-Transfer-Encoding: quoted-printable Subject: Re: [musl] ASM-to-C conversion for i386 On Mon, Dec 27, 2021 at 01:41:38PM -0500, Rich Felker wrote: > Yes, I think the insns that can emit other precisions probably would > need 3 versions, but there are very few of these -- just fabs and > fmod? > > Rich x87 does not have an fmod instruction. There are fprem and fprem1, and the difference escapes me at the moment. Anyway, frndint is also used in this way. But for now, I have decided to just leave all of them as they are. The fabs functions could not be any simpler, and it is unlikely the remainder functions would benefit from this treatment, either, because of the use of the status word. In the end I would create functions that are used precisely once, and don't even clean up the function where they are used all that much. This means only the remquo functions suffer the penalty of superfluous rounding. But in that case, I think the benefit of having only one place with the implementation of the status word bit shuffle is actually worth it. So the only thing I would even consider right now is to go back into the remainder functions and replace the "0x400" with a symbolic constant, now that there is one (X87_SW_C2). Beyond that, I cannot think of what to change about the maths code any more. String code needs more love, however. Ciao, Markus