qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: qemu-devel@nongnu.org
Cc: Max Filippov <jcmvbkbc@gmail.com>
Subject: [PATCH 2/6] target/xtensa: use tcg_constant_* for exceptions
Date: Thu, 21 Apr 2022 14:39:13 -0700	[thread overview]
Message-ID: <20220421213917.368830-3-jcmvbkbc@gmail.com> (raw)
In-Reply-To: <20220421213917.368830-1-jcmvbkbc@gmail.com>

Exception number, exception cause and debug cause codes are small
numbers, use tcg_contant_* for them.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 target/xtensa/translate.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index 3379fc1fc774..77d2e1303746 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -318,18 +318,14 @@ static void gen_left_shift_sar(DisasContext *dc, TCGv_i32 sa)
 
 static void gen_exception(DisasContext *dc, int excp)
 {
-    TCGv_i32 tmp = tcg_const_i32(excp);
-    gen_helper_exception(cpu_env, tmp);
-    tcg_temp_free(tmp);
+    gen_helper_exception(cpu_env, tcg_constant_i32(excp));
 }
 
 static void gen_exception_cause(DisasContext *dc, uint32_t cause)
 {
     TCGv_i32 tpc = tcg_const_i32(dc->pc);
-    TCGv_i32 tcause = tcg_const_i32(cause);
-    gen_helper_exception_cause(cpu_env, tpc, tcause);
+    gen_helper_exception_cause(cpu_env, tpc, tcg_constant_i32(cause));
     tcg_temp_free(tpc);
-    tcg_temp_free(tcause);
     if (cause == ILLEGAL_INSTRUCTION_CAUSE ||
             cause == SYSCALL_CAUSE) {
         dc->base.is_jmp = DISAS_NORETURN;
@@ -339,10 +335,8 @@ static void gen_exception_cause(DisasContext *dc, uint32_t cause)
 static void gen_debug_exception(DisasContext *dc, uint32_t cause)
 {
     TCGv_i32 tpc = tcg_const_i32(dc->pc);
-    TCGv_i32 tcause = tcg_const_i32(cause);
-    gen_helper_debug_exception(cpu_env, tpc, tcause);
+    gen_helper_debug_exception(cpu_env, tpc, tcg_constant_i32(cause));
     tcg_temp_free(tpc);
-    tcg_temp_free(tcause);
     if (cause & (DEBUGCAUSE_IB | DEBUGCAUSE_BI | DEBUGCAUSE_BN)) {
         dc->base.is_jmp = DISAS_NORETURN;
     }
-- 
2.30.2



  parent reply	other threads:[~2022-04-21 21:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 21:39 [PATCH 0/6] target/xtensa: use tcg_constant_* where possible Max Filippov
2022-04-21 21:39 ` [PATCH 1/6] target/xtensa: use tcg_contatnt_* for numeric literals Max Filippov
2022-04-21 21:54   ` Richard Henderson
2022-04-21 21:39 ` Max Filippov [this message]
2022-04-21 21:54   ` [PATCH 2/6] target/xtensa: use tcg_constant_* for exceptions Richard Henderson
2022-04-21 21:39 ` [PATCH 3/6] target/xtensa: use tcg_constant_* for TLB opcodes Max Filippov
2022-04-21 21:55   ` Richard Henderson
2022-04-21 21:39 ` [PATCH 4/6] target/xtensa: use tcg_constant_* for numbered special registers Max Filippov
2022-04-21 21:55   ` Richard Henderson
2022-04-21 21:39 ` [PATCH 5/6] target/xtensa: use tcg_constant_* for FPU conversion opcodes Max Filippov
2022-04-21 21:56   ` Richard Henderson
2022-04-21 21:39 ` [PATCH 6/6] target/xtensa: use tcg_constant_* for remaining opcodes Max Filippov
2022-04-21 21:57   ` Richard Henderson

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=20220421213917.368830-3-jcmvbkbc@gmail.com \
    --to=jcmvbkbc@gmail.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).