From patchwork Sun Dec 27 13:21:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 69833 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBRDJRcu013569 for ; Sun, 27 Dec 2009 13:19:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752029AbZL0NS7 (ORCPT ); Sun, 27 Dec 2009 08:18:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751986AbZL0NS7 (ORCPT ); Sun, 27 Dec 2009 08:18:59 -0500 Received: from mail-ew0-f219.google.com ([209.85.219.219]:40015 "EHLO mail-ew0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752018AbZL0NSz (ORCPT ); Sun, 27 Dec 2009 08:18:55 -0500 Received: by ewy19 with SMTP id 19so1142531ewy.21 for ; Sun, 27 Dec 2009 05:18:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=CaWtoKVDDi/TiBLeFV98o3gTkramgYv2BYBQdo/hyz8=; b=fo+fcIoho0Cn4Dtk3ko0K7E5E2Rvec2+PvI9J/XyMqvDa8pRRIswwyMrqPbMApa0Ym /GIbQSACNISFrPkSVnK5fGlC+u7u4t6vWM5FePEyUg3+BlrBwwoftChr+SWZfXOybtIk +IID6ho/SzY+tqi+lOSGx7krKBHJ1xH6gZ5yY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=kwIu1VHKG0F1m1XWaKdo0na59taKzp6kiP1GEFtXtM8SlEYybGOURaJ/xxQDAuP75J 3ZGGDeAcFnNCBDpnq9OMmPkixQ422DWU20JhYKwHAEGJG1c9SF4CDCYUI6dOPtAvq5Y7 lT72opuqklihcCoLlvSpcRd+Rnl85BPZOqHvo= Received: by 10.213.103.197 with SMTP id l5mr12633231ebo.11.1261919933355; Sun, 27 Dec 2009 05:18:53 -0800 (PST) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 24sm22407956eyx.14.2009.12.27.05.18.52 (version=SSLv3 cipher=RC4-MD5); Sun, 27 Dec 2009 05:18:52 -0800 (PST) Message-ID: <4B375F68.80301@gmail.com> Date: Sun, 27 Dec 2009 14:21:44 +0100 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Thunderbird/3.0 MIME-Version: 1.0 To: Kyle McMartin , Helge Deller , "James E.J. Bottomley" , linux-parisc@vger.kernel.org, Andrew Morton , LKML Subject: [PATCH] parisc: test off by one in sgl_frem() and dbl_frem() Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org diff --git a/arch/parisc/math-emu/dfrem.c b/arch/parisc/math-emu/dfrem.c index b983785..3283445 100644 --- a/arch/parisc/math-emu/dfrem.c +++ b/arch/parisc/math-emu/dfrem.c @@ -234,7 +234,7 @@ dbl_frem (dbl_floating_point * srcptr1, dbl_floating_point * srcptr2, Dbl_subtract(opnd1p1,opnd1p2,opnd2p1,opnd2p2,opnd1p1,opnd1p2); roundup = TRUE; } - if (stepcount > 0 || Dbl_iszero(opnd1p1,opnd1p2)) { + if (stepcount >= 0 || Dbl_iszero(opnd1p1,opnd1p2)) { /* division is exact, remainder is zero */ Dbl_setzero_exponentmantissa(resultp1,resultp2); Dbl_copytoptr(resultp1,resultp2,dstptr); diff --git a/arch/parisc/math-emu/sfrem.c b/arch/parisc/math-emu/sfrem.c index 3a1b7a3..ad87832 100644 --- a/arch/parisc/math-emu/sfrem.c +++ b/arch/parisc/math-emu/sfrem.c @@ -229,7 +229,7 @@ sgl_frem (sgl_floating_point * srcptr1, sgl_floating_point * srcptr2, Sgl_subtract(opnd1,opnd2,opnd1); roundup = TRUE; } - if (stepcount > 0 || Sgl_iszero(opnd1)) { + if (stepcount >= 0 || Sgl_iszero(opnd1)) { /* division is exact, remainder is zero */ Sgl_setzero_exponentmantissa(result); *dstptr = result;