From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, patches@linaro.org
Subject: [Qemu-devel] [PATCH 1/2] target-cris/translate.c: Remove t_gen_mov_TN_reg and t_gen_mov_reg_TN
Date: Sat, 7 Jun 2014 18:03:01 +0100 [thread overview]
Message-ID: <1402160582-13994-2-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1402160582-13994-1-git-send-email-peter.maydell@linaro.org>
Remove the t_gen_mov_TN_reg and t_gen_mov_reg_TN wrappers: the
latter is completely unused, and the former only used in a few
places (which are thus inconsistent with the rest of the decoder
which directly accesses cpu_R[]).
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
My main aim here is to remove the unused function; I think dropping
the used-a-few-times function makes the code clearer, but am happy
to drop it if you disagree.
---
target-cris/translate.c | 21 +++------------------
target-cris/translate_v10.c | 2 +-
2 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/target-cris/translate.c b/target-cris/translate.c
index 90fe0a2..eaea633 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -163,21 +163,6 @@ static int preg_sizes[] = {
#define t_gen_mov_env_TN(member, tn) \
_t_gen_mov_env_TN(offsetof(CPUCRISState, member), (tn))
-static inline void t_gen_mov_TN_reg(TCGv tn, int r)
-{
- if (r < 0 || r > 15) {
- fprintf(stderr, "wrong register read $r%d\n", r);
- }
- tcg_gen_mov_tl(tn, cpu_R[r]);
-}
-static inline void t_gen_mov_reg_TN(int r, TCGv tn)
-{
- if (r < 0 || r > 15) {
- fprintf(stderr, "wrong register write $r%d\n", r);
- }
- tcg_gen_mov_tl(cpu_R[r], tn);
-}
-
static inline void _t_gen_mov_TN_env(TCGv tn, int offset)
{
if (offset > sizeof(CPUCRISState)) {
@@ -1811,7 +1796,7 @@ static int dec_swap_r(CPUCRISState *env, DisasContext *dc)
cris_cc_mask(dc, CC_MASK_NZ);
t0 = tcg_temp_new();
- t_gen_mov_TN_reg(t0, dc->op1);
+ tcg_gen_mov_tl(t0, cpu_R[dc->op1]);
if (dc->op2 & 8) {
tcg_gen_not_tl(t0, t0);
}
@@ -2119,7 +2104,7 @@ static int dec_move_rp(CPUCRISState *env, DisasContext *dc)
t[0] = tcg_temp_new();
if (dc->op2 == PR_CCS) {
cris_evaluate_flags(dc);
- t_gen_mov_TN_reg(t[0], dc->op1);
+ tcg_gen_mov_tl(t[0], cpu_R[dc->op1]);
if (dc->tb_flags & U_FLAG) {
t[1] = tcg_temp_new();
/* User space is not allowed to touch all flags. */
@@ -2129,7 +2114,7 @@ static int dec_move_rp(CPUCRISState *env, DisasContext *dc)
tcg_temp_free(t[1]);
}
} else {
- t_gen_mov_TN_reg(t[0], dc->op1);
+ tcg_gen_mov_tl(t[0], cpu_R[dc->op1]);
}
t_gen_mov_preg_TN(dc, dc->op2, t[0]);
diff --git a/target-cris/translate_v10.c b/target-cris/translate_v10.c
index 2ad2b14..efb3639 100644
--- a/target-cris/translate_v10.c
+++ b/target-cris/translate_v10.c
@@ -516,7 +516,7 @@ static void dec10_reg_swap(DisasContext *dc)
cris_cc_mask(dc, CC_MASK_NZVC);
t0 = tcg_temp_new();
- t_gen_mov_TN_reg(t0, dc->src);
+ tcg_gen_mov_tl(t0, cpu_R[dc->src]);
if (dc->dst & 8)
tcg_gen_not_tl(t0, t0);
if (dc->dst & 4)
--
1.8.5.4
next prev parent reply other threads:[~2014-06-07 17:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-07 17:03 [Qemu-devel] [PATCH 0/2] target-cris: Avoid unused-function warnings Peter Maydell
2014-06-07 17:03 ` Peter Maydell [this message]
2014-06-07 17:03 ` [Qemu-devel] [PATCH 2/2] target-cris/translate.c: Remove _t_gen_mov_TN_env and _t_gen_mov_env_TN Peter Maydell
2014-06-08 23:31 ` [Qemu-devel] [PATCH 0/2] target-cris: Avoid unused-function warnings Edgar E. Iglesias
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=1402160582-13994-2-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=edgar.iglesias@gmail.com \
--cc=patches@linaro.org \
--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).