From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA17859; Mon, 7 Jun 2004 21:22:05 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA18171 for ; Mon, 7 Jun 2004 21:22:04 +0200 (MET DST) Received: from outbound28-2.lax.untd.com (outbound28-2.lax.untd.com [64.136.28.160]) by nez-perce.inria.fr (8.12.10/8.12.10) with SMTP id i57JM2EV030352 for ; Mon, 7 Jun 2004 21:22:02 +0200 Received: from outbound28-2.lax.untd.com (smtp01.lax.untd.com [10.130.24.121]) by smtpout06.lax.untd.com with SMTP id AABANKSBYAR7TWJ2 for (sender ); Mon, 7 Jun 2004 12:21:26 -0700 (PDT) Received: (qmail 9271 invoked from network); 7 Jun 2004 19:20:52 -0000 Received: from 66-52-235-100.sttl.dial.netzero.com (HELO vangogh) (66.52.235.100) by smtp01.lax.untd.com with SMTP; 7 Jun 2004 19:20:52 -0000 From: "Brandon J. Van Every" To: "caml" Subject: RE: [Caml-list] 32 bit floats, SSE instructions Date: Mon, 7 Jun 2004 12:30:36 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Importance: Normal In-Reply-To: <20040607.185308.48335962.Christophe.Troestler@umh.ac.be> X-ContentStamp: 12:6:3807327495 X-UNTD-OriginStamp: CI84cOLHFqh7Zd2QWkwvEFvwyO3T/pIsPQZphDk9MRhHko5pA1cmHhQYqGV/aa58 X-Miltered: at nez-perce with ID 40C4C05A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; brandon:99 caml-list:01 floats:01 troestler:01 floats:01 repetitive:01 xyzw:01 vectors:01 slower:01 python:01 clue:01 brandon:99 seattle:99 2004:99 compiler:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Christophe TROESTLER wrote: > > If you need a selected number of routines using 32 bits floats, > implement them in C and interface them to OCaml. But this could be > slow depending of what you want to do -- i.e. maybe you want to use > OCaml for higher level stuff? Could you please provide more details ? A 3D graphics guy has to contend with a large number of numeric problems. Some of them are cut, dried, and repetitive enough to justify coding up a C routine for them. For example, transforming a large number of XYZW vectors by a 4x4 matrix is a 'pat' problem that occurs at some point in 3D graphics processing. However, lotsa 3D problems are exploratory in nature. For those you want to use an efficient high level language, i.e. OCaml. You'd like to code it up once, have it be pretty fast, and not ever worry about futzing with C <--> OCaml bureaucracy. There isn't necessarily an 'array version' of the problem, and you may not wish to figure it out in any event. C interfaces carry overhead, i.e. you'd rather have stuff go straight down to machine code without any function calls, if all you're doing is twiddling a few floats. Basically it's not an answer to say "Ah, yes, look at this great language OCaml!" when in practice all you're ever doing is writing C. I'm not exactly sure why language designers think 32 bit floats "don't count." Quite a number of high level languages make the choice of blowing them off. I guess quite a lot of high level languages aren't interested in widespread industrial application, just ease of compiler implementation. The reality is that 32 bit floats get used in the real world all over the place by 3D graphics guys. That has something to do with it being a core capability of many CPUs and an IEEE standard. 64 bit floats cost twice as much memory, are much slower for division and square rooting, and in many applications the extra precision is not needed. The last time I tried to talk about 32 bit floats with 'language guys' was the Python crowd. Generally speaking, that community doesn't have a clue about performance, and hasn't coughed up any significant 3D graphics work either. Cheers, www.indiegamedesign.com Brandon Van Every Seattle, WA "The pioneer is the one with the arrows in his back." - anonymous entrepreneur --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.693 / Virus Database: 454 - Release Date: 5/31/2004 ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners