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=1.7 required=5.0 tests=AWL,DNS_FROM_SECURITYSAGE, SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 0F1F6BBAF for ; Mon, 17 Nov 2008 13:23:38 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvgCALnwIEnAXQImgWdsb2JhbACTVgEBFiK5aoJ5 X-IronPort-AV: E=Sophos;i="4.33,618,1220220000"; d="scan'208";a="19251373" Received: from discorde.inria.fr ([192.93.2.38]) by mail3-smtp-sop.national.inria.fr with ESMTP; 17 Nov 2008 13:23:37 +0100 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id mAHCNaIE009642 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 17 Nov 2008 13:23:37 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvgCALnwIElQRFuwgWdsb2JhbACTVgEBFiK5aoJ5 X-IronPort-AV: E=Sophos;i="4.33,618,1220220000"; d="scan'208";a="31522709" Received: from furbychan.cocan.org ([80.68.91.176]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 17 Nov 2008 13:23:36 +0100 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1L238d-00065l-KJ for caml-list@inria.fr; Mon, 17 Nov 2008 12:23:31 +0000 Date: Mon, 17 Nov 2008 12:23:31 +0000 To: caml-list@inria.fr Subject: Another example (was: Re: [Caml-list] Is it a bug or just ordinary floating point differences?) Message-ID: <20081117122331.GB21299@annexia.org> References: <20081117102310.GA21299@annexia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081117102310.GA21299@annexia.org> User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Miltered: at discorde with ID 49216248.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bug:01 printf:01 printf:01 ocamlopt:01 ocamlopt:01 rounding:01 globl:01 wine:98 wine:98 compilers:01 caml-list:01 int:01 int:01 diff:02 data:02 ---------------------------------------------------------------------- open Printf ;; printf "%d\n" (int_of_float (62.05 *. 60.)) ;; let s = 62.05 *. 60. ;; printf "%d\n" (int_of_float s) ;; ---------------------------------------------------------------------- Ordinary ocamlopt prints: 3723 3723 The cross-compiler prints: 3722 3723 The generated assembly is again identical apart from differences which seem insignificant to me. Shown below is the diff between the ocamlopt 3.10.2 for Windows downloaded from caml.inria.fr, and my own cross-compiler (both running under Wine). I'm thinking the difference must be somewhere in Wine itself or in the way that the two compilers initialize the floating point environment, such as using different rounding modes. Does anyone have a true Windows version of 3.11.0 that they could check out the test programs on? Rich. --- test_float2-win-3.10.2.s 2008-11-17 12:13:26.000000000 +0000 +++ test_float2-crosswin-3.11.0.s 2008-11-17 12:14:09.000000000 +0000 @@ -26,7 +26,7 @@ subl $8, %esp L100: movl $_camlTest_float2__2, %eax - call _camlPrintf__printf_364 + call _camlPrintf__printf_403 L101: movl %eax, %ebx fldl L102 @@ -58,7 +58,7 @@ fstpl (%eax) movl %eax, _camlTest_float2 movl $_camlTest_float2__1, %eax - call _camlPrintf__printf_364 + call _camlPrintf__printf_403 L108: movl %eax, %ebx movl _camlTest_float2, %eax @@ -88,6 +88,7 @@ L103: .double 62.05 .data L102: .double 60. + .data .text .globl _camlTest_float2__code_end _camlTest_float2__code_end: -- Richard Jones Red Hat