From patchwork Mon Jan 30 18:16:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 9545833 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1865C60417 for ; Mon, 30 Jan 2017 18:21:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1238026E97 for ; Mon, 30 Jan 2017 18:21:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0559327D85; Mon, 30 Jan 2017 18:21:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 96B2426E97 for ; Mon, 30 Jan 2017 18:21:25 +0000 (UTC) Received: from localhost ([::1]:34351 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYGZw-0005aP-5c for patchwork-qemu-devel@patchwork.kernel.org; Mon, 30 Jan 2017 13:21:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYGVh-0002je-M3 for qemu-devel@nongnu.org; Mon, 30 Jan 2017 13:17:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cYGVe-00024C-V7 for qemu-devel@nongnu.org; Mon, 30 Jan 2017 13:17:01 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:54916) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cYGVe-00023p-KI for qemu-devel@nongnu.org; Mon, 30 Jan 2017 13:16:58 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MbK2G-1copz027kK-00IjPe; Mon, 30 Jan 2017 19:16:38 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 30 Jan 2017 19:16:19 +0100 Message-Id: <20170130181634.13934-2-laurent@vivier.eu> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170130181634.13934-1-laurent@vivier.eu> References: <20170130181634.13934-1-laurent@vivier.eu> X-Provags-ID: V03:K0:gicFrtlPSbKtpryWi2gyw1gDRGV/AXJ8vfrQ0f1Ko2mxcYfszEU hw+d4R2aCoKHmGgMIvxntvC5Zt8ww0PEY8eMO1OJ8j6xH4rzLj2h2+6OhT9cJ8Z2NJrNksb fyn61pgcufxqMPj2zi8Jj1Avsy9JK7IcbA5XxWoV7za1usmUiyN3MVAt6rKmZX+ejYv6KE/ GcT1nLolGXO1gi9v3l0sg== X-UI-Out-Filterresults: notjunk:1; V01:K0:ZVQIkR/OqUI=:OpUjFD2CM1XoM3YorNUveB TK72tl7lUuC9b3h4nas4NNLkIGBGo+yl6G3ZOXP12Xiu1qbprhFMlSAox4C9VTNU9Xc/h7kBo ynWRODsb5YFibGXPNm+HhIaXVzACf9omTGQsR+vLtVtnPWW16fINQ87MZ1xW38Y3rRZbffO0m Nsb434m9FMyL3vUgCamLDco/Unsnb/QI4FpYsD/FrDMEoxyU8L/NGGPlC0Zb7Rhk5yRS79Nys Ww3WEfoTmCyIdWyuTJ0kubeT4dNSzbIiclJ1515CPYm/GskfQNCZ96hCPGEDfpcxY6utXa3/L gE2HXBENmL1+5D0Me8tlE7U5WkCIfp/wdwFpYokj9eN7egcBHtv3tYJpssL1y+NqQh9JUa+4Y GT2exDUh569BFkyS8rG5OzEfwHje0Uf7wBQLDmYR8glmI+R0f69p2l/VIRrPweFlY4wanvf6A /n8N7t6bWPuU18WsaKQTOs6MUdR5q+Jf4Dao0aAFFw8I8mxINLEyQZNHiK5Ihj/M3o7JbeyuA /lCU8XLFbZ0hgKh/KVLUNwOzy8dDU1+NNBeXC4TvHlqSIg4ySmcuF0bea3EqeiomcwL4/XkLt 97vQN7GSyI1zRJQcuFlh1jdq/REcpaptzlQV4kHmYFaPD+ixakgtj6+VEG7ZjQPDIJM4OXwXt szXYv5kjeNwPMDqQuyN3znktuMRar2PS9uiqUbBS8DCcQ7KNXYPoDMkA+6YkZPElYA0M= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.24 Subject: [Qemu-devel] [PATCH v2 01/16] softfloat: define 680x0 specific values X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Laurent Vivier --- fpu/softfloat-specialize.h | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/fpu/softfloat-specialize.h b/fpu/softfloat-specialize.h index f05c865..01b594f 100644 --- a/fpu/softfloat-specialize.h +++ b/fpu/softfloat-specialize.h @@ -111,7 +111,7 @@ float16 float16_default_nan(float_status *status) *----------------------------------------------------------------------------*/ float32 float32_default_nan(float_status *status) { -#if defined(TARGET_SPARC) +#if defined(TARGET_SPARC) || defined(TARGET_M68K) return const_float32(0x7FFFFFFF); #elif defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_ALPHA) || \ defined(TARGET_XTENSA) || defined(TARGET_S390X) || defined(TARGET_TRICORE) @@ -136,7 +136,7 @@ float32 float32_default_nan(float_status *status) *----------------------------------------------------------------------------*/ float64 float64_default_nan(float_status *status) { -#if defined(TARGET_SPARC) +#if defined(TARGET_SPARC) || defined(TARGET_M68K) return const_float64(LIT64(0x7FFFFFFFFFFFFFFF)); #elif defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_ALPHA) || \ defined(TARGET_S390X) @@ -162,7 +162,10 @@ float64 float64_default_nan(float_status *status) floatx80 floatx80_default_nan(float_status *status) { floatx80 r; - +#if defined(TARGET_M68K) + r.low = LIT64(0xFFFFFFFFFFFFFFFF); + r.high = 0x7FFF; +#else if (status->snan_bit_is_one) { r.low = LIT64(0xBFFFFFFFFFFFFFFF); r.high = 0x7FFF; @@ -170,6 +173,7 @@ floatx80 floatx80_default_nan(float_status *status) r.low = LIT64(0xC000000000000000); r.high = 0xFFFF; } +#endif return r; } @@ -502,6 +506,26 @@ static int pickNaN(flag aIsQNaN, flag aIsSNaN, flag bIsQNaN, flag bIsSNaN, return 1; } } +#elif defined(TARGET_M68K) +static int pickNaN(flag aIsQNaN, flag aIsSNaN, flag bIsQNaN, flag bIsSNaN, + flag aIsLargerSignificand) +{ + /* If either operand, but not both operands, of an operation is a + * nonsignaling NAN, then that NAN is returned as the result. If both + * operands are nonsignaling NANs, then the destination operand + * nonsignaling NAN is returned as the result. + */ + + if (aIsSNaN) { + return 0; + } else if (bIsSNaN) { + return 1; + } else if (bIsQNaN) { + return 1; + } else { + return 0; + } +} #else static int pickNaN(flag aIsQNaN, flag aIsSNaN, flag bIsQNaN, flag bIsSNaN, flag aIsLargerSignificand)