From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Cc: Andrzej Zaborowski <andrew.zaborowski@intel.com>,
Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] [PATCH 3/3] tcg: declare internal helpers as const and pure
Date: Thu, 4 Mar 2010 22:45:10 +0100 [thread overview]
Message-ID: <1267739110-26400-4-git-send-email-aurelien@aurel32.net> (raw)
In-Reply-To: <1267739110-26400-1-git-send-email-aurelien@aurel32.net>
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 <aurelien@aurel32.net>
---
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);
}
--
1.7.0
next prev parent reply other threads:[~2010-03-04 21:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-04 21:45 [Qemu-devel] [PATCH 0/3] tcg/arm: fix division Aurelien Jarno
2010-03-04 21:45 ` [Qemu-devel] [PATCH 1/3] tcg: add div/rem 32-bit helpers Aurelien Jarno
2010-03-04 21:45 ` [Qemu-devel] [PATCH 2/3] tcg/arm: use helpers for divu/remu Aurelien Jarno
2010-03-04 21:45 ` Aurelien Jarno [this message]
2010-03-05 11:15 ` [Qemu-devel] [PATCH 3/3] tcg: declare internal helpers as const and pure Paul Brook
2010-03-05 20:07 ` Aurelien Jarno
2010-03-07 22:39 ` Paul Brook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1267739110-26400-4-git-send-email-aurelien@aurel32.net \
--to=aurelien@aurel32.net \
--cc=andrew.zaborowski@intel.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).