From nobody Sat May 4 12:15:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505731680930249.76799376811778; Mon, 18 Sep 2017 03:48:00 -0700 (PDT) Received: from localhost ([::1]:35721 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dttap-0006Ky-Ty for importer@patchew.org; Mon, 18 Sep 2017 06:47:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dttZt-00060W-Ga for qemu-devel@nongnu.org; Mon, 18 Sep 2017 06:47:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dttZp-0008Tj-K8 for qemu-devel@nongnu.org; Mon, 18 Sep 2017 06:47:01 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:60474) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dttZp-0008T8-Ad for qemu-devel@nongnu.org; Mon, 18 Sep 2017 06:46:57 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LkG7v-1dHY1D1LHX-00cO2R; Mon, 18 Sep 2017 12:46:40 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 18 Sep 2017 12:46:24 +0200 Message-Id: <20170918104624.14743-1-laurent@vivier.eu> X-Mailer: git-send-email 2.13.5 X-Provags-ID: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org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.135 Subject: [Qemu-devel] [PATCH] softfloat: rename make_float[x80|128]_init to const_float[x80|128] 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: Peter Maydell , Laurent Vivier , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We already have const_float16(), const_float32() and const_float64(), so rename make_floatx80_init() and make_float128_init() as const_floatx80() and const_float128(). Redefine make_floatx80() and make_float128() as make_float16(), make_float32() and make_float64() using a variable and not only a cast. Signed-off-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/fpu/softfloat.h | 10 ++++++---- target/m68k/fpu_helper.c | 44 ++++++++++++++++++++++---------------------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index 0f96a0edd1..2e1a79ebf7 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -146,8 +146,9 @@ typedef struct { uint64_t low; uint16_t high; } floatx80; -#define make_floatx80(exp, mant) ((floatx80) { mant, exp }) -#define make_floatx80_init(exp, mant) { .low =3D mant, .high =3D exp } +#define make_floatx80(exp, mant) __extension__ \ + ({ floatx80 f80_val =3D { .low =3D mant, .high =3D exp }; f80_val; }) +#define const_floatx80(exp, mant) { .low =3D mant, .high =3D exp } typedef struct { #ifdef HOST_WORDS_BIGENDIAN uint64_t high, low; @@ -155,8 +156,9 @@ typedef struct { uint64_t low, high; #endif } float128; -#define make_float128(high_, low_) ((float128) { .high =3D high_, .low =3D= low_ }) -#define make_float128_init(high_, low_) { .high =3D high_, .low =3D low_ } +#define make_float128(high_, low_) __extension__ \ + ({float128 f128_val =3D { .high =3D high_, .low =3D low_ }; f128_val; = }) +#define const_float128(high_, low_) { .high =3D high_, .low =3D low_ } =20 /*------------------------------------------------------------------------= ---- | Software IEC/IEEE floating-point underflow tininess-detection mode. diff --git a/target/m68k/fpu_helper.c b/target/m68k/fpu_helper.c index 665e7609af..bf62cf8003 100644 --- a/target/m68k/fpu_helper.c +++ b/target/m68k/fpu_helper.c @@ -29,28 +29,28 @@ */ =20 static const floatx80 fpu_rom[128] =3D { - [0x00] =3D make_floatx80_init(0x4000, 0xc90fdaa22168c235ULL), /* Pi = */ - [0x0b] =3D make_floatx80_init(0x3ffd, 0x9a209a84fbcff798ULL), /* Log1= 0(2) */ - [0x0c] =3D make_floatx80_init(0x4000, 0xadf85458a2bb4a9aULL), /* e = */ - [0x0d] =3D make_floatx80_init(0x3fff, 0xb8aa3b295c17f0bcULL), /* Log2= (e) */ - [0x0e] =3D make_floatx80_init(0x3ffd, 0xde5bd8a937287195ULL), /* Log1= 0(e) */ - [0x0f] =3D make_floatx80_init(0x0000, 0x0000000000000000ULL), /* Zero= */ - [0x30] =3D make_floatx80_init(0x3ffe, 0xb17217f7d1cf79acULL), /* ln(2= ) */ - [0x31] =3D make_floatx80_init(0x4000, 0x935d8dddaaa8ac17ULL), /* ln(1= 0) */ - [0x32] =3D make_floatx80_init(0x3fff, 0x8000000000000000ULL), /* 10^0= */ - [0x33] =3D make_floatx80_init(0x4002, 0xa000000000000000ULL), /* 10^1= */ - [0x34] =3D make_floatx80_init(0x4005, 0xc800000000000000ULL), /* 10^2= */ - [0x35] =3D make_floatx80_init(0x400c, 0x9c40000000000000ULL), /* 10^4= */ - [0x36] =3D make_floatx80_init(0x4019, 0xbebc200000000000ULL), /* 10^8= */ - [0x37] =3D make_floatx80_init(0x4034, 0x8e1bc9bf04000000ULL), /* 10^1= 6 */ - [0x38] =3D make_floatx80_init(0x4069, 0x9dc5ada82b70b59eULL), /* 10^3= 2 */ - [0x39] =3D make_floatx80_init(0x40d3, 0xc2781f49ffcfa6d5ULL), /* 10^6= 4 */ - [0x3a] =3D make_floatx80_init(0x41a8, 0x93ba47c980e98ce0ULL), /* 10^1= 28 */ - [0x3b] =3D make_floatx80_init(0x4351, 0xaa7eebfb9df9de8eULL), /* 10^2= 56 */ - [0x3c] =3D make_floatx80_init(0x46a3, 0xe319a0aea60e91c7ULL), /* 10^5= 12 */ - [0x3d] =3D make_floatx80_init(0x4d48, 0xc976758681750c17ULL), /* 10^1= 024 */ - [0x3e] =3D make_floatx80_init(0x5a92, 0x9e8b3b5dc53d5de5ULL), /* 10^2= 048 */ - [0x3f] =3D make_floatx80_init(0x7525, 0xc46052028a20979bULL), /* 10^4= 096 */ + [0x00] =3D const_floatx80(0x4000, 0xc90fdaa22168c235ULL), /* Pi = */ + [0x0b] =3D const_floatx80(0x3ffd, 0x9a209a84fbcff798ULL), /* Log10(2)= */ + [0x0c] =3D const_floatx80(0x4000, 0xadf85458a2bb4a9aULL), /* e = */ + [0x0d] =3D const_floatx80(0x3fff, 0xb8aa3b295c17f0bcULL), /* Log2(e) = */ + [0x0e] =3D const_floatx80(0x3ffd, 0xde5bd8a937287195ULL), /* Log10(e)= */ + [0x0f] =3D const_floatx80(0x0000, 0x0000000000000000ULL), /* Zero = */ + [0x30] =3D const_floatx80(0x3ffe, 0xb17217f7d1cf79acULL), /* ln(2) = */ + [0x31] =3D const_floatx80(0x4000, 0x935d8dddaaa8ac17ULL), /* ln(10) = */ + [0x32] =3D const_floatx80(0x3fff, 0x8000000000000000ULL), /* 10^0 = */ + [0x33] =3D const_floatx80(0x4002, 0xa000000000000000ULL), /* 10^1 = */ + [0x34] =3D const_floatx80(0x4005, 0xc800000000000000ULL), /* 10^2 = */ + [0x35] =3D const_floatx80(0x400c, 0x9c40000000000000ULL), /* 10^4 = */ + [0x36] =3D const_floatx80(0x4019, 0xbebc200000000000ULL), /* 10^8 = */ + [0x37] =3D const_floatx80(0x4034, 0x8e1bc9bf04000000ULL), /* 10^16 = */ + [0x38] =3D const_floatx80(0x4069, 0x9dc5ada82b70b59eULL), /* 10^32 = */ + [0x39] =3D const_floatx80(0x40d3, 0xc2781f49ffcfa6d5ULL), /* 10^64 = */ + [0x3a] =3D const_floatx80(0x41a8, 0x93ba47c980e98ce0ULL), /* 10^128 = */ + [0x3b] =3D const_floatx80(0x4351, 0xaa7eebfb9df9de8eULL), /* 10^256 = */ + [0x3c] =3D const_floatx80(0x46a3, 0xe319a0aea60e91c7ULL), /* 10^512 = */ + [0x3d] =3D const_floatx80(0x4d48, 0xc976758681750c17ULL), /* 10^1024 = */ + [0x3e] =3D const_floatx80(0x5a92, 0x9e8b3b5dc53d5de5ULL), /* 10^2048 = */ + [0x3f] =3D const_floatx80(0x7525, 0xc46052028a20979bULL), /* 10^4096 = */ }; =20 int32_t HELPER(reds32)(CPUM68KState *env, FPReg *val) --=20 2.13.5