From nobody Sun May 19 01:26:46 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538032990385118.51747266065593; Thu, 27 Sep 2018 00:23:10 -0700 (PDT) Received: from localhost ([::1]:34097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5Qdh-00088W-6s for importer@patchew.org; Thu, 27 Sep 2018 03:23:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5QXG-0002WW-7U for qemu-devel@nongnu.org; Thu, 27 Sep 2018 03:16:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5QXB-0006ID-4b for qemu-devel@nongnu.org; Thu, 27 Sep 2018 03:16:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50202) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g5QXA-0006Hr-SQ for qemu-devel@nongnu.org; Thu, 27 Sep 2018 03:16:25 -0400 Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E6DE1308FB8E; Thu, 27 Sep 2018 07:16:23 +0000 (UTC) Received: from thuth.com (ovpn-116-44.ams2.redhat.com [10.36.116.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E82230912F5; Thu, 27 Sep 2018 07:16:21 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Peter Maydell Date: Thu, 27 Sep 2018 09:16:16 +0200 Message-Id: <1538032576-13339-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 27 Sep 2018 07:16:24 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] include/fpu/softfloat-macros: Get rid of old SOFTFLOAT_GNUC_PREREQ code 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: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Our minimum required compiler for compiling QEMU is GCC 4.1 these days, so we can drop the support for compilers which do not provide the __builtin_clz*() functions yet. Signed-off-by: Thomas Huth --- include/fpu/softfloat-macros.h | 59 --------------------------------------= ---- 1 file changed, 59 deletions(-) diff --git a/include/fpu/softfloat-macros.h b/include/fpu/softfloat-macros.h index 35e1603..f65c90d 100644 --- a/include/fpu/softfloat-macros.h +++ b/include/fpu/softfloat-macros.h @@ -80,17 +80,6 @@ this code that are retained. */ =20 /*------------------------------------------------------------------------= ---- -| This macro tests for minimum version of the GNU C compiler. -*-------------------------------------------------------------------------= ---*/ -#if defined(__GNUC__) && defined(__GNUC_MINOR__) -# define SOFTFLOAT_GNUC_PREREQ(maj, min) \ - ((__GNUC__ << 16) + __GNUC_MINOR__ >=3D ((maj) << 16) + (min)) -#else -# define SOFTFLOAT_GNUC_PREREQ(maj, min) 0 -#endif - - -/*------------------------------------------------------------------------= ---- | Shifts `a' right by the number of bits given in `count'. If any nonzero | bits are shifted off, they are ``jammed'' into the least significant bit= of | the result by setting the least significant bit to 1. The value of `cou= nt' @@ -719,45 +708,11 @@ static inline uint32_t estimateSqrt32(int aExp, uint3= 2_t a) =20 static inline int8_t countLeadingZeros32(uint32_t a) { -#if SOFTFLOAT_GNUC_PREREQ(3, 4) if (a) { return __builtin_clz(a); } else { return 32; } -#else - static const int8_t countLeadingZerosHigh[] =3D { - 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - int8_t shiftCount; - - shiftCount =3D 0; - if ( a < 0x10000 ) { - shiftCount +=3D 16; - a <<=3D 16; - } - if ( a < 0x1000000 ) { - shiftCount +=3D 8; - a <<=3D 8; - } - shiftCount +=3D countLeadingZerosHigh[ a>>24 ]; - return shiftCount; -#endif } =20 /*------------------------------------------------------------------------= ---- @@ -767,25 +722,11 @@ static inline int8_t countLeadingZeros32(uint32_t a) =20 static inline int8_t countLeadingZeros64(uint64_t a) { -#if SOFTFLOAT_GNUC_PREREQ(3, 4) if (a) { return __builtin_clzll(a); } else { return 64; } -#else - int8_t shiftCount; - - shiftCount =3D 0; - if ( a < ( (uint64_t) 1 )<<32 ) { - shiftCount +=3D 32; - } - else { - a >>=3D 32; - } - shiftCount +=3D countLeadingZeros32( a ); - return shiftCount; -#endif } =20 /*------------------------------------------------------------------------= ---- --=20 1.8.3.1