From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 9C813BC69 for ; Wed, 15 Aug 2007 08:59:48 +0200 (CEST) Received: from pih-relay04.plus.net (pih-relay04.plus.net [212.159.14.131]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7F6xmbX023067 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Wed, 15 Aug 2007 08:59:48 +0200 Received: from [80.229.56.224] (helo=beast.local) by pih-relay04.plus.net with esmtp (Exim) id 1ILCr5-0001No-Dv; Wed, 15 Aug 2007 07:59:47 +0100 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: Richard Jones Subject: Re: [Caml-list] Int32 and boxing Date: Wed, 15 Aug 2007 07:48:31 +0100 User-Agent: KMail/1.9.7 Cc: caml-list@yquem.inria.fr References: <200708130508.10023.jon@ffconsultancy.com> <20070813175501.GA24394@furbychan.cocan.org> In-Reply-To: <20070813175501.GA24394@furbychan.cocan.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708150748.32157.jon@ffconsultancy.com> X-Miltered: at discorde with ID 46C2A464.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; interfacing:01 compiler:01 run-time:01 unboxed:01 nativeint:01 ocaml:01 ocaml:01 frog:98 wrote:01 emit:01 caml-list:01 marshal:01 marshal:01 arithmetic:01 int:01 On Monday 13 August 2007 18:55:01 Richard Jones wrote: > I deal a lot with int32 and int64 types when interfacing with other > languages, so this causes an annoyance. I'm not sure what the > implications would be of having a different representation on 32 and > 64 bit machines. I guess Marshal would have to go through hoops for a > start. Now that I think about it in more detail, this would probably require deeper compiler changes than I had thought. You wouldn't need to alter the run-time but you'd need to emit different load and store code for unboxed float32s, tagging and untagging them, and do arithmetic in 32-bit registers. I'm not sure Marshal would need changing though. The representation would be embedded in nativeint so it would just be a type difference. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. OCaml for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists/?e