mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ndiamond@despammed.com
To: linux-kernel@vger.kernel.org
Subject: Re: How to use floating point in a module?
Date: Wed, 2 Jun 2004 00:52:57 -0500 (CDT)	[thread overview]
Message-ID: <200406020552.i525qvk08725@mailout.despammed.com> (raw)

H. Peter Anvin replied to me:

>> (The CPU is an i686. I'll have to look up its opcodes and see if its
>> hardware will come close enough for everything the driver needs. If it
>> doesn't, I'll buy one of the books that some others kindly recommended
>> and do polynomial approximations.)
>
> On x86 (more specifically, on x87) if you can do it at all then you
> can do them all.

I'm not quite sure what that means.  It was pretty easy to code a log2()
function using the built-in opcode, but it took me nearly a day to code
an exp2() function.  The built-in f2xm1 opcode helps a lot but there's
no help for the other half exp2()'s lot.

I'm sure you and other x86 assembly experts can improve on this if
you ever have any need for it.  The only consolation I get is that
for some reason gcc does library calls for log10 and pow.  It would be
really trivial to inline log10, though maybe pow is too big to benefit
from inlining.

             reply	other threads:[~2004-06-02  6:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-02  5:52 ndiamond [this message]
2004-06-02 19:31 ` Valdis.Kletnieks
  -- strict thread matches above, loose matches on Subject: below --
2004-06-01  2:27 ndiamond
2004-06-01  0:38 ndiamond
2004-06-01 20:52 ` H. Peter Anvin
2004-05-31 20:38 Manfred Spraul
2004-05-31 21:11 ` Horst von Brand
2004-05-31  2:50 ndiamond
2004-05-31  4:02 ` Chris Friesen
2004-05-31  5:44 ` Ian Kent
2004-05-31  6:13   ` Peter Williams
2004-05-31 13:39   ` Horst von Brand
2004-05-31 20:12   ` Michal Jaegermann
2004-05-31 20:23     ` Hugo Mills
2004-05-31 22:43     ` Peter Williams
2004-05-31  1:52 ndiamond
2004-05-31  2:18 ` Måns Rullgård
2004-05-30 22:39   ` Calvin Spealman
2004-05-31  4:28   ` Linus Torvalds
2004-05-31  3:57     ` Calvin Spealman
2004-05-31  3:59 ` Matt Mackall
2004-05-31  4:11 ` Stephen Smoogen
2004-05-31 14:55 ` Scott Robert Ladd
2004-06-01  2:11 ` Richard B. Johnson

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=200406020552.i525qvk08725@mailout.despammed.com \
    --to=ndiamond@despammed.com \
    --cc=linux-kernel@vger.kernel.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®