From: John Prevost <j.prevost@gmail.com>
To: "Will M. Farr" <farr@mit.edu>
Cc: caml-list@yquem.inria.fr, shootout-list@lists.alioth.debian.org
Subject: Re: [Caml-list] Ocaml sums the harmonic series -- four ways, four benchmarks: floating point performance
Date: Thu, 13 Jan 2005 15:24:19 -0500 [thread overview]
Message-ID: <d849ad2a050113122479b0f86c@mail.gmail.com> (raw)
In-Reply-To: <850815AC-6595-11D9-A551-000393A34E82@mit.edu>
There quite possibly is--I could look. But I do believe that the
Intel architecture is best optimized for at least some set of
operations. For example, looking through the assembly source, you'll
notice that it sometimes abuses Intel addressing modes to reduce the
cost of "Caml ints are just like native ints with a 1 in the low bit".
As for whether there's a quick "convert int to float" call in Intel, I
really have no idea. The assembly for the simple function:
let test x = float_of_int x
isn't trivial, however. I have to admit that I don't know the ins and
outs of Intel assembly any further than I have learned them while
trying to optimize specific O'Caml loops. And since I rarely use
floating point, all of these opcodes are greek to me. :) I *think*
it's allocating space in the heap for the float, then filling it in
with a non-normalized value (which is pretty easy, since doubles are
64 bits, and ints are 31 bits), and then saying "normalize this,
please." But I can't say for sure. And since I don't have a PPC
system to play with, I can't compare.
John.
next prev parent reply other threads:[~2005-01-13 20:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-13 15:53 Will M. Farr
2005-01-13 17:29 ` [Caml-list] " John Prevost
2005-01-13 19:01 ` Will M. Farr
2005-01-13 20:24 ` John Prevost [this message]
2005-01-13 20:50 ` Erik de Castro Lopo
2005-01-13 21:32 ` Erik de Castro Lopo
2005-01-15 11:55 ` Xavier Leroy
2005-01-15 15:49 ` Michal Moskal
2005-01-15 17:01 ` [Caml-list] [FP performance] Ocaml sums the harmonic series Christophe TROESTLER
2005-01-15 17:13 ` [Caml-list] Ocaml sums the harmonic series -- four ways, four benchmarks: floating point performance Yaron Minsky
2005-01-23 2:27 ` Oliver Bandel
2005-01-23 6:07 ` Will M. Farr
2005-01-23 15:18 ` Oliver Bandel
2005-01-16 9:57 Philippe Lelédy
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=d849ad2a050113122479b0f86c@mail.gmail.com \
--to=j.prevost@gmail.com \
--cc=caml-list@yquem.inria.fr \
--cc=farr@mit.edu \
--cc=shootout-list@lists.alioth.debian.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