From patchwork Thu Jun 15 08:17:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 776175 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wpGf42mKlz9s65 for ; Thu, 15 Jun 2017 18:20:28 +1000 (AEST) Received: from localhost ([::1]:52681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLQ0w-0002B0-0R for incoming@patchwork.ozlabs.org; Thu, 15 Jun 2017 04:20:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLPxw-0007uI-3d for qemu-devel@nongnu.org; Thu, 15 Jun 2017 04:17:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLPxs-0001uQ-4O for qemu-devel@nongnu.org; Thu, 15 Jun 2017 04:17:20 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:55846) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dLPxr-0001u2-Oi for qemu-devel@nongnu.org; Thu, 15 Jun 2017 04:17:16 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LrXFh-1dpVXr0JZd-013Jr7; Thu, 15 Jun 2017 10:17:14 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 15 Jun 2017 10:17:09 +0200 Message-Id: <20170615081711.25347-3-laurent@vivier.eu> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170615081711.25347-1-laurent@vivier.eu> References: <20170615081711.25347-1-laurent@vivier.eu> X-Provags-ID: V03:K0:OJ9anGXDC48hu6JLapSzWEB1HVHqbiECaJwjFOtYgA1VzYKtN9T 1KKE97sYfkiIm9rGVaHrfHIeIXD5TdjORF6Vu5jkt8YSfi/qlm+Ht2/SiP8/+6y4NhQqrHo KNzh1oYe0LiZ4VAe3jQNC0qT/N18q4E1htNgfEie/iDHtl9lmO5aINpjYtwowMJp4J8kGnT 2VgAlbdgj3Hz8j7CZ5MAQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:hX82YW4NEhE=:cha3T1LNl1hYvnCq389T7f tuL8wYoezTnjR8G/NkSRg4cVUvQlAKy9vkZsnR1PbLfH1S59/yFe/K3Nnj9A8Xl50ZHJqhGSC IHoyLSS/7use5kGmMzTY4RcXs/9ZjhrMjvLwMnnJOoMtj6bP442GBRtU4U8oBNjquqX/VFUh9 kG3kicKDsdnovNT26BRmCXcujHPNQfRXTYLh0jfRgc01g9yxW55/xIhj5uDDUMXHJ2p8+Wx7z t0wZzLsy4g2UNcYh220BwkubkqsbNEIpWi7rr5ODx9TA/t6y6byvOkYFEvoObTIQbDkK3lpgZ ZlMChzMVMl/vMWnx4Ob5EQ992oDYuDJntGA0WuPuMk1vtLVKFyH3nOY2zq14yhQdzNwwhbPRX Veh89wXoK8LYKb7Ut4CRc9yvm6QEGQsuCYzLZQAFpNK9sMqBRKbZ2BAQRS3x35Okncm/In5JL vLL4D7A3dAkcolIDxzViZRldhzwNrl5QdenYEX6CKy9NZGwDnDxioKVVNdLyVq7Ig+oShCyIZ qVvQRWN+UnUGw3E/3u6lP+2vKscEpEGCw2jRvY33EyUUG4F+EzcWoHEkD2u5ZFYUpgoqaOgeT RPwv2Do6/152mxY7T1iT9TeGl8e0aCDV51RbUlobVcc2/HCbfml8SRHpukmrjJ3L9JmtikQlW Zk75tua+dURH85BrDoicIrWVr7QzUNVTTZy2WVRmvlbX+iiLi9pK+4f/ie2NvxEfxePs= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.187 Subject: [Qemu-devel] [PULL 2/4] 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 Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson Message-Id: <20170611231633.32582-2-laurent@vivier.eu> --- fpu/softfloat-specialize.h | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/fpu/softfloat-specialize.h b/fpu/softfloat-specialize.h index 100c8a9..de2c5d5 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,30 @@ 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) +{ + /* M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL + * 3.4 FLOATING-POINT INSTRUCTION DETAILS + * 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 either operand to an operation is a signaling NaN (SNaN), then the + * SNaN bit is set in the FPSR EXC byte. If the SNaN exception enable bit + * is set in the FPCR ENABLE byte, then the exception is taken and the + * destination is not modified. If the SNaN exception enable bit is not + * set, setting the SNaN bit in the operand to a one converts the SNaN to + * a nonsignaling NaN. The operation then continues as described in the + * preceding paragraph for nonsignaling NaNs. + */ + if (aIsQNaN || aIsSNaN) { /* a is the destination operand */ + return 0; /* return the destination operand */ + } else { + return 1; /* return b */ + } +} #else static int pickNaN(flag aIsQNaN, flag aIsSNaN, flag bIsQNaN, flag bIsSNaN, flag aIsLargerSignificand)