From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: schwab@linux-m68k.org, agraf@suse.de,
Richard Henderson <rth@twiddle.net>,
gerg@uclinux.org, Laurent Vivier <laurent@vivier.eu>
Subject: [Qemu-devel] [PULL 02/18] target-m68k: add linkl
Date: Fri, 28 Oct 2016 10:48:16 +0200 [thread overview]
Message-ID: <1477644512-21716-3-git-send-email-laurent@vivier.eu> (raw)
In-Reply-To: <1477644512-21716-1-git-send-email-laurent@vivier.eu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
target-m68k/translate.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index a128b67..0d3111d 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -1733,21 +1733,36 @@ DISAS_INSN(mull)
gen_logic_cc(s, dest, OS_LONG);
}
-DISAS_INSN(link)
+static void gen_link(DisasContext *s, uint16_t insn, int32_t offset)
{
- int16_t offset;
TCGv reg;
TCGv tmp;
- offset = cpu_ldsw_code(env, s->pc);
- s->pc += 2;
reg = AREG(insn, 0);
tmp = tcg_temp_new();
tcg_gen_subi_i32(tmp, QREG_SP, 4);
gen_store(s, OS_LONG, tmp, reg);
- if ((insn & 7) != 7)
+ if ((insn & 7) != 7) {
tcg_gen_mov_i32(reg, tmp);
+ }
tcg_gen_addi_i32(QREG_SP, tmp, offset);
+ tcg_temp_free(tmp);
+}
+
+DISAS_INSN(link)
+{
+ int16_t offset;
+
+ offset = read_im16(env, s);
+ gen_link(s, insn, offset);
+}
+
+DISAS_INSN(linkl)
+{
+ int32_t offset;
+
+ offset = read_im32(env, s);
+ gen_link(s, insn, offset);
}
DISAS_INSN(unlk)
@@ -3059,6 +3074,7 @@ void register_m68k_insns (CPUM68KState *env)
INSN(not, 4600, ff00, M68000);
INSN(undef, 46c0, ffc0, M68000);
INSN(move_to_sr, 46c0, ffc0, CF_ISA_A);
+ INSN(linkl, 4808, fff8, M68000);
BASE(pea, 4840, ffc0);
BASE(swap, 4840, fff8);
INSN(bkpt, 4848, fff8, BKPT);
--
2.7.4
next prev parent reply other threads:[~2016-10-28 8:49 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-28 8:48 [Qemu-devel] [PULL 00/18] M68k part2 patches Laurent Vivier
2016-10-28 8:48 ` [Qemu-devel] [PULL 01/18] target-m68k: add bkpt instruction Laurent Vivier
2016-10-28 8:48 ` Laurent Vivier [this message]
2016-10-28 8:48 ` [Qemu-devel] [PULL 03/18] target-m68k: add exg ops Laurent Vivier
2016-10-28 8:48 ` [Qemu-devel] [PULL 04/18] target-m68k: add addressing modes to scc Laurent Vivier
2016-10-28 8:48 ` [Qemu-devel] [PULL 05/18] target-m68k: add dbcc Laurent Vivier
2016-10-28 8:48 ` [Qemu-devel] [PULL 06/18] target-m68k: Inline addx, subx, negx Laurent Vivier
2016-10-28 8:48 ` [Qemu-devel] [PULL 07/18] target-m68k: add addressing modes to not Laurent Vivier
2016-10-28 8:48 ` [Qemu-devel] [PULL 08/18] target-m68k: eor can manage word and byte operands Laurent Vivier
2016-10-28 8:48 ` [Qemu-devel] [PULL 09/18] target-m68k: or " Laurent Vivier
2016-10-28 8:48 ` [Qemu-devel] [PULL 10/18] target-m68k: and " Laurent Vivier
2016-10-28 8:48 ` [Qemu-devel] [PULL 11/18] target-m68k: suba/adda can manage word operand Laurent Vivier
2016-10-28 8:48 ` [Qemu-devel] [PULL 12/18] target-m68k: some bit ops cleanup Laurent Vivier
2016-10-28 8:48 ` [Qemu-devel] [PULL 13/18] target-m68k: introduce byte and word cc_ops Laurent Vivier
2016-10-28 8:48 ` [Qemu-devel] [PULL 14/18] target-m68k: add addressing modes to neg Laurent Vivier
2016-10-28 8:48 ` [Qemu-devel] [PULL 15/18] target-m68k: add/sub manage word and byte operands Laurent Vivier
2016-10-28 8:48 ` [Qemu-devel] [PULL 16/18] target-m68k: cmp manages word and bytes operands Laurent Vivier
2016-10-28 8:48 ` [Qemu-devel] [PULL 17/18] target-m68k: immediate ops manage word and byte operands Laurent Vivier
2016-10-28 8:48 ` [Qemu-devel] [PULL 18/18] MAINTAINERS: update M68K entry Laurent Vivier
2016-10-28 16:57 ` [Qemu-devel] [PULL 00/18] M68k part2 patches Peter Maydell
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=1477644512-21716-3-git-send-email-laurent@vivier.eu \
--to=laurent@vivier.eu \
--cc=agraf@suse.de \
--cc=gerg@uclinux.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=schwab@linux-m68k.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).