From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102703 invoked by alias); 28 Apr 2016 14:12:09 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 102677 invoked by uid 89); 28 Apr 2016 14:12:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=predictable X-HELO: smtprelay.synopsys.com Received: from us01smtprelay-2.synopsys.com (HELO smtprelay.synopsys.com) (198.182.47.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 28 Apr 2016 14:11:58 +0000 Received: from us02secmta2.synopsys.com (us02secmta2.synopsys.com [10.12.235.98]) by smtprelay.synopsys.com (Postfix) with ESMTP id 5BE7C24E1700; Thu, 28 Apr 2016 07:11:54 -0700 (PDT) Received: from us02secmta2.internal.synopsys.com (us02secmta2.internal.synopsys.com [127.0.0.1]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id 3C47F55F14; Thu, 28 Apr 2016 07:11:54 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id 0838155F02; Thu, 28 Apr 2016 07:11:54 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id E915E7E5; Thu, 28 Apr 2016 07:11:53 -0700 (PDT) Received: from us01wehtc1.internal.synopsys.com (us01wehtc1-vip.internal.synopsys.com [10.12.239.236]) by mailhost.synopsys.com (Postfix) with ESMTP id B40EA7E3; Thu, 28 Apr 2016 07:11:53 -0700 (PDT) Received: from DE02WEHTCA.internal.synopsys.com (10.225.19.92) by us01wehtc1.internal.synopsys.com (10.12.239.235) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 28 Apr 2016 07:11:52 -0700 Received: from DE02WEMBXA.internal.synopsys.com ([fe80::a014:7216:77d:d55c]) by DE02WEHTCA.internal.synopsys.com ([::1]) with mapi id 14.03.0195.001; Thu, 28 Apr 2016 16:11:49 +0200 From: Claudiu Zissulescu To: Joern Wolfgang Rennecke , "gcc-patches@gcc.gnu.org" CC: "Francois.Bedard@synopsys.com" , "jeremy.bennett@embecosm.com" Subject: RE: [PATCH 4/6] [ARC] Handle FPX NaN within optimized floating point library. Date: Thu, 28 Apr 2016 14:12:00 -0000 Message-ID: <098ECE41A0A6114BB2A07F1EC238DE8966189F39@de02wembxa.internal.synopsys.com> References: <1460990028-5718-1-git-send-email-claziss@synopsys.com> <1460990028-5718-5-git-send-email-claziss@synopsys.com> <5721F3A5.6000404@amylaar.uk> <098ECE41A0A6114BB2A07F1EC238DE8966189EBB@de02wembxa.internal.synopsys.com> <5721F6E2.6060507@amylaar.uk> In-Reply-To: <5721F6E2.6060507@amylaar.uk> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2016-04/txt/msg01837.txt.bz2 Hi, > Where exactly does the test go wrong? The test which fails is this one:=20 TEST_EQ (double, __DBL_MAX__, __DBL_MAX__, 1); =46rom the test file included in the patch. > Can you show a trace of __eqdf2 with register values? Sure thing, running for ARC700, using original implementation and enabled g= uarded code for FPX handling: [0x000002a2] 0xc000 K Z ld_s r0,[sp,0x0] : lw = [0x5000c0c0] =3D> 0xffffffff : (w1) r0 <=3D 0xffffffff * [0x000002a4] 0xc101 K Z ld_s r1,[sp,0x4] : lw = [0x5000c0c4] =3D> 0x7fefffff : (w1) r1 <=3D 0x7fefffff * [0x000002a6] 0xc202 K Z ld_s r2,[sp,0x8] : lw = [0x5000c0c8] =3D> 0xffffffff : (w1) r2 <=3D 0xffffffff * [0x000002a8] 0xc303 K Z ld_s r3,[sp,0xc] : lw = [0x5000c0cc] =3D> 0x7fefffff : (w1) r3 <=3D 0x7fefffff * [0x000002aa] 0x0aea0000 K Z bl 0x2e8 : (w0) r31 = <=3D 0x000002ae * [0x00000590] 0x091d00e1 K Z brne.d r1,r3,0x1c [0x00000594] 0x2153050c K Z bmsk r12,r1,0x14 : (w0= ) r12 <=3D 0x000fffff * [0x00000598] 0x200580be K Z or.f 0,r0,r2 * [0x0000059c] 0x24cf1562 K N bset.ne r12,r12,0x15 : (w= 0) r12 <=3D 0x002fffff * [0x000005a0] 0x2414904c K N add1.f r12,r12,r1 : (w0)= r12 <=3D 0x000ffffd * [0x000005a4] 0x7fe0 K C j_s.d [blink] * [0x000005a6] 0x20cc8086 KD C cmp.cc r0,r2 =20 For reference, the routine: .global __eqdf2 .balign 4 HIDDEN_FUNC(__eqdf2) /* Good performance as long as the difference in high word is well predictable (as seen from the branch predictor). */ __eqdf2: brne.d DBL0H,DBL1H,.Lhighdiff bmsk r12,DBL0H,20 #ifndef __HS__ /* The next two instructions are required to recognize the FPX NaN, which has a pattern like this: 0x7ff0_0000_8000_0000, as oposite to 0x7ff8_0000_0000_0000. */ or.f 0,DBL0L,DBL1L bset.ne r12,r12,21 #endif /* __HS__ */ add1.f r12,r12,DBL0H /* set c iff NaN; also, clear z if NaN. */ j_s.d [blink] cmp.cc DBL0L,DBL1L .balign 4 .Lhighdiff: or r12,DBL0H,DBL1H or.f 0,DBL0L,DBL1L j_s.d [blink] bmsk.eq.f r12,r12,30 ENDFUNC(__eqdf2) All those results were collected using nsimfree. Please let me know if you need more info, Claudiu