From patchwork Sat Dec 15 18:42:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 1013986 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43HGWc0QpVz9s47 for ; Sun, 16 Dec 2018 05:43:07 +1100 (AEDT) Received: from localhost ([::1]:40002 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYEu1-0000wq-B8 for incoming@patchwork.ozlabs.org; Sat, 15 Dec 2018 13:43:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYEth-0000wf-8V for qemu-devel@nongnu.org; Sat, 15 Dec 2018 13:42:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gYEte-0002Q8-46 for qemu-devel@nongnu.org; Sat, 15 Dec 2018 13:42:45 -0500 Received: from 18.mo6.mail-out.ovh.net ([46.105.73.110]:59400) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gYEtd-0002O6-TP for qemu-devel@nongnu.org; Sat, 15 Dec 2018 13:42:42 -0500 Received: from player772.ha.ovh.net (unknown [10.109.160.251]) by mo6.mail-out.ovh.net (Postfix) with ESMTP id 9FEC219E1BB for ; Sat, 15 Dec 2018 19:42:33 +0100 (CET) Received: from kaod.org (lfbn-1-10605-110.w90-89.abo.wanadoo.fr [90.89.196.110]) (Authenticated sender: clg@kaod.org) by player772.ha.ovh.net (Postfix) with ESMTPSA id 43069D98FEA; Sat, 15 Dec 2018 18:42:25 +0000 (UTC) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: David Gibson , Peter Maydell Date: Sat, 15 Dec 2018 19:42:22 +0100 Message-Id: <20181215184222.15127-1-clg@kaod.org> X-Mailer: git-send-email 2.17.2 MIME-Version: 1.0 X-Ovh-Tracer-Id: 5411356430602963942 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudehjedguddukecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.73.110 Subject: [Qemu-devel] [PATCH] target/ppc: fix compilation breakage on windows 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?C=C3=A9dric_Le_Goater?= , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Fix the PPC_BIT definitions to use ULL instead in UL and replace __builtin_ffssl() by the equivalent ctz routines. Signed-off-by: Cédric Le Goater --- Compile tested with --cross-prefix=x86_64-w64-mingw32-. When I have some more time, I might try runtime on windows also. The PPC compile failures have been there for a while (pre 2.12) and the MASK_TO_LSH macro was not used until the XIVE definitions were introduced. I let you guys decide on how you want to proceed, but I think it is safe to merge this patch as a prereq of the pull request. Thanks, C. target/ppc/cpu.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index ab68abe8a23c..a3d3e91eb4ce 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -70,18 +70,18 @@ #define PPC_ELF_MACHINE EM_PPC #endif -#define PPC_BIT(bit) (0x8000000000000000UL >> (bit)) -#define PPC_BIT32(bit) (0x80000000UL >> (bit)) -#define PPC_BIT8(bit) (0x80UL >> (bit)) +#define PPC_BIT(bit) (0x8000000000000000ULL >> (bit)) +#define PPC_BIT32(bit) (0x80000000ULL >> (bit)) +#define PPC_BIT8(bit) (0x80ULL >> (bit)) #define PPC_BITMASK(bs, be) ((PPC_BIT(bs) - PPC_BIT(be)) | PPC_BIT(bs)) #define PPC_BITMASK32(bs, be) ((PPC_BIT32(bs) - PPC_BIT32(be)) | \ PPC_BIT32(bs)) #define PPC_BITMASK8(bs, be) ((PPC_BIT8(bs) - PPC_BIT8(be)) | PPC_BIT8(bs)) #if HOST_LONG_BITS == 32 -# define MASK_TO_LSH(m) (__builtin_ffsll(m) - 1) +# define MASK_TO_LSH(m) ctz32(m) #elif HOST_LONG_BITS == 64 -# define MASK_TO_LSH(m) (__builtin_ffsl(m) - 1) +# define MASK_TO_LSH(m) ctz64(m) #else # error Unknown sizeof long #endif