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 KAA28711; Mon, 29 Jul 2002 10:13:59 +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 KAA28765 for ; Mon, 29 Jul 2002 10:13:58 +0200 (MET DST) Received: from mel-rto3.wanadoo.fr (smtp-out-3.wanadoo.fr [193.252.19.233]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g6T8Dv504549 for ; Mon, 29 Jul 2002 10:13:57 +0200 (MET DST) Received: from mel-rta7.wanadoo.fr (193.252.19.61) by mel-rto3.wanadoo.fr (6.5.007) id 3D1848E601175CA9; Mon, 29 Jul 2002 10:13:54 +0200 Received: from warp (217.128.142.232) by mel-rta7.wanadoo.fr (6.5.007) id 3D2A78FA008FA425; Mon, 29 Jul 2002 10:13:54 +0200 Message-ID: <008801c236d7$d285d550$0700a8c0@warp> From: "Nicolas Cannasse" To: "Pal-Kristian Engstad" , "Travis Bemann" Cc: References: <20020724094534.37196.qmail@web13303.mail.yahoo.com> Subject: Re: [Caml-list] Caml productivity. Date: Mon, 29 Jul 2002 10:13:24 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > I agree that the C interface is pretty nice. However, > how do would you use SIMD math instructions on the > x86? Would you always call C-routines just to make use > of SIMD or multimedia-instructions? What is the > overhead for calling a function that is executing a > few assembly instructions? Is it even possible to > create a solid division line between "low-level" and > "high-level" code? Yes it is. Actually if you need to perform alot of SIMD instructions each frame (involving zounds of C calls), you can try to group them in one-C-call that will do the job in one time. That's matter of architecture and choices... not always obvious :) > There's something to be said for premature > optimizations, but don't you think there's something > to be gained from having inline assembly in O'Caml? In > C++, one can create inline SIMD floating point vector > operations. A.I. and behaviour code constantly use 3D > math that would benefit from inline assembly. I don't think OCaml is the best language for that kind of things... If I remember my Pascal days, the compiler was so bad that i was used to write asm code directly in Pascal functions to perform all the 2DFx job :) And even if I enjoyed it because of the great perfs, it's not a good way of programming. If you're using OCaml as a top-level scripting langage, you have to put some barriers on what you can or can't do. Doing alot of "low-level" instructions needing SIMD optimizations is not the job of a scripting langage. So if you really need to do them, just move them into a C proc. OCaml code is actually only doing the following in my implementation : - moving the Camera - handling events ( network messages and user mouse/keyb ones ) - setting meshes current position and animation - same for sprites Nicolas Cannasse www.motion-twin.com ------------------- 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