From patchwork Mon Jan 30 18:16:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 721662 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 3vByVN5lBsz9sf9 for ; Tue, 31 Jan 2017 05:25:00 +1100 (AEDT) Received: from localhost ([::1]:34365 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYGdO-0000oG-8s for incoming@patchwork.ozlabs.org; Mon, 30 Jan 2017 13:24:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYGVr-0002ox-AO for qemu-devel@nongnu.org; Mon, 30 Jan 2017 13:17:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cYGVn-00026J-AE for qemu-devel@nongnu.org; Mon, 30 Jan 2017 13:17:11 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:56497) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cYGVm-00025u-Vh for qemu-devel@nongnu.org; Mon, 30 Jan 2017 13:17:07 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.183]) with ESMTPSA (Nemesis) id 0M1hZS-1cDr4f0IAM-00thae; Mon, 30 Jan 2017 19:16:39 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 30 Jan 2017 19:16:20 +0100 Message-Id: <20170130181634.13934-3-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:ZHxFHsEaMo2orMPvr4F5ezctJDB/b48os6fq1eoCnDY5NMeLn6c TPDUYAuDI9O6Z/opLHTIV+D53Yumn8sa0cBVAAFGnfEEFdPTuu0STRz7+5f+KOT67mAQ13w qEMX89QytkdNO0fVq//f7oG5B4C6NSui8EK4Gs20LM2U2elLlF3jhG4c7FFP8uuU7cv0bB1 SO8bP9l+zaqdqfs2zh/tQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:e2hc+UowReo=:5U/YInhg0gM4rd685ljI2l bEDMCgbly1oTlCWn827iiXjvxxqbVWTLAna8Vb7pmMS4voIRaLAWqPvPLFIF4oZi52yT8x7nW TeQqHkNi5k/RLrvuJ2JOpXY52b2iEPsYUPsZNLOzb9kcVc08l7MUtFtsVrFyZa2RVMnTxQ/WH T5imJ00eVbCpwIGjSB/25YkpZUi7uLk3wjLu0KWyCujhRm64g1p7Ym0z1bhrt0yyOkNb4EPx4 zHsqUMb20iZf9iAxdhB5Vc3leUcoOsH/V3yzrKQf3lIMXN1h39qsYsVCqLox3sL7hJpwjnO7O XvQ3Y2wsCeKIh0C0LD3BNhIRCVhd+S8FN+Y9oSRtz/jaKZCORmLQeaE5pD48XhhOLkh2g32QG wi3FzLdStCkA7xupCAKhG2YVPqkWG/MP9q+WSg8Jv7OnMtUwT+hqR2NFy2m9r4asAKo/YRjjN /VqBqNthlkgOqziAYzv+Ex251QOVDsh7qjl8w2dtsLHRk10/BZxb33pwRmUQ5ukhfEzelq9zn fIeobpcS3S3JUH/zDCjUMrowEn8b6NH/Nx2EBi8ZZRNiSR8AxcKxYifvi0CMQDB2ByjktlLoU 83lg4OzgadgnYaqf2ZzpnezsFukFdCTQ0VRSzX4xHTCDWWz1PAV+EheRZg1MABU35u72DKudi ShZAGhNB49B+CU87aFDwbpwyetFVjThL7J0eqyqlG5aGpxWu0ousOOlB+3jiOd2eA5vU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.73 Subject: [Qemu-devel] [PATCH v2 02/16] softloat: disable floatx80_invalid_encoding() for m68k 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" According to the comment, this definition of invalid encoding is given by intel developer's manual, and doesn't work with the behavior of 680x0 FPU. Signed-off-by: Laurent Vivier --- fpu/softfloat.c | 20 ++++++++++++++++++++ include/fpu/softfloat.h | 15 --------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index c295f31..3aa05c1 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -4799,6 +4799,26 @@ int float64_unordered_quiet(float64 a, float64 b, float_status *status) } /*---------------------------------------------------------------------------- +| Return whether the given value is an invalid floatx80 encoding. +| Invalid floatx80 encodings arise when the integer bit is not set, but +| the exponent is not zero. The only times the integer bit is permitted to +| be zero is in subnormal numbers and the value zero. +| This includes what the Intel software developer's manual calls pseudo-NaNs, +| pseudo-infinities and un-normal numbers. It does not include +| pseudo-denormals, which must still be correctly handled as inputs even +| if they are never generated as outputs. +*----------------------------------------------------------------------------*/ +static inline bool floatx80_invalid_encoding(floatx80 a) +{ +#if defined(TARGET_M68K) + return 0; +#else + return (a.low & (1ULL << 63)) == 0 && (a.high & 0x7FFF) != 0; +#endif +} + + +/*---------------------------------------------------------------------------- | Returns the result of converting the extended double-precision floating- | point value `a' to the 32-bit two's complement integer format. The | conversion is performed according to the IEC/IEEE Standard for Binary diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index 14f8383..1bde349 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -658,21 +658,6 @@ static inline int floatx80_is_any_nan(floatx80 a) return ((a.high & 0x7fff) == 0x7fff) && (a.low<<1); } -/*---------------------------------------------------------------------------- -| Return whether the given value is an invalid floatx80 encoding. -| Invalid floatx80 encodings arise when the integer bit is not set, but -| the exponent is not zero. The only times the integer bit is permitted to -| be zero is in subnormal numbers and the value zero. -| This includes what the Intel software developer's manual calls pseudo-NaNs, -| pseudo-infinities and un-normal numbers. It does not include -| pseudo-denormals, which must still be correctly handled as inputs even -| if they are never generated as outputs. -*----------------------------------------------------------------------------*/ -static inline bool floatx80_invalid_encoding(floatx80 a) -{ - return (a.low & (1ULL << 63)) == 0 && (a.high & 0x7FFF) != 0; -} - #define floatx80_zero make_floatx80(0x0000, 0x0000000000000000LL) #define floatx80_one make_floatx80(0x3fff, 0x8000000000000000LL) #define floatx80_ln2 make_floatx80(0x3ffe, 0xb17217f7d1cf79acLL)