From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Cc: Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] [PATCH v2 12/14] target/sh4: implement tas.b using atomic helper
Date: Sat, 6 May 2017 13:14:29 +0200 [thread overview]
Message-ID: <20170506111431.12548-13-aurelien@aurel32.net> (raw)
In-Reply-To: <20170506111431.12548-1-aurelien@aurel32.net>
We only emulate UP SH4, however as the tas.b instruction is used in the GNU
libc, this improve linux-user emulation.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
target/sh4/translate.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/target/sh4/translate.c b/target/sh4/translate.c
index 9fe2e2d4d9..d86fd29264 100644
--- a/target/sh4/translate.c
+++ b/target/sh4/translate.c
@@ -1635,19 +1635,14 @@ static void _decode_opc(DisasContext * ctx)
tcg_gen_shri_i32(REG(B11_8), REG(B11_8), 16);
return;
case 0x401b: /* tas.b @Rn */
- {
- TCGv addr, val;
- addr = tcg_temp_local_new();
- tcg_gen_mov_i32(addr, REG(B11_8));
- val = tcg_temp_local_new();
- tcg_gen_qemu_ld_i32(val, addr, ctx->memidx, MO_UB);
+ {
+ TCGv val = tcg_const_i32(0x80);
+ tcg_gen_atomic_fetch_or_i32(val, REG(B11_8), val,
+ ctx->memidx, MO_UB);
tcg_gen_setcondi_i32(TCG_COND_EQ, cpu_sr_t, val, 0);
- tcg_gen_ori_i32(val, val, 0x80);
- tcg_gen_qemu_st_i32(val, addr, ctx->memidx, MO_UB);
- tcg_temp_free(val);
- tcg_temp_free(addr);
- }
- return;
+ tcg_temp_free(val);
+ }
+ return;
case 0xf00d: /* fsts FPUL,FRn - FPSCR: Nothing */
CHECK_FPU_ENABLED
tcg_gen_mov_i32(cpu_fregs[FREG(B11_8)], cpu_fpul);
--
2.11.0
next prev parent reply other threads:[~2017-05-06 11:14 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-06 11:14 [Qemu-devel] [PATCH v2 00/14] target/sh4: misc fixes, cleanup and optimizations Aurelien Jarno
2017-05-06 11:14 ` [Qemu-devel] [PATCH v2 01/14] target/sh4: split ctx->flags into ctx->tbflags and ctx->envflags Aurelien Jarno
2017-05-06 16:15 ` Philippe Mathieu-Daudé
2017-05-09 20:55 ` Richard Henderson
2017-05-06 11:14 ` [Qemu-devel] [PATCH v2 02/14] target/sh4: get rid of DELAY_SLOT_CLEARME Aurelien Jarno
2017-05-09 20:56 ` Richard Henderson
2017-05-06 11:14 ` [Qemu-devel] [PATCH v2 03/14] target/sh4: do not include DELAY_SLOT_TRUE in the TB state Aurelien Jarno
2017-05-06 16:16 ` Philippe Mathieu-Daudé
2017-05-09 20:56 ` Richard Henderson
2017-05-06 11:14 ` [Qemu-devel] [PATCH v2 04/14] target/sh4: move DELAY_SLOT_TRUE flag into a separate global Aurelien Jarno
2017-05-09 20:59 ` Richard Henderson
2017-05-06 11:14 ` [Qemu-devel] [PATCH v2 05/14] target/sh4: fix BS_STOP exit Aurelien Jarno
2017-05-09 21:02 ` Richard Henderson
2017-05-06 11:14 ` [Qemu-devel] [PATCH v2 06/14] target/sh4: fix BS_EXCP exit Aurelien Jarno
2017-05-06 16:17 ` Philippe Mathieu-Daudé
2017-05-09 21:03 ` Richard Henderson
2017-05-06 11:14 ` [Qemu-devel] [PATCH v2 07/14] target/sh4: only save flags state at the end of the TB Aurelien Jarno
2017-05-09 21:06 ` Richard Henderson
2017-05-06 11:14 ` [Qemu-devel] [PATCH v2 08/14] target/sh4: fold ctx->bstate = BS_BRANCH into gen_conditional_jump Aurelien Jarno
2017-05-09 21:07 ` Richard Henderson
2017-05-06 11:14 ` [Qemu-devel] [PATCH v2 09/14] target/sh4: optimize gen_store_fpr64 Aurelien Jarno
2017-05-09 21:09 ` Richard Henderson
2017-05-10 6:54 ` Aurelien Jarno
2017-05-10 11:01 ` Philippe Mathieu-Daudé
2017-05-13 0:29 ` [Qemu-devel] [PATCH] tcg: optimize gen_extr_i64_i32() Philippe Mathieu-Daudé
2017-05-13 2:13 ` Richard Henderson
2017-05-30 15:01 ` Philippe Mathieu-Daudé
2017-05-06 11:14 ` [Qemu-devel] [PATCH v2 10/14] target/sh4: optimize gen_write_sr using extract op Aurelien Jarno
2017-05-06 16:19 ` Philippe Mathieu-Daudé
2017-05-09 21:09 ` Richard Henderson
2017-05-06 11:14 ` [Qemu-devel] [PATCH v2 11/14] target/sh4: generate fences for SH4 Aurelien Jarno
2017-05-09 21:10 ` Richard Henderson
2017-05-06 11:14 ` Aurelien Jarno [this message]
2017-05-09 21:10 ` [Qemu-devel] [PATCH v2 12/14] target/sh4: implement tas.b using atomic helper Richard Henderson
2017-05-06 11:14 ` [Qemu-devel] [PATCH v2 13/14] target/sh4: movua.l is an SH4-A only instruction Aurelien Jarno
2017-05-09 21:11 ` Richard Henderson
2017-05-06 11:14 ` [Qemu-devel] [PATCH v2 14/14] target/sh4: trap unaligned accesses Aurelien Jarno
2017-05-09 21:13 ` Richard Henderson
2017-05-10 7:00 ` Aurelien Jarno
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=20170506111431.12548-13-aurelien@aurel32.net \
--to=aurelien@aurel32.net \
--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).