From owner-svn-src-stable-7@FreeBSD.ORG Sat Apr 21 06:59:49 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6843A106566C; Sat, 21 Apr 2012 06:59:49 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 398628FC08; Sat, 21 Apr 2012 06:59:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3L6xn6p076168; Sat, 21 Apr 2012 06:59:49 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3L6xnek076165; Sat, 21 Apr 2012 06:59:49 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201204210659.q3L6xnek076165@svn.freebsd.org> From: David Schultz Date: Sat, 21 Apr 2012 06:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234533 - stable/7/lib/msun/src X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2012 06:59:49 -0000 Author: das Date: Sat Apr 21 06:59:48 2012 New Revision: 234533 URL: http://svn.freebsd.org/changeset/base/234533 Log: MFC r233973 (partial): Fix bugs in remquo{,f}. Modified: stable/7/lib/msun/src/s_remquo.c stable/7/lib/msun/src/s_remquof.c Directory Properties: stable/7/lib/msun/ (props changed) Modified: stable/7/lib/msun/src/s_remquo.c ============================================================================== --- stable/7/lib/msun/src/s_remquo.c Sat Apr 21 06:29:44 2012 (r234532) +++ stable/7/lib/msun/src/s_remquo.c Sat Apr 21 06:59:48 2012 (r234533) @@ -49,7 +49,7 @@ remquo(double x, double y, int *quo) goto fixup; /* |x|<|y| return x or x-y */ } if(lx==ly) { - *quo = 1; + *quo = (sxy ? -1 : 1); return Zero[(u_int32_t)sx>>31]; /* |x|=|y| return x*0*/ } } @@ -112,6 +112,7 @@ remquo(double x, double y, int *quo) /* convert back to floating value and restore the sign */ if((hx|lx)==0) { /* return sign(x)*0 */ + q &= 0x7fffffff; *quo = (sxy ? -q : q); return Zero[(u_int32_t)sx>>31]; } @@ -127,9 +128,9 @@ remquo(double x, double y, int *quo) lx = (lx>>n)|((u_int32_t)hx<<(32-n)); hx >>= n; } else if (n<=31) { - lx = (hx<<(32-n))|(lx>>n); hx = sx; + lx = (hx<<(32-n))|(lx>>n); hx = 0; } else { - lx = hx>>(n-32); hx = sx; + lx = hx>>(n-32); hx = 0; } } fixup: Modified: stable/7/lib/msun/src/s_remquof.c ============================================================================== --- stable/7/lib/msun/src/s_remquof.c Sat Apr 21 06:29:44 2012 (r234532) +++ stable/7/lib/msun/src/s_remquof.c Sat Apr 21 06:59:48 2012 (r234533) @@ -46,7 +46,7 @@ remquof(float x, float y, int *quo) q = 0; goto fixup; /* |x|<|y| return x or x-y */ } else if(hx==hy) { - *quo = 1; + *quo = (sxy ? -1 : 1); return Zero[(u_int32_t)sx>>31]; /* |x|=|y| return x*0*/ } @@ -88,6 +88,7 @@ remquof(float x, float y, int *quo) /* convert back to floating value and restore the sign */ if(hx==0) { /* return sign(x)*0 */ + q &= 0x7fffffff; *quo = (sxy ? -q : q); return Zero[(u_int32_t)sx>>31]; }