From patchwork Tue Aug 13 13:28:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 266799 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id C945F2C013A for ; Tue, 13 Aug 2013 23:28:52 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:in-reply-to:message-id:references :mime-version:content-type; q=dns; s=default; b=e2gS3kUSqhhivwU6 EW9AQMbBCL38STE9FslrpdrOcI2dtsKlZMz+SFwMwbzJjHTc6A/AXpfeXK7GHABw bUSPyCKzsKow3fy2h17KuWSX+tpw7lgDibmFn9OdHJJWaMElMBCBOE6pTIQDaXQH 4A5K/JFPtzwLzdDThCN4F/lTThY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:in-reply-to:message-id:references :mime-version:content-type; s=default; bh=yKbeeUuqdRwq0V1ZdxyGiQ bDdBk=; b=TxZ9BreqJF5JG7NM3Ca68WgWBZsbg6ZHpU9IkYqsjkGu+dKi9rdwNV WmerD6GzUbpqRAmjIxWVGMcXJMm1VdX/8Ru1ssYL2Sxo1Wi1FAL9GluOzb8w+5ZU wT+9NAOt5a0QXjKARKX4d/6v8+hGcvkRK10tn1ai6DlkDpNuawv+c= Received: (qmail 14991 invoked by alias); 13 Aug 2013 13:28:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 14976 invoked by uid 89); 13 Aug 2013 13:28:46 -0000 X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.2 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 13 Aug 2013 13:28:44 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1V9EeQ-0004zr-Ol from Maciej_Rozycki@mentor.com ; Tue, 13 Aug 2013 06:28:42 -0700 Received: from SVR-IES-FEM-02.mgc.mentorg.com ([137.202.0.106]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 13 Aug 2013 06:28:41 -0700 Received: from [172.30.64.154] (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.2.247.3; Tue, 13 Aug 2013 14:28:39 +0100 Date: Tue, 13 Aug 2013 14:28:34 +0100 From: "Maciej W. Rozycki" To: Richard Sandiford , Steve Ellcey CC: Subject: Re: MIPS tests (nan-legacy.c and nans-legacy.c) failing In-Reply-To: <87fvul5k37.fsf@talisman.default> Message-ID: References: <9f69a43f-c31f-4c49-aaa0-b022fd602f52@BAMAIL02.ba.imgtec.org> <87fvul5k37.fsf@talisman.default> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 On Wed, 7 Aug 2013, Richard Sandiford wrote: > > When I run two of your new tests in gcc.target/mips (nan-legacy.c and > > nans-legacy.c), they are failing because my GCC is putting out > > > > .word 4294967295 > > > > instead of > > > > .word -1 > > > > like the test is expecting. > > > > I believe they are equivalent (0xffffffff) but I am not sure what it > > is about my targets (mips-mti-elf and mips-mti-linux-gnu) that would > > make this different from yours. Should the tests be modified to allow > > either output? > > Maciej, have you had chance to look at this yet? I've had a look now and that is related to the width of `long' on the host -- encode_ieee_double returns its output 32-bit bit patterns in a buffer of signed longs. The arithmetic value of these patterns therefore depends on whether the width of `long' is 32 bits or wider. Here, in the case of nan-legacy.c, we have: image_hi <- 0x7ff7ffff image_lo <- 0xffffffff so the returned pair of long values will be: 2146959359, -1 on a host where the width of `long' is 32 bits and: 2146959359, 4294967295 on a host where the width of `long' is 64 bits. Then when supplied as the argument to the assembly-language .word pseudo-op, the two sets of values produce the same bit patterns in the object file produced. It's not clear to me if this dependency on the width of `long' is a bug or feature, but a path-of-least-resistance fix is as follows. This has passed mips-linux-gnu regression testing on a 32-bit host, but I can't regression-test a 64-bit host easily -- Steve, can you please verify that this change indeed works for you? Richard, OK to apply assuming that it does? 2013-08-13 Maciej W. Rozycki gcc/testsuite/ * gcc.target/mips/nan-legacy.c: Accept 4294967295 as an alternative to -1. * gcc.target/mips/nans-legacy.c: Likewise. Maciej gcc-mips-nan2008-test-fix.diff Index: gcc-fsf-trunk-quilt/gcc/testsuite/gcc.target/mips/nan-legacy.c =================================================================== --- gcc-fsf-trunk-quilt.orig/gcc/testsuite/gcc.target/mips/nan-legacy.c 2013-08-13 14:18:50.008738612 +0100 +++ gcc-fsf-trunk-quilt/gcc/testsuite/gcc.target/mips/nan-legacy.c 2013-08-13 14:22:49.568772451 +0100 @@ -4,4 +4,4 @@ double d = __builtin_nan (""); /* { dg-final { scan-assembler "\t\\.nan\tlegacy\n" } } */ -/* { dg-final { scan-assembler "\t\\.word\t2146959359\n\t\\.word\t-1\n" } } */ +/* { dg-final { scan-assembler "\t\\.word\t2146959359\n\t\\.word\t(?:-1|4294967295)\n" } } */ Index: gcc-fsf-trunk-quilt/gcc/testsuite/gcc.target/mips/nans-legacy.c =================================================================== --- gcc-fsf-trunk-quilt.orig/gcc/testsuite/gcc.target/mips/nans-legacy.c 2013-08-13 14:18:50.008738612 +0100 +++ gcc-fsf-trunk-quilt/gcc/testsuite/gcc.target/mips/nans-legacy.c 2013-08-13 14:22:49.568772451 +0100 @@ -4,4 +4,4 @@ double ds = __builtin_nans (""); /* { dg-final { scan-assembler "\t\\.nan\tlegacy\n" } } */ -/* { dg-final { scan-assembler "\t\\.word\t2147483647\n\t\\.word\t-1\n" } } */ +/* { dg-final { scan-assembler "\t\\.word\t2147483647\n\t\\.word\t(?:-1|4294967295)\n" } } */