From patchwork Wed Sep 20 13:18:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 816236 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 3xy1N90KdCz9s7h for ; Wed, 20 Sep 2017 23:50:33 +1000 (AEST) Received: from localhost ([::1]:48198 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dufOY-0005Qo-UM for incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 09:50:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dueuT-0005Jp-Ov for qemu-devel@nongnu.org; Wed, 20 Sep 2017 09:20:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duets-0002n1-BD for qemu-devel@nongnu.org; Wed, 20 Sep 2017 09:19:23 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:49902) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1duets-0002j9-2S for qemu-devel@nongnu.org; Wed, 20 Sep 2017 09:18:48 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0M4VfU-1dBdvS3cI0-00yeSX; Wed, 20 Sep 2017 15:18:27 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 20 Sep 2017 15:18:23 +0200 Message-Id: <20170920131823.16347-1-laurent@vivier.eu> X-Mailer: git-send-email 2.13.5 X-Provags-ID: V03:K0:LrJrG/UAtkuxAJ1madIulXBqRc+P3PldCgAt+5HknVJ8FWLEm0/ PfbhJABTz2A+3cNrkF1YB2ljFUMoH6itunXzA5V80yNeQj2sit4A1C80Jnn9OorRy7xYXAT J3BDssHQCd488FX2aWW8R1DqRCA3ECgcdYNgdIxGt6Ltul/7HDMQpNQukyrux/I0sCa2RUW Xhctegr9Yc7c3LTxgL+KA== X-UI-Out-Filterresults: notjunk:1; V01:K0:AtDr1ql0wKQ=:6b6Nf5yUxvpC8Qz9WZmcEk 5uGTQT13A0hNMh8/HXEp+GrYZeSck3I+DIb+vBueexNQ6OOtlv0vHHe8Lb1u97EyF5a4wgY+l jQAZ6sEuY5kg1+efNQbKDUN7nM8ySuDGFZqS+r23bJVWulBqCT9Y0piLL0jgoIAPoYQyz0EL/ g3dANjdGTxd1uGhkqDl9TPcgJl/yfdcPcYTB+hmUvUgd1mYAZ6BZqhOuww46hol0q1cU9atXO bG+wFYvlEv/1qlvWF99YmmHbGt/Mj68GeO7/GSjPqjRrf6hse7j9MUbVFVqUqCAhdzCXZxFBr TVjyIndBLIIxj9QDDZ/GuXIvWiOx3WmA26nco55lER8cFDki0YWbn47vIuMgnHLb1z6PE7n8k r2vGadHPDZoiX7d1UVVlJ7L/ll7qtrwmnYNxQgKry3bLSXXJmtvDMh9hNLK738/YFNNZqTdZt 7rcRQ4lH5PtWjdFFdCXaZgtUbtSn31MxK2meU546xCzG7PlUdNXKDCXkT8Mm5Gwl1KD1v5Omv z4ox6Wu8oYBQqGKJaLOUpcniRczUE9sdbm9fHNNokeDU3XkhwLN2nheDGwqRbNDMy9NbvfLeQ 1Y8kNKK486kfiWiYv4pDCG5eMCXvj6KF/7OWBUt4StV2gNG5USW1CTvmVmVXVz73x7eWsKCmW 9s8GldZBthb592/nE3uVbPC4qAfkgQJi3zmoWfbnqwvYPabsj0PwTMyhEUfKKDIjULGV3APg2 NuRknlYLtbuAR1k9ilBD5GB9VIsNxB1vSV8Ifg== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.134 Subject: [Qemu-devel] [PATCH v3] 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 , Richard Henderson , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" We already have const_float16(), const_float32() and const_float64(), so rename make_floatx80_init() and make_float128_init() to now be const_floatx80() and const_float128(), for consistency. Redefine make_float16(), make_float32() and make_float64() to be like make_floatx80() and make_float128(), by using a compound literal. Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- v3: update patch description v2: change float16(), make_float32() and make_float64() instead of make_floatx80() and make_float128() include/fpu/softfloat.h | 10 +++++----- target/m68k/fpu_helper.c | 44 ++++++++++++++++++++++---------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index 0f96a0edd1..cda6421b23 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -113,20 +113,20 @@ typedef struct { uint16_t v; } float16; #define float16_val(x) (((float16)(x)).v) -#define make_float16(x) __extension__ ({ float16 f16_val = {x}; f16_val; }) +#define make_float16(x) ((float16) { x }) #define const_float16(x) { x } typedef struct { uint32_t v; } float32; /* The cast ensures an error if the wrong type is passed. */ #define float32_val(x) (((float32)(x)).v) -#define make_float32(x) __extension__ ({ float32 f32_val = {x}; f32_val; }) +#define make_float32(x) ((float32) { x }) #define const_float32(x) { x } typedef struct { uint64_t v; } float64; #define float64_val(x) (((float64)(x)).v) -#define make_float64(x) __extension__ ({ float64 f64_val = {x}; f64_val; }) +#define make_float64(x) ((float64) { x }) #define const_float64(x) { x } #else typedef uint16_t float16; @@ -147,7 +147,7 @@ typedef struct { uint16_t high; } floatx80; #define make_floatx80(exp, mant) ((floatx80) { mant, exp }) -#define make_floatx80_init(exp, mant) { .low = mant, .high = exp } +#define const_floatx80(exp, mant) { .low = mant, .high = exp } typedef struct { #ifdef HOST_WORDS_BIGENDIAN uint64_t high, low; @@ -156,7 +156,7 @@ typedef struct { #endif } float128; #define make_float128(high_, low_) ((float128) { .high = high_, .low = low_ }) -#define make_float128_init(high_, low_) { .high = high_, .low = low_ } +#define const_float128(high_, low_) { .high = high_, .low = low_ } /*---------------------------------------------------------------------------- | 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 @@ */ static const floatx80 fpu_rom[128] = { - [0x00] = make_floatx80_init(0x4000, 0xc90fdaa22168c235ULL), /* Pi */ - [0x0b] = make_floatx80_init(0x3ffd, 0x9a209a84fbcff798ULL), /* Log10(2) */ - [0x0c] = make_floatx80_init(0x4000, 0xadf85458a2bb4a9aULL), /* e */ - [0x0d] = make_floatx80_init(0x3fff, 0xb8aa3b295c17f0bcULL), /* Log2(e) */ - [0x0e] = make_floatx80_init(0x3ffd, 0xde5bd8a937287195ULL), /* Log10(e) */ - [0x0f] = make_floatx80_init(0x0000, 0x0000000000000000ULL), /* Zero */ - [0x30] = make_floatx80_init(0x3ffe, 0xb17217f7d1cf79acULL), /* ln(2) */ - [0x31] = make_floatx80_init(0x4000, 0x935d8dddaaa8ac17ULL), /* ln(10) */ - [0x32] = make_floatx80_init(0x3fff, 0x8000000000000000ULL), /* 10^0 */ - [0x33] = make_floatx80_init(0x4002, 0xa000000000000000ULL), /* 10^1 */ - [0x34] = make_floatx80_init(0x4005, 0xc800000000000000ULL), /* 10^2 */ - [0x35] = make_floatx80_init(0x400c, 0x9c40000000000000ULL), /* 10^4 */ - [0x36] = make_floatx80_init(0x4019, 0xbebc200000000000ULL), /* 10^8 */ - [0x37] = make_floatx80_init(0x4034, 0x8e1bc9bf04000000ULL), /* 10^16 */ - [0x38] = make_floatx80_init(0x4069, 0x9dc5ada82b70b59eULL), /* 10^32 */ - [0x39] = make_floatx80_init(0x40d3, 0xc2781f49ffcfa6d5ULL), /* 10^64 */ - [0x3a] = make_floatx80_init(0x41a8, 0x93ba47c980e98ce0ULL), /* 10^128 */ - [0x3b] = make_floatx80_init(0x4351, 0xaa7eebfb9df9de8eULL), /* 10^256 */ - [0x3c] = make_floatx80_init(0x46a3, 0xe319a0aea60e91c7ULL), /* 10^512 */ - [0x3d] = make_floatx80_init(0x4d48, 0xc976758681750c17ULL), /* 10^1024 */ - [0x3e] = make_floatx80_init(0x5a92, 0x9e8b3b5dc53d5de5ULL), /* 10^2048 */ - [0x3f] = make_floatx80_init(0x7525, 0xc46052028a20979bULL), /* 10^4096 */ + [0x00] = const_floatx80(0x4000, 0xc90fdaa22168c235ULL), /* Pi */ + [0x0b] = const_floatx80(0x3ffd, 0x9a209a84fbcff798ULL), /* Log10(2) */ + [0x0c] = const_floatx80(0x4000, 0xadf85458a2bb4a9aULL), /* e */ + [0x0d] = const_floatx80(0x3fff, 0xb8aa3b295c17f0bcULL), /* Log2(e) */ + [0x0e] = const_floatx80(0x3ffd, 0xde5bd8a937287195ULL), /* Log10(e) */ + [0x0f] = const_floatx80(0x0000, 0x0000000000000000ULL), /* Zero */ + [0x30] = const_floatx80(0x3ffe, 0xb17217f7d1cf79acULL), /* ln(2) */ + [0x31] = const_floatx80(0x4000, 0x935d8dddaaa8ac17ULL), /* ln(10) */ + [0x32] = const_floatx80(0x3fff, 0x8000000000000000ULL), /* 10^0 */ + [0x33] = const_floatx80(0x4002, 0xa000000000000000ULL), /* 10^1 */ + [0x34] = const_floatx80(0x4005, 0xc800000000000000ULL), /* 10^2 */ + [0x35] = const_floatx80(0x400c, 0x9c40000000000000ULL), /* 10^4 */ + [0x36] = const_floatx80(0x4019, 0xbebc200000000000ULL), /* 10^8 */ + [0x37] = const_floatx80(0x4034, 0x8e1bc9bf04000000ULL), /* 10^16 */ + [0x38] = const_floatx80(0x4069, 0x9dc5ada82b70b59eULL), /* 10^32 */ + [0x39] = const_floatx80(0x40d3, 0xc2781f49ffcfa6d5ULL), /* 10^64 */ + [0x3a] = const_floatx80(0x41a8, 0x93ba47c980e98ce0ULL), /* 10^128 */ + [0x3b] = const_floatx80(0x4351, 0xaa7eebfb9df9de8eULL), /* 10^256 */ + [0x3c] = const_floatx80(0x46a3, 0xe319a0aea60e91c7ULL), /* 10^512 */ + [0x3d] = const_floatx80(0x4d48, 0xc976758681750c17ULL), /* 10^1024 */ + [0x3e] = const_floatx80(0x5a92, 0x9e8b3b5dc53d5de5ULL), /* 10^2048 */ + [0x3f] = const_floatx80(0x7525, 0xc46052028a20979bULL), /* 10^4096 */ }; int32_t HELPER(reds32)(CPUM68KState *env, FPReg *val)