From patchwork Thu Feb 10 13:59:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 82606 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DDBA8B7107 for ; Fri, 11 Feb 2011 01:00:39 +1100 (EST) Received: from localhost ([127.0.0.1]:55024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnX4b-0007ae-Oh for incoming@patchwork.ozlabs.org; Thu, 10 Feb 2011 09:00:41 -0500 Received: from [140.186.70.92] (port=36122 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnX3o-0007aB-Q5 for qemu-devel@nongnu.org; Thu, 10 Feb 2011 08:59:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PnX3h-0007dr-9r for qemu-devel@nongnu.org; Thu, 10 Feb 2011 08:59:46 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:29721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PnX3h-0007bL-1r for qemu-devel@nongnu.org; Thu, 10 Feb 2011 08:59:45 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.69) (envelope-from ) id 1PnX3X-0002zJ-UO; Thu, 10 Feb 2011 13:59:35 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 10 Feb 2011 13:59:34 +0000 Message-Id: <1297346375-11461-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1297346375-11461-1-git-send-email-peter.maydell@linaro.org> References: <1297346375-11461-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: patches@linaro.org Subject: [Qemu-devel] [PATCH 1/2] softfloat: Fix compilation failures with USE_SOFTFLOAT_STRUCT_TYPES X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Make softfloat compile with USE_SOFTFLOAT_STRUCT_TYPES defined, by adding and using new macros const_float32() and const_float64() so you can use array initializers in an array of float32/float64 whether the types are bare or wrapped in the structs. Signed-off-by: Peter Maydell --- fpu/softfloat.c | 30 +++++++++++++++--------------- fpu/softfloat.h | 4 ++++ 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 17842f4..8de887d 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -2172,21 +2172,21 @@ float32 float32_sqrt( float32 a STATUS_PARAM ) static const float64 float32_exp2_coefficients[15] = { - make_float64( 0x3ff0000000000000ll ), /* 1 */ - make_float64( 0x3fe0000000000000ll ), /* 2 */ - make_float64( 0x3fc5555555555555ll ), /* 3 */ - make_float64( 0x3fa5555555555555ll ), /* 4 */ - make_float64( 0x3f81111111111111ll ), /* 5 */ - make_float64( 0x3f56c16c16c16c17ll ), /* 6 */ - make_float64( 0x3f2a01a01a01a01all ), /* 7 */ - make_float64( 0x3efa01a01a01a01all ), /* 8 */ - make_float64( 0x3ec71de3a556c734ll ), /* 9 */ - make_float64( 0x3e927e4fb7789f5cll ), /* 10 */ - make_float64( 0x3e5ae64567f544e4ll ), /* 11 */ - make_float64( 0x3e21eed8eff8d898ll ), /* 12 */ - make_float64( 0x3de6124613a86d09ll ), /* 13 */ - make_float64( 0x3da93974a8c07c9dll ), /* 14 */ - make_float64( 0x3d6ae7f3e733b81fll ), /* 15 */ + const_float64( 0x3ff0000000000000ll ), /* 1 */ + const_float64( 0x3fe0000000000000ll ), /* 2 */ + const_float64( 0x3fc5555555555555ll ), /* 3 */ + const_float64( 0x3fa5555555555555ll ), /* 4 */ + const_float64( 0x3f81111111111111ll ), /* 5 */ + const_float64( 0x3f56c16c16c16c17ll ), /* 6 */ + const_float64( 0x3f2a01a01a01a01all ), /* 7 */ + const_float64( 0x3efa01a01a01a01all ), /* 8 */ + const_float64( 0x3ec71de3a556c734ll ), /* 9 */ + const_float64( 0x3e927e4fb7789f5cll ), /* 10 */ + const_float64( 0x3e5ae64567f544e4ll ), /* 11 */ + const_float64( 0x3e21eed8eff8d898ll ), /* 12 */ + const_float64( 0x3de6124613a86d09ll ), /* 13 */ + const_float64( 0x3da93974a8c07c9dll ), /* 14 */ + const_float64( 0x3d6ae7f3e733b81fll ), /* 15 */ }; float32 float32_exp2( float32 a STATUS_PARAM ) diff --git a/fpu/softfloat.h b/fpu/softfloat.h index 4a5345c..aaf6afc 100644 --- a/fpu/softfloat.h +++ b/fpu/softfloat.h @@ -125,11 +125,13 @@ typedef struct { /* 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 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 const_float64(x) { x } #else typedef uint32_t float32; typedef uint64_t float64; @@ -137,6 +139,8 @@ typedef uint64_t float64; #define float64_val(x) (x) #define make_float32(x) (x) #define make_float64(x) (x) +#define const_float32(x) x +#define const_float64(x) x #endif #ifdef FLOATX80 typedef struct {