* [Qemu-devel] [PATCH 1/2][SPARC] Improve sparc handling of ta
[not found] <BANLkTikP09fcV3=CsK3-U7_3HJYjJfjTmg@mail.gmail.com>
@ 2011-05-17 15:32 ` Julien Grall
2011-05-27 17:26 ` Blue Swirl
0 siblings, 1 reply; 2+ messages in thread
From: Julien Grall @ 2011-05-17 15:32 UTC (permalink / raw)
To: qemu-devel; +Cc: Fabien Chouteau
Improve sparc handling of ta
Signed-off-by: Julien Grall <julien.grall@gmail.com>
---
target-sparc/helper.h | 1 +
target-sparc/op_helper.c | 6 ++++++
target-sparc/translate.c | 7 ++++---
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/target-sparc/helper.h b/target-sparc/helper.h
index 12e8557..61ef03a 100644
--- a/target-sparc/helper.h
+++ b/target-sparc/helper.h
@@ -85,6 +85,7 @@ DEF_HELPER_0(fcmpeq_fcc2, void)
DEF_HELPER_0(fcmpeq_fcc3, void)
#endif
DEF_HELPER_1(raise_exception, void, int)
+DEF_HELPER_1(trap_always, void, int)
DEF_HELPER_0(shutdown, void)
#define F_HELPER_0_0(name) DEF_HELPER_0(f ## name, void)
#define F_HELPER_DQ_0_0(name) \
diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index ffffb8c..a6fabad 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -324,6 +324,12 @@ void HELPER(raise_exception)(int tt)
raise_exception(tt);
}
+void HELPER(trap_always)(int tt)
+{
+ env->exception_index = tt;
+ do_interrupt(env);
+}
+
void helper_shutdown(void)
{
#if !defined(CONFIG_USER_ONLY)
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 3c958b2..b30003b 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -1982,7 +1982,7 @@ static void disas_sparc_insn(DisasContext * dc)
case 2: /* FPU & Logical Operations */
{
unsigned int xop = GET_FIELD(insn, 7, 12);
- if (xop == 0x3a) { /* generate trap */
+ if (xop == 0x3a) { /* ta, tcc: generate trap */
int cond;
cpu_src1 = get_src1(insn, cpu_src1);
@@ -2015,7 +2015,7 @@ static void disas_sparc_insn(DisasContext * dc)
gen_helper_shutdown();
} else {
- gen_helper_raise_exception(cpu_tmp32);
+ gen_helper_trap_always(cpu_tmp32);
}
} else if (cond != 0) {
TCGv r_cond = tcg_temp_new();
@@ -2049,8 +2049,9 @@ static void disas_sparc_insn(DisasContext * dc)
gen_set_label(l1);
tcg_temp_free(r_cond);
+
+ gen_op_next_insn();
}
- gen_op_next_insn();
tcg_gen_exit_tb(0);
dc->is_br = 1;
goto jmp_insn;
--
1.7.4.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2][SPARC] Improve sparc handling of ta
2011-05-17 15:32 ` [Qemu-devel] [PATCH 1/2][SPARC] Improve sparc handling of ta Julien Grall
@ 2011-05-27 17:26 ` Blue Swirl
0 siblings, 0 replies; 2+ messages in thread
From: Blue Swirl @ 2011-05-27 17:26 UTC (permalink / raw)
To: Julien Grall; +Cc: qemu-devel, Fabien Chouteau
On Tue, May 17, 2011 at 6:32 PM, Julien Grall <julien.grall@gmail.com> wrote:
> Improve sparc handling of ta
>
> Signed-off-by: Julien Grall <julien.grall@gmail.com>
> ---
> target-sparc/helper.h | 1 +
> target-sparc/op_helper.c | 6 ++++++
> target-sparc/translate.c | 7 ++++---
> 3 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/target-sparc/helper.h b/target-sparc/helper.h
> index 12e8557..61ef03a 100644
> --- a/target-sparc/helper.h
> +++ b/target-sparc/helper.h
> @@ -85,6 +85,7 @@ DEF_HELPER_0(fcmpeq_fcc2, void)
> DEF_HELPER_0(fcmpeq_fcc3, void)
> #endif
> DEF_HELPER_1(raise_exception, void, int)
> +DEF_HELPER_1(trap_always, void, int)
> DEF_HELPER_0(shutdown, void)
> #define F_HELPER_0_0(name) DEF_HELPER_0(f ## name, void)
> #define F_HELPER_DQ_0_0(name) \
> diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
> index ffffb8c..a6fabad 100644
> --- a/target-sparc/op_helper.c
> +++ b/target-sparc/op_helper.c
> @@ -324,6 +324,12 @@ void HELPER(raise_exception)(int tt)
> raise_exception(tt);
> }
>
> +void HELPER(trap_always)(int tt)
> +{
> + env->exception_index = tt;
> + do_interrupt(env);
Sorry, I didn't catch this earlier. This should be cpu_loop_exit() and
then the function becomes equal to raise_exception().
> +}
> +
> void helper_shutdown(void)
> {
> #if !defined(CONFIG_USER_ONLY)
> diff --git a/target-sparc/translate.c b/target-sparc/translate.c
> index 3c958b2..b30003b 100644
> --- a/target-sparc/translate.c
> +++ b/target-sparc/translate.c
> @@ -1982,7 +1982,7 @@ static void disas_sparc_insn(DisasContext * dc)
> case 2: /* FPU & Logical Operations */
> {
> unsigned int xop = GET_FIELD(insn, 7, 12);
> - if (xop == 0x3a) { /* generate trap */
> + if (xop == 0x3a) { /* ta, tcc: generate trap */
> int cond;
>
> cpu_src1 = get_src1(insn, cpu_src1);
> @@ -2015,7 +2015,7 @@ static void disas_sparc_insn(DisasContext * dc)
> gen_helper_shutdown();
>
> } else {
> - gen_helper_raise_exception(cpu_tmp32);
> + gen_helper_trap_always(cpu_tmp32);
> }
> } else if (cond != 0) {
> TCGv r_cond = tcg_temp_new();
> @@ -2049,8 +2049,9 @@ static void disas_sparc_insn(DisasContext * dc)
>
> gen_set_label(l1);
> tcg_temp_free(r_cond);
> +
> + gen_op_next_insn();
> }
> - gen_op_next_insn();
> tcg_gen_exit_tb(0);
> dc->is_br = 1;
> goto jmp_insn;
> --
> 1.7.4.4
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-05-27 17:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <BANLkTikP09fcV3=CsK3-U7_3HJYjJfjTmg@mail.gmail.com>
2011-05-17 15:32 ` [Qemu-devel] [PATCH 1/2][SPARC] Improve sparc handling of ta Julien Grall
2011-05-27 17:26 ` Blue Swirl
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).