From patchwork Thu Mar 4 21:45:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 46985 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C8B94B7CE8 for ; Fri, 5 Mar 2010 08:56:32 +1100 (EST) Received: from localhost ([127.0.0.1]:50878 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NnJ0L-0004dj-FL for incoming@patchwork.ozlabs.org; Thu, 04 Mar 2010 16:54:49 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NnIrn-0006bs-PZ for qemu-devel@nongnu.org; Thu, 04 Mar 2010 16:45:59 -0500 Received: from [199.232.76.173] (port=42209 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NnIrm-0006ao-M5 for qemu-devel@nongnu.org; Thu, 04 Mar 2010 16:45:58 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NnIrE-0005E4-WC for qemu-devel@nongnu.org; Thu, 04 Mar 2010 16:45:58 -0500 Received: from hall.aurel32.net ([88.191.82.174]:33693) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NnIrE-0005Da-Ec for qemu-devel@nongnu.org; Thu, 04 Mar 2010 16:45:24 -0500 Received: from [2a01:e35:2e80:2fb0:21e:8cff:feb0:693b] (helo=volta.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1NnIrC-00019P-Vg; Thu, 04 Mar 2010 22:45:23 +0100 Received: from aurel32 by volta.aurel32.net with local (Exim 4.71) (envelope-from ) id 1NnIr6-0006yI-8G; Thu, 04 Mar 2010 22:45:16 +0100 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Thu, 4 Mar 2010 22:45:10 +0100 Message-Id: <1267739110-26400-4-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.0 In-Reply-To: <1267739110-26400-1-git-send-email-aurelien@aurel32.net> References: <1267739110-26400-1-git-send-email-aurelien@aurel32.net> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Andrzej Zaborowski , Aurelien Jarno Subject: [Qemu-devel] [PATCH 3/3] tcg: declare internal helpers as const and pure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org TCG internal helpers only access to the values passed in arguments, and do not modify the CPU internal state. Thus they can be declared as const and pure. Signed-off-by: Aurelien Jarno --- tcg/tcg-op.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h index c71e1a8..30a7a73 100644 --- a/tcg/tcg-op.h +++ b/tcg/tcg-op.h @@ -364,7 +364,6 @@ static inline void tcg_gen_helperN(void *func, int flags, int sizemask, tcg_temp_free_ptr(fn); } -/* FIXME: Should this be pure? */ static inline void tcg_gen_helper32(void *func, TCGv_i32 ret, TCGv_i32 a, TCGv_i32 b) { @@ -373,11 +372,11 @@ static inline void tcg_gen_helper32(void *func, TCGv_i32 ret, fn = tcg_const_ptr((tcg_target_long)func); args[0] = GET_TCGV_I32(a); args[1] = GET_TCGV_I32(b); - tcg_gen_callN(&tcg_ctx, fn, 0, 0, GET_TCGV_I32(ret), 2, args); + tcg_gen_callN(&tcg_ctx, fn, TCG_CALL_CONST | TCG_CALL_PURE, + 0, GET_TCGV_I32(ret), 2, args); tcg_temp_free_ptr(fn); } -/* FIXME: Should this be pure? */ static inline void tcg_gen_helper64(void *func, TCGv_i64 ret, TCGv_i64 a, TCGv_i64 b) { @@ -386,7 +385,8 @@ static inline void tcg_gen_helper64(void *func, TCGv_i64 ret, fn = tcg_const_ptr((tcg_target_long)func); args[0] = GET_TCGV_I64(a); args[1] = GET_TCGV_I64(b); - tcg_gen_callN(&tcg_ctx, fn, 0, 7, GET_TCGV_I64(ret), 2, args); + tcg_gen_callN(&tcg_ctx, fn, TCG_CALL_CONST | TCG_CALL_PURE, + 7, GET_TCGV_I64(ret), 2, args); tcg_temp_free_ptr(fn); }