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 WAA12068 for caml-red; Sun, 21 Jan 2001 22:21:08 +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 LAA32752 for ; Sun, 21 Jan 2001 11:37:09 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f0LAb7v22601; Sun, 21 Jan 2001 11:37:07 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA15359; Sun, 21 Jan 2001 11:37:07 +0100 (MET) Date: Sun, 21 Jan 2001 11:37:07 +0100 From: Xavier Leroy To: Norman Ramsey Cc: caml-list@inria.fr Subject: Re: unsigned comparisons on int32, int64, nativeint? Message-ID: <20010121113707.B13901@pauillac.inria.fr> References: <200101181740.MAA28644@labrador.eecs.harvard.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <200101181740.MAA28644@labrador.eecs.harvard.edu>; from nr@eecs.harvard.edu on Thu, Jan 18, 2001 at 12:40:36PM -0500 Sender: weis@pauillac.inria.fr > I have sought but not found unsigned comparisons on the integer types > int32, int64, and nativeint. I especially need `unsigned less than'. > Where might I find bindings for these operations? In a pinch, you can always use signed compares after shifting the arguments by min_int, e.g.: let ule_int32 a b = Int32.add a Int32.min_int <= Int32.add b Int32.min_int (I have a very strong feeling that it should work, but no doubt expert bit-twiddlers on this list will correct me if it doesn't.) The code generated for this is nowhere as efficient as a processor-native unsigned comparison, though. - Xavier Leroy