mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Cc: musl@lists.openwall.com
Subject: Re: [musl] ASM-to-C conversion for i386
Date: Tue, 28 Dec 2021 09:42:30 +0100	[thread overview]
Message-ID: <20211228084230.GF1949@voyager> (raw)
In-Reply-To: <20211227184137.GY7074@brightrain.aerifal.cx>

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

  reply	other threads:[~2021-12-28  8:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-26 20:42 Markus Wichmann
2021-12-26 21:20 ` Markus Wichmann
2021-12-27 13:08 ` Markus Wichmann
2021-12-27 15:00 ` Rich Felker
2021-12-27 16:27   ` Markus Wichmann
2021-12-27 16:30   ` Rich Felker
2021-12-27 18:04     ` Markus Wichmann
2021-12-27 18:41       ` Rich Felker
2021-12-28  8:42         ` Markus Wichmann [this message]
2021-12-29 10:02   ` Markus Wichmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211228084230.GF1949@voyager \
    --to=nullplan@gmx.net \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).