From nobody Sat May 4 00:22:26 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 1522170419497361.8046332375616; Tue, 27 Mar 2018 10:06:59 -0700 (PDT) Received: from localhost ([::1]:35345 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0s3m-0002NP-Js for importer@patchew.org; Tue, 27 Mar 2018 13:06:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0s2K-0001iX-Fz for qemu-devel@nongnu.org; Tue, 27 Mar 2018 13:05:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0s2G-0005IO-0M for qemu-devel@nongnu.org; Tue, 27 Mar 2018 13:05:28 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:43365) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f0s2F-0005I5-NN for qemu-devel@nongnu.org; Tue, 27 Mar 2018 13:05:23 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 1CEA72108D; Tue, 27 Mar 2018 13:05:23 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 27 Mar 2018 13:05:23 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id AD4E4E4488; Tue, 27 Mar 2018 13:05:22 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=zgac9T9Soers9p2YdcehznU5sq W6LFwzLoLTZrxf/nY=; b=BZGFapfXuyXCebayvWxrbaE4dRM1lA/mYW7hjgFQQk e8G61KbXS15v3EUfjNvei6uKUhtuSW185TQ8Y470qFgeGBh//T0sH0cGi0YVnYFx tSCkdY+dV6veVJO/5CMuxSnl+0296YSxJYE3A/+SkXVb0FrJ36cL8TQS8uz8tdBh s= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=zgac9T 9Soers9p2YdcehznU5sqW6LFwzLoLTZrxf/nY=; b=HYK+ioT+o1Fufxbd4rx/Ei 0c411n8lIEexbXjpdIdmbTAFjF2zzNSWz366n47PAmKEopiB1KXsFoQ/UBWlNRRY 7aHtR0PiPq114L3/1V/GL779Owjjdz8XbjrLuNdoSiF3EsbkCvfHEKMKLs6fSuHD wyAASXNOItikfPRpFYWzGlcDvQjDkwDGyPxFuGAeu2FOnEEu1XXLiGDBKVuNnhOu fhaVbWGvfXmyaFr5bAjhrbu0yKwumzMqteqlh+Hucz9r7NZnk7UB4Y8BzTbrqWwT eTu3XL3Z+hFXSZtZ8bBKVG1Atb0ir7o42yvUb4PkLiuHKSO6XgIPa5mYqNg/uzxQ == X-ME-Sender: Date: Tue, 27 Mar 2018 13:05:22 -0400 From: "Emilio G. Cota" To: Bastian Koppelmann Message-ID: <20180327170522.GA2693@flamenco> References: <1522128840-498-1-git-send-email-cota@braap.org> <1d2cdc9d-38f4-2274-8981-da47822ca569@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.29 Subject: [Qemu-devel] [PATCH] softfloat: rename canonicalize to sf_canonicalize 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 , Mark Cave-Ayland , Richard Henderson , qemu-devel@nongnu.org, Laurent Vivier , Paolo Bonzini , Alex =?iso-8859-1?Q?Benn=E9e?= , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 On Tue, Mar 27, 2018 at 12:06:58 +0200, Bastian Koppelmann wrote: > On 03/27/2018 11:56 AM, Bastian Koppelmann wrote: > > When I try to build your tree with gcc version 7.3.1 20180312 (GCC), I = get: > >=20 > > CC tricore-softmmu/fpu/softfloat.o > > /home/kbastian/coding/upstream-qemu/qemu-fpu/fpu/softfloat.c:417:19: > > error: conflicting types for =E2=80=98canonicalize=E2=80=99 > > static FloatParts canonicalize(FloatParts part, const FloatFmt *parm, > > ^~~~~~~~~~~~ > > In file included from /usr/include/features.h:423:0, > > from /usr/include/bits/libc-header-start.h:33, > > from /usr/include/math.h:27, > > from > > /home/kbastian/coding/upstream-qemu/qemu-fpu/fpu/softfloat.c:85: > > /usr/include/bits/mathcalls.h:385:1: note: previous declaration of > > =E2=80=98canonicalize=E2=80=99 was here > > __MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *_= _x)); > >=20 >=20 > git bisect points to fb1514a0104df6740e4a60c1b08b5daf173f9737 >=20 > Author: Emilio G. Cota > Date: Sat Mar 17 02:13:59 2018 -0400 >=20 > fpu: introduce hardfloat Thanks for pointing this out. Turns our glibc >=3D 2.25 defines canonicalize(), so when including math.h we clash with theirs. > commit eaf5ad0bc4a67bf40999e22db6f583ebc3a806ba > Author: Joseph Myers > Date: Wed Oct 26 23:14:31 2016 +0000 >=20 > Add canonicalize, canonicalizef, canonicalizel. > =20 > TS 18661-1 defines canonicalize functions to produce a canonical > version of a floating-point representation. This patch implements > these functions for glibc. In v3 I'll rename our canonicalize() to sf_canonicalize(); patch appended (you can apply this message as a patch with git am --scissors). The patch should go before the one that includes math.h, i.e. "fpu: introduce hardfloat". Thanks, Emilio --- 8< --- glibc >=3D 2.25 defines canonicalize in commit eaf5ad0 (Add canonicalize, canonicalizef, canonicalizel., 2016-10-26). Given that we'll be including libc's math.h soon, prepare for this by prefixing our canonicalize() with sf_ to avoid clashing with the libc's canonicalize(). Signed-off-by: Emilio G. Cota --- fpu/softfloat.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index d0f1f65..901c507 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -414,8 +414,8 @@ static inline float64 float64_pack_raw(FloatParts p) } =20 /* Canonicalize EXP and FRAC, setting CLS. */ -static FloatParts canonicalize(FloatParts part, const FloatFmt *parm, - float_status *status) +static FloatParts sf_canonicalize(FloatParts part, const FloatFmt *parm, + float_status *status) { if (part.exp =3D=3D parm->exp_max) { if (part.frac =3D=3D 0) { @@ -585,7 +585,7 @@ static FloatParts round_canonical(FloatParts p, float_s= tatus *s, =20 static FloatParts float16_unpack_canonical(float16 f, float_status *s) { - return canonicalize(float16_unpack_raw(f), &float16_params, s); + return sf_canonicalize(float16_unpack_raw(f), &float16_params, s); } =20 static float16 float16_round_pack_canonical(FloatParts p, float_status *s) @@ -603,7 +603,7 @@ static float16 float16_round_pack_canonical(FloatParts = p, float_status *s) =20 static FloatParts float32_unpack_canonical(float32 f, float_status *s) { - return canonicalize(float32_unpack_raw(f), &float32_params, s); + return sf_canonicalize(float32_unpack_raw(f), &float32_params, s); } =20 static float32 float32_round_pack_canonical(FloatParts p, float_status *s) @@ -621,7 +621,7 @@ static float32 float32_round_pack_canonical(FloatParts = p, float_status *s) =20 static FloatParts float64_unpack_canonical(float64 f, float_status *s) { - return canonicalize(float64_unpack_raw(f), &float64_params, s); + return sf_canonicalize(float64_unpack_raw(f), &float64_params, s); } =20 static float64 float64_round_pack_canonical(FloatParts p, float_status *s) --=20 2.7.4