From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA13277 for caml-redistribution; Sun, 12 Dec 1999 23:08:15 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA25060 for ; Sat, 11 Dec 1999 16:31:42 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id QAA23266; Sat, 11 Dec 1999 16:31:37 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA18122; Sat, 11 Dec 1999 16:31:35 +0100 (MET) Message-ID: <19991211163135.00749@pauillac.inria.fr> Date: Sat, 11 Dec 1999 16:31:35 +0100 From: Xavier Leroy To: David McClain , caml-list@inria.fr Subject: Re: Plea for inline expansion of transcendentals. References: <000f01bf4246$81914b30$210148bf@dylan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1 In-Reply-To: <000f01bf4246$81914b30$210148bf@dylan>; from David McClain on Thu, Dec 09, 1999 at 06:08:34AM -0700 Sender: weis > Since I do a great deal of bluk math processing, it would sure be nice if > many of the simpler transcendental functions could be inlined by OCAMLOPT. > I'm speaking primarily of round_to_int, sin, cos, tan, asin, acos, atan, > atan2, log, exp, sqrt, etc. > Of course I am working on Pentium class machines which have these functions > available in hardware. Other arhitectures might not be so kind in this > regard... One difficulty with the FSIN, FCOS, etc, Pentium instructions is that they fail if the argument is greater than 2^64 (if I remember correctly). To produce a correct result in all cases, the error must be trapped and the operation retried after suitable normalization of the argument. This makes it difficult to inline those operations. (Note: I said "correct result", not "meaningful result". No one in their right minds would compute sin(2^64), but still we have to produce the same result as everyone else even in this case.) - Xavier Leroy