From patchwork Thu Aug 11 10:50:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 109592 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9CBB7B6F8C for ; Thu, 11 Aug 2011 20:50:56 +1000 (EST) Received: from localhost ([::1]:53476 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrSqh-0002oP-UQ for incoming@patchwork.ozlabs.org; Thu, 11 Aug 2011 06:50:51 -0400 Received: from eggs.gnu.org ([140.186.70.92]:48065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrSqc-0002oK-Jv for qemu-devel@nongnu.org; Thu, 11 Aug 2011 06:50:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QrSqb-0005vg-7J for qemu-devel@nongnu.org; Thu, 11 Aug 2011 06:50:46 -0400 Received: from cantor2.suse.de ([195.135.220.15]:40092 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrSqa-0005vO-TB for qemu-devel@nongnu.org; Thu, 11 Aug 2011 06:50:45 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id A71FA8EE5B; Thu, 11 Aug 2011 12:50:43 +0200 (CEST) From: Alexander Graf To: qemu-devel Developers Date: Thu, 11 Aug 2011 12:50:39 +0200 Message-Id: <1313059839-2445-1-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.7.3.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: Blue Swirl , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Kirill Batuzov , David Gibson Subject: [Qemu-devel] [PATCH] TCG: Add preprocessor guards for optional tcg ops X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org While compiling current HEAD on a ppc64 box, I was confronted with the following compile errors: tcg/optimize.c: In function ‘tcg_constant_folding’: tcg/optimize.c:546: error: ‘INDEX_op_not_i32’ undeclared (first use in this function) tcg/optimize.c:546: error: (Each undeclared identifier is reported only once tcg/optimize.c:546: error: for each function it appears in.) tcg/optimize.c:546: error: ‘INDEX_op_not_i64’ undeclared (first use in this function) tcg/optimize.c:573: error: ‘INDEX_op_ext32u_i64’ undeclared (first use in this function) make[1]: *** [tcg/optimize.o] Error 1 Obviously, the optimize.c tries to use TCG opcode constants that are optional and thus not defined in some targets, such as ppc64. This patch guards them with the proper #ifdefs, so compilation works again. Signed-off-by: Alexander Graf --- tcg/optimize.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 7eb5eb1..7b4954c 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -543,7 +543,11 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr, gen_args += 2; args += 2; break; +#if ((TCG_TARGET_REG_BITS == 32) && defined(TCG_TARGET_HAS_not_i32)) || \ + ((TCG_TARGET_REG_BITS == 64) && defined(TCG_TARGET_HAS_not_i32) && \ + defined(TCG_TARGET_HAS_not_i64)) CASE_OP_32_64(not): +#endif #ifdef TCG_TARGET_HAS_ext8s_i32 case INDEX_op_ext8s_i32: #endif @@ -568,8 +572,10 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr, #ifdef TCG_TARGET_HAS_ext16u_i64 case INDEX_op_ext16u_i64: #endif -#if TCG_TARGET_REG_BITS == 64 +#if (TCG_TARGET_REG_BITS == 64) && defined(TCG_TARGET_HAS_ext32s_i64) case INDEX_op_ext32s_i64: +#endif +#if (TCG_TARGET_REG_BITS == 64) && defined(TCG_TARGET_HAS_ext32u_i64) case INDEX_op_ext32u_i64: #endif if (temps[args[1]].state == TCG_TEMP_CONST) {