From owner-svn-src-head@freebsd.org Tue Jul 24 22:04:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72B681057754; Tue, 24 Jul 2018 22:04:57 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2622E822B8; Tue, 24 Jul 2018 22:04:57 +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 06CA511831; Tue, 24 Jul 2018 22:04:57 +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 w6OM4ulX006264; Tue, 24 Jul 2018 22:04:56 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6OM4uxL006261; Tue, 24 Jul 2018 22:04:56 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201807242204.w6OM4uxL006261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 24 Jul 2018 22:04:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336688 - in head: lib/libc/powerpcspe/gen sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head: lib/libc/powerpcspe/gen sys/powerpc/include X-SVN-Commit-Revision: 336688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2018 22:04:57 -0000 Author: jhibbits Date: Tue Jul 24 22:04:56 2018 New Revision: 336688 URL: https://svnweb.freebsd.org/changeset/base/336688 Log: Fix floating point exception definitions for powerpcspe These were incorrectly implemented in the original port. Modified: head/lib/libc/powerpcspe/gen/fpgetmask.c head/lib/libc/powerpcspe/gen/fpsetmask.c head/sys/powerpc/include/ieeefp.h Modified: head/lib/libc/powerpcspe/gen/fpgetmask.c ============================================================================== --- head/lib/libc/powerpcspe/gen/fpgetmask.c Tue Jul 24 21:10:17 2018 (r336687) +++ head/lib/libc/powerpcspe/gen/fpgetmask.c Tue Jul 24 22:04:56 2018 (r336688) @@ -44,6 +44,6 @@ fpgetmask() uint32_t fpscr; __asm__ __volatile("mfspr %0, %1" : "=r"(fpscr) : "K"(SPR_SPEFSCR)); - return ((fp_except_t)((fpscr >> 3) & 0x1f)); + return ((fp_except_t)((fpscr >> 2) & 0x1f)); } #endif Modified: head/lib/libc/powerpcspe/gen/fpsetmask.c ============================================================================== --- head/lib/libc/powerpcspe/gen/fpsetmask.c Tue Jul 24 21:10:17 2018 (r336687) +++ head/lib/libc/powerpcspe/gen/fpsetmask.c Tue Jul 24 22:04:56 2018 (r336688) @@ -45,8 +45,8 @@ fpsetmask(fp_except_t mask) fp_rnd_t old; __asm__ __volatile("mfspr %0, %1" : "=r"(fpscr) : "K"(SPR_SPEFSCR)); - old = (fp_rnd_t)((fpscr >> 3) & 0x1f); - fpscr = (fpscr & 0xffffff07) | (mask << 3); + old = (fp_rnd_t)((fpscr >> 2) & 0x1f); + fpscr = (fpscr & 0xffffff83) | (mask << 2); __asm__ __volatile("mtspr %1,%0" :: "r"(fpscr), "K"(SPR_SPEFSCR)); return (old); } Modified: head/sys/powerpc/include/ieeefp.h ============================================================================== --- head/sys/powerpc/include/ieeefp.h Tue Jul 24 21:10:17 2018 (r336687) +++ head/sys/powerpc/include/ieeefp.h Tue Jul 24 22:04:56 2018 (r336688) @@ -11,11 +11,19 @@ /* Deprecated historical FPU control interface */ typedef int fp_except_t; +#ifdef __SPE__ +#define FP_X_OFL 0x01 /* overflow exception */ +#define FP_X_UFL 0x02 /* underflow exception */ +#define FP_X_DZ 0x04 /* divide-by-zero exception */ +#define FP_X_INV 0x08 /* invalid operation exception */ +#define FP_X_IMP 0x10 /* imprecise (loss of precision) */ +#else #define FP_X_IMP 0x01 /* imprecise (loss of precision) */ #define FP_X_DZ 0x02 /* divide-by-zero exception */ #define FP_X_UFL 0x04 /* underflow exception */ #define FP_X_OFL 0x08 /* overflow exception */ #define FP_X_INV 0x10 /* invalid operation exception */ +#endif typedef enum { FP_RN=0, /* round to nearest representable number */