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.6 required=5.0 tests=NO_REAL_NAME autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 71933BBAF for ; Tue, 11 Aug 2009 18:39:08 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ak0BAEc7gUrUGyoFkWdsb2JhbACaTQEBAQEJCwoHEwO4UoQZBYIn X-IronPort-AV: E=Sophos;i="4.43,361,1246831200"; d="scan'208";a="31040379" Received: from smtp5-g21.free.fr ([212.27.42.5]) by mail2-smtp-roc.national.inria.fr with ESMTP; 11 Aug 2009 18:39:07 +0200 Received: from smtp5-g21.free.fr (localhost [127.0.0.1]) by smtp5-g21.free.fr (Postfix) with ESMTP id CB82BD4811A for ; Tue, 11 Aug 2009 18:39:02 +0200 (CEST) Received: from apc.happyleptic.org (happyleptic.org [82.67.194.89]) by smtp5-g21.free.fr (Postfix) with ESMTP id DCD8CD480ED for ; Tue, 11 Aug 2009 18:38:59 +0200 (CEST) Received: from fp-desktop.fr.evistel.com (ev [88.169.116.225]) by apc.happyleptic.org (Postfix) with ESMTP id 4A38E334EF; Tue, 11 Aug 2009 18:38:59 +0200 (CEST) Received: from ccellier by fp-desktop.fr.evistel.com with local (Exim 4.69) (envelope-from ) id 1MauNG-0000GI-DW; Tue, 11 Aug 2009 18:38:58 +0200 Date: Tue, 11 Aug 2009 18:38:58 +0200 From: rixed@happyleptic.org To: rixed@happyleptic.org Cc: caml-list@inria.fr Subject: Re: [Caml-list] Native compilation for today's MIPS Message-ID: <20090811163858.GA871@fp-desktop.fr.evistel.com> References: <20090810173413.GA7442@fp-desktop.fr.evistel.com> <20090810230804.GA23104@happyleptic.org> <20090811101100.GA3238@happyleptic.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090811101100.GA3238@happyleptic.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Spam: no; 0.00; compilation:01 mips:01 0200,:01 beq:01 beq:01 jal:01 addiu:01 bug:01 2009:98 stamps:98 033:98 equality:01 equality:01 inline:01 inline:01 First, correcting myself, since I managed to confuse true and false : -[ Tue, Aug 11, 2009 at 12:11:00PM +0200, rixed@happyleptic.org ]---- > 1004b670: 24010001 li at,1 ; a1 = true No, 1 is false. True would be 3. Thus : > 1004b674: 10410051 beq v0,at,1004b7bc <$173> ; cmp previous return value with true, and if so goto $173 where we left Of course, we break out of this sequence of "&&"s if the test is false. > 1004b6a4: 24010001 li at,1 ; true > 1004b6a8: 10410041 beq v0,at,1004b7b0 <$174> ; if both stamps are eq, goto $174 which is equivalent to $147. Same remark as above. > ; The end when dataUnchanged is true. We could have reused $174 or $173. > ; So each time you write a && b && c you end up with 3 different true(s) ? So here at the end, dataUnchanged is false. But this does change much to the problem. So, After this little training, deciphering the second code (the one whithout FPU code which happen to work) is a piece of cake. Basically, instead of the FP registers comparison we have this : 1004b718 <$180>: 1004b718: 8fa5000c lw a1,12(sp) ; a1 = [sp+12], aka t0 1004b71c: 3c18100c lui t8,0x100c ; t8 = 0x100c+2244 -> same C function than before (equality test) 1004b720: 0c033a9e jal 100cea78 ; call it... 1004b724: 271808c4 addiu t8,t8,2244 Ie the added function "is_same a b = a = b" had the (well known) consequence to replace the inline equality testing by the generic C version. So, the bug lies in the inline equality function for float values. Stay tunned ! :-)