From patchwork Thu Feb 27 02:54:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joey Ye X-Patchwork-Id: 25438 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AFA9520558 for ; Thu, 27 Feb 2014 02:54:57 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id p10sf4146260pdj.3 for ; Wed, 26 Feb 2014 18:54:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-subscribe:list-archive:list-post:list-help :sender:delivered-to:from:to:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:content-type; bh=jvJy+8y1dYp5ZdRbSzE7zOHD/bG5Jw5whol97gQFFHA=; b=gLH30YKvRx8M0D7uGAYpTGDnSWcDgo3sg2hB/p2SyxuGiVcyRc9xvw3wtWmfjyRiyA sblWpz2ftzYz3KX1ECZfZQpLaByFjO6n3Zx3PYD1OtcI8GU5+v8A5drV+l1XnAU6uV5X Nn8EMFCvD53s4Ih+PAqX2/P9Qdy/tyiXCCklpiMdi4BSkRITcg9r1JApN0SE6xthdc1f eLYZZ+XNcqDY84HLB+AER7BNOZmz5G2mc8pBi9cl53coFvoFSdR/TgpoFsruMCsLje0S v3euGwDHvS+LGxv0Nl8hSLUyf00MdQwhwM+zuuLZb0qbahhYYHtGf9y2V+LEBB0GMBqb H/ZQ== X-Gm-Message-State: ALoCoQl3FnJd1NmNunZ8xwdl/YtEFJTGtoebq+HJLwTDwpeAh7an4JVJNNjXC321xExQs8dwZ7jn X-Received: by 10.66.26.146 with SMTP id l18mr4752789pag.2.1393469696894; Wed, 26 Feb 2014 18:54:56 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.101.70 with SMTP id t64ls490890qge.1.gmail; Wed, 26 Feb 2014 18:54:56 -0800 (PST) X-Received: by 10.58.69.111 with SMTP id d15mr8549063veu.3.1393469696729; Wed, 26 Feb 2014 18:54:56 -0800 (PST) Received: from mail-vc0-x22c.google.com (mail-vc0-x22c.google.com [2607:f8b0:400c:c03::22c]) by mx.google.com with ESMTPS id cz20si771324veb.15.2014.02.26.18.54.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Feb 2014 18:54:56 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:400c:c03::22c is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c03::22c; Received: by mail-vc0-f172.google.com with SMTP id lf12so1915294vcb.3 for ; Wed, 26 Feb 2014 18:54:56 -0800 (PST) X-Received: by 10.220.191.134 with SMTP id dm6mr8740064vcb.16.1393469696066; Wed, 26 Feb 2014 18:54:56 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp71715vcz; Wed, 26 Feb 2014 18:54:55 -0800 (PST) X-Received: by 10.66.252.135 with SMTP id zs7mr12750818pac.13.1393469694948; Wed, 26 Feb 2014 18:54:54 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 5si2892750pbk.61.2014.02.26.18.54.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Feb 2014 18:54:54 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-47654-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 16346 invoked by alias); 27 Feb 2014 02:54:44 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list List-Id: List-Unsubscribe: , List-Subscribe: List-Archive: List-Post: , List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 16330 invoked by uid 89); 27 Feb 2014 02:54:41 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com From: "Joey Ye" To: Subject: [PATCH] Fix ARM NAN fraction bits Date: Thu, 27 Feb 2014 10:54:40 +0800 Message-ID: <000b01cf3367$439c5280$cad4f780$@arm.com> MIME-Version: 1.0 X-MC-Unique: 114022702543800201 X-Original-Sender: joey.ye@arm.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c03::22c is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 Current ARM soft-float implementation is violating the RTABI (http://infocenter.arm.com/help/topic/com.arm.doc.ihi0043d/IHI0043D_rtabi.pd f) Section 4.1.1.1: When not otherwise specified by IEEE 754, the result on an invalid operation should be the quiet NaN bit pattern with only the most significant bit of the significand set, and all other significand bits zero. This patch fixes it by setting _FP_NANFRAC_* to zero. Ran make check test with –mfloat-abi=soft. No regression. OK to checkin? 2014-02-27  Joey Ye  * sysdeps/arm/soft-fp/sfp-machine.h   (_FP_NANFRAC_S, _FP_NANFRAC_D, _FP_NANFRAC_Q):   Set to zero. diff --git a/sysdeps/arm/soft-fp/sfp-machine.h b/sysdeps/arm/soft-fp/sfp-machine.h index 52a08b5..32697fe 100644 --- a/sysdeps/arm/soft-fp/sfp-machine.h +++ b/sysdeps/arm/soft-fp/sfp-machine.h @@ -21,9 +21,9 @@ #define _FP_DIV_MEAT_D(R,X,Y)          _FP_DIV_MEAT_2_udiv(D,R,X,Y) #define _FP_DIV_MEAT_Q(R,X,Y)          _FP_DIV_MEAT_4_udiv(Q,R,X,Y) -#define _FP_NANFRAC_S                          ((_FP_QNANBIT_S << 1) - 1) -#define _FP_NANFRAC_D                         ((_FP_QNANBIT_D << 1) - 1), -1 -#define _FP_NANFRAC_Q                         ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1 +#define _FP_NANFRAC_S                         0 +#define _FP_NANFRAC_D                        0, 0 +#define _FP_NANFRAC_Q                        0, 0, 0, 0 #define _FP_NANSIGN_S                           0 #define _FP_NANSIGN_D                          0 #define _FP_NANSIGN_Q                          0