From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG6b9-0002wF-T6 for qemu-devel@nongnu.org; Thu, 23 Jun 2016 11:31:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bG6b7-0000fl-Iq for qemu-devel@nongnu.org; Thu, 23 Jun 2016 11:31:18 -0400 Received: from mail-vk0-x235.google.com ([2607:f8b0:400c:c05::235]:35400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG6b6-0000em-CY for qemu-devel@nongnu.org; Thu, 23 Jun 2016 11:31:17 -0400 Received: by mail-vk0-x235.google.com with SMTP id j2so111419599vkg.2 for ; Thu, 23 Jun 2016 08:31:16 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1465552668-30084-2-git-send-email-aleksandar.markovic@rt-rk.com> References: <1465552668-30084-1-git-send-email-aleksandar.markovic@rt-rk.com> <1465552668-30084-2-git-send-email-aleksandar.markovic@rt-rk.com> From: Peter Maydell Date: Thu, 23 Jun 2016 16:30:55 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v9 01/10] softfloat: Implement run-time-configurable meaning of signaling NaN bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aleksandar Markovic Cc: QEMU Developers , qemu-arm , "qemu-ppc@nongnu.org" , maciej.rozycki@imgtec.com, Ethan Hunt , Bastian Koppelmann , Mark Cave-Ayland , Alexander Graf , Blue Swirl , Max Filippov , Paolo Bonzini , "Edgar E. Iglesias" , Guan Xuetao , Richard Henderson , Aurelien Jarno , Leon Alrae , Petar Jovanovic , Miodrag Dinic , Aleksandar Markovic On 10 June 2016 at 10:57, Aleksandar Markovic wrote: > From: Aleksandar Markovic > > This patch modifies SoftFloat library so that it can be configured in > run-time in relation to the meaning of signaling NaN bit, while, at the > same time, strictly preserving its behavior on all existing platforms. This doesn't compile: In file included from /home/petmay01/linaro/qemu-from-laptop/qemu/fpu/softfloat.c:106:0: /home/petmay01/linaro/qemu-from-laptop/qemu/fpu/softfloat-specialize.h: In function =E2=80=98commonNaNToFloat32=E2=80=99: /home/petmay01/linaro/qemu-from-laptop/qemu/fpu/softfloat-specialize.h:398:= 9: error: return makes integer from pointer without a cast [-Werror] return float32_default_nan; ^ In file included from /home/petmay01/linaro/qemu-from-laptop/qemu/fpu/softfloat.c:106:0: /home/petmay01/linaro/qemu-from-laptop/qemu/fpu/softfloat-specialize.h: In function =E2=80=98commonNaNToFloat64=E2=80=99: /home/petmay01/linaro/qemu-from-laptop/qemu/fpu/softfloat-specialize.h:816:= 9: error: return makes integer from pointer without a cast [-Werror] return float64_default_nan; ^ This is because a couple of changes currently in patch 2 should be in this patch: @@ -391,11 +391,12 @@ static float32 commonNaNToFloat32(commonNaNT a, float_status *status) return float32_default_nan(status); } - if ( mantissa ) + if (mantissa) { return make_float32( (((uint32_t)a.sign) << 31) | 0x7F800000 | (a.high >> 41)); - else - return float32_default_nan; + } else { + return float32_default_nan(status); + } } and @@ -807,13 +807,14 @@ static float64 commonNaNToFloat64(commonNaNT a, float_status *status) return float64_default_nan(status); } - if ( mantissa ) + if (mantissa) { return make_float64( (((uint64_t) a.sign) << 63) | LIT64(0x7FF0000000000000) | (a.high >> 12)); - else - return float64_default_nan; + } else { + return float64_default_nan(status); + } } Otherwise: Reviewed-by: Peter Maydell (As an aside, this patch reveals a bug in scripts/checkpatch.pl, which goes into an infinite loop if you try to run it on it.) thanks -- PMM