From owner-svn-src-all@freebsd.org Tue Sep 3 14:06:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62E50DC397; Tue, 3 Sep 2019 14:06:07 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z300Wdz4PCh; Tue, 3 Sep 2019 14:06:07 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 169D01A143; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id AEF3310096; Wed, 3 Apr 2019 03:54:34 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31FF58EBC7; Wed, 3 Apr 2019 03:54:34 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1047C10061; Wed, 3 Apr 2019 03:54:34 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id B1DFF1005F for ; Wed, 3 Apr 2019 03:54:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 814B98EBC2; Wed, 3 Apr 2019 03:54:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A70D8474; Wed, 3 Apr 2019 03:54:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x333sVoa035042; Wed, 3 Apr 2019 03:54:31 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x333sVS1035041; Wed, 3 Apr 2019 03:54:31 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904030354.x333sVS1035041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345829 - head/sys/powerpc/fpu X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/fpu X-SVN-Commit-Revision: 345829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 31FF58EBC7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:29 -0000 X-Original-Date: Wed, 3 Apr 2019 03:54:31 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:29 -0000 Author: jhibbits Date: Wed Apr 3 03:54:30 2019 New Revision: 345829 URL: https://svnweb.freebsd.org/changeset/base/345829 Log: powerpc: Apply r178139 from sparc64 to powerpc's fpu_sqrt This fix was committed less than 2 months after the code was forked into the powerpc kernel. Though powerpc doesn't use quad-precision floating point, or need it for emulation, the changes do look like correctness fixes overall. This was found while trying to get fsqrt emulation working on e5500, which does have a real FPU, but lacks the fsqrt instruction. This is not the complete fix, the rest is to be committed separately. MFC after: 1 week Modified: head/sys/powerpc/fpu/fpu_sqrt.c Modified: head/sys/powerpc/fpu/fpu_sqrt.c ============================================================================== --- head/sys/powerpc/fpu/fpu_sqrt.c Wed Apr 3 03:50:16 2019 (r345828) +++ head/sys/powerpc/fpu/fpu_sqrt.c Wed Apr 3 03:54:30 2019 (r345829) @@ -353,7 +353,7 @@ fpu_sqrt(struct fpemu *fe) FPU_SUBC(d0, x0, t0); if ((int)d0 >= 0) { x0 = d0, x1 = d1, x2 = d2; - q |= bit; + q = bit; y1 |= 1; /* now t1, y1 are set in concrete */ } ODD_DOUBLE; @@ -385,12 +385,12 @@ fpu_sqrt(struct fpemu *fe) FPU_SUBCS(d2, x2, t2); FPU_SUBCS(d1, x1, t1); FPU_SUBC(d0, x0, t0); - ODD_DOUBLE; if ((int)d0 >= 0) { - x0 = d0, x1 = d1, x2 = d2; - q |= bit; + x0 = d0, x1 = d1, x2 = d2; x3 = d3; + q = bit; y2 |= 1; } + ODD_DOUBLE; while ((bit >>= 1) != 0) { EVEN_DOUBLE; t3 = y3 | bit; @@ -399,7 +399,7 @@ fpu_sqrt(struct fpemu *fe) FPU_SUBCS(d1, x1, t1); FPU_SUBC(d0, x0, t0); if ((int)d0 >= 0) { - x0 = d0, x1 = d1, x2 = d2; + x0 = d0, x1 = d1, x2 = d2; x3 = d3; q |= bit; y3 |= bit << 1; }