From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA16578 for caml-red; Tue, 17 Oct 2000 17:50:19 +0200 (MET DST) 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 UAA00053 for ; Mon, 16 Oct 2000 20:25:24 +0200 (MET DST) Received: from mta6.snfc21.pbi.net (mta6.snfc21.pbi.net [206.13.28.240]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id e9GIPNf07335 for ; Mon, 16 Oct 2000 20:25:23 +0200 (MET DST) Received: from checkerlap.d6.com ([64.163.212.38]) by mta6.snfc21.pbi.net (Sun Internet Mail Server sims.3.5.2000.01.05.12.18.p9) with ESMTP id <0G2J00K5DC5WLH@mta6.snfc21.pbi.net> for caml-list@inria.fr; Mon, 16 Oct 2000 11:17:57 -0700 (PDT) Date: Mon, 16 Oct 2000 11:20:59 -0700 From: Chris Hecker Subject: single-precision floats, etc. X-Sender: def6@shell16.ba.best.com To: caml-list@inria.fr Message-id: <4.3.2.7.2.20001016110744.01e9d660@shell16.ba.best.com> MIME-version: 1.0 X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Content-type: text/plain; charset="us-ascii" Sender: weis@pauillac.inria.fr [je ne parle pas francais...I think that's how you say it! :)] Hi, I'm looking into the feasibility of using Caml for some high-performance numerically intensive video game stuff, and I had a couple questions: Most importantly, is there any way to make the "float" type compile to single precision floating point numbers? I looked briefly at the compiler source, but I didn't see the obvious "#define FLOAT_TYPE double" anywhere. All of the asm generators seem to have 8 byte floats hard coded in to them. The best thing would be to have a float32 built in type so I could still use doubles when necessary (rarely), but in lieu of that, just switching the float type to single precision when I compiled the compiler would be fine. Has anybody looked at doing this, and/or do the compiler authors have any idea how hard this would be? How hard-coded are doubles into the compiler? Another question, which is not as important, was the size limitation on arrays. The biggest float array one can have is around 699000 elements. That's pretty small on today's machines. I know there are bigarray packages, but from looking at the comments, it's unclear to me how well they're integrated. It also looks like the accessor functions, because they're external, would be function calls and not inlined, which would hurt any inner loop doing math on the array. Is the size limitation fixed, or is there any chance of increasing it? Finally, why aren't simple arrays of ints unboxed, like the arrays of floats? Would that be a hard change to make as well? Thanks for a cool language, and I hope I can use it for games, Chris