From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [Qemu-devel] [PULL 15/24] target/hppa: Convert fp indexed memory insns
Date: Mon, 11 Feb 2019 20:57:12 -0800 [thread overview]
Message-ID: <20190212045721.28041-16-richard.henderson@linaro.org> (raw)
In-Reply-To: <20190212045721.28041-1-richard.henderson@linaro.org>
Tested-by: Helge Deller <deller@gmx.de>
Tested-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/hppa/translate.c | 93 ----------------------------------------
target/hppa/insns.decode | 21 +++++++++
2 files changed, 21 insertions(+), 93 deletions(-)
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 4ce65bcc61..4ecd522e51 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -855,15 +855,6 @@ static void gen_goto_tb(DisasContext *ctx, int which,
}
}
-/* PA has a habit of taking the LSB of a field and using that as the sign,
- with the rest of the field becoming the least significant bits. */
-static target_sreg low_sextract(uint32_t val, int pos, int len)
-{
- target_ureg x = -(target_ureg)extract32(val, pos, 1);
- x = (x << (len - 1)) | extract32(val, pos + 1, len - 1);
- return x;
-}
-
static unsigned assemble_rt64(uint32_t insn)
{
unsigned r1 = extract32(insn, 6, 1);
@@ -2981,84 +2972,6 @@ static bool trans_ldo(DisasContext *ctx, arg_ldo *a)
return true;
}
-static bool trans_copr_w(DisasContext *ctx, uint32_t insn)
-{
- unsigned t0 = extract32(insn, 0, 5);
- unsigned m = extract32(insn, 5, 1);
- unsigned t1 = extract32(insn, 6, 1);
- unsigned ext3 = extract32(insn, 7, 3);
- /* unsigned cc = extract32(insn, 10, 2); */
- unsigned i = extract32(insn, 12, 1);
- unsigned ua = extract32(insn, 13, 1);
- unsigned sp = extract32(insn, 14, 2);
- unsigned rx = extract32(insn, 16, 5);
- unsigned rb = extract32(insn, 21, 5);
- unsigned rt = t1 * 32 + t0;
- int modify = (m ? (ua ? -1 : 1) : 0);
- int disp, scale;
-
- if (i == 0) {
- scale = (ua ? 2 : 0);
- disp = 0;
- modify = m;
- } else {
- disp = low_sextract(rx, 0, 5);
- scale = 0;
- rx = 0;
- modify = (m ? (ua ? -1 : 1) : 0);
- }
-
- switch (ext3) {
- case 0: /* FLDW */
- do_floadw(ctx, rt, rb, rx, scale, disp, sp, modify);
- break;
- case 4: /* FSTW */
- do_fstorew(ctx, rt, rb, rx, scale, disp, sp, modify);
- break;
- default:
- return gen_illegal(ctx);
- }
- return true;
-}
-
-static bool trans_copr_dw(DisasContext *ctx, uint32_t insn)
-{
- unsigned rt = extract32(insn, 0, 5);
- unsigned m = extract32(insn, 5, 1);
- unsigned ext4 = extract32(insn, 6, 4);
- /* unsigned cc = extract32(insn, 10, 2); */
- unsigned i = extract32(insn, 12, 1);
- unsigned ua = extract32(insn, 13, 1);
- unsigned sp = extract32(insn, 14, 2);
- unsigned rx = extract32(insn, 16, 5);
- unsigned rb = extract32(insn, 21, 5);
- int modify = (m ? (ua ? -1 : 1) : 0);
- int disp, scale;
-
- if (i == 0) {
- scale = (ua ? 3 : 0);
- disp = 0;
- modify = m;
- } else {
- disp = low_sextract(rx, 0, 5);
- scale = 0;
- rx = 0;
- modify = (m ? (ua ? -1 : 1) : 0);
- }
-
- switch (ext4) {
- case 0: /* FLDD */
- do_floadd(ctx, rt, rb, rx, scale, disp, sp, modify);
- break;
- case 8: /* FSTD */
- do_fstored(ctx, rt, rb, rx, scale, disp, sp, modify);
- break;
- default:
- return gen_illegal(ctx);
- }
- return true;
-}
-
static bool do_cmpb(DisasContext *ctx, unsigned r, TCGv_reg in1,
unsigned c, unsigned f, unsigned n, int disp)
{
@@ -4211,12 +4124,6 @@ static void translate_one(DisasContext *ctx, uint32_t insn)
opc = extract32(insn, 26, 6);
switch (opc) {
- case 0x09:
- trans_copr_w(ctx, insn);
- return;
- case 0x0B:
- trans_copr_dw(ctx, insn);
- return;
case 0x0C:
translate_table(ctx, insn, table_float_0c);
return;
diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode
index 40b23823d0..25ac09d9d6 100644
--- a/target/hppa/insns.decode
+++ b/target/hppa/insns.decode
@@ -38,6 +38,7 @@
%sm_imm 16:10 !function=expand_sm_imm
%rm64 1:1 16:5
+%rt64 6:1 0:5
%im5_0 0:s1 1:4
%im5_16 16:s1 17:4
@@ -195,6 +196,26 @@ lda 000011 ..... ..... .. . 0 -- 0110 ...... @ldstx size=2
sta 000011 ..... ..... .. . 1 -- 1110 ...... @stim5 size=2
stby 000011 b:5 r:5 sp:2 a:1 1 -- 1100 m:1 ..... disp=%im5_0
+@fldstwx ...... b:5 x:5 sp:2 scale:1 ....... m:1 ..... \
+ &ldst t=%rt64 disp=0 size=2
+@fldstwi ...... b:5 ..... sp:2 . ....... . ..... \
+ &ldst t=%rt64 disp=%im5_16 m=%ma_to_m x=0 scale=0 size=2
+
+fldw 001001 ..... ..... .. . 0 -- 000 . . ..... @fldstwx
+fldw 001001 ..... ..... .. . 1 -- 000 . . ..... @fldstwi
+fstw 001001 ..... ..... .. . 0 -- 100 . . ..... @fldstwx
+fstw 001001 ..... ..... .. . 1 -- 100 . . ..... @fldstwi
+
+@fldstdx ...... b:5 x:5 sp:2 scale:1 ....... m:1 t:5 \
+ &ldst disp=0 size=3
+@fldstdi ...... b:5 ..... sp:2 . ....... . t:5 \
+ &ldst disp=%im5_16 m=%ma_to_m x=0 scale=0 size=3
+
+fldd 001011 ..... ..... .. . 0 -- 000 0 . ..... @fldstdx
+fldd 001011 ..... ..... .. . 1 -- 000 0 . ..... @fldstdi
+fstd 001011 ..... ..... .. . 0 -- 100 0 . ..... @fldstdx
+fstd 001011 ..... ..... .. . 1 -- 100 0 . ..... @fldstdi
+
####
# Offset Mem
####
--
2.17.2
next prev parent reply other threads:[~2019-02-12 4:58 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-12 4:56 [Qemu-devel] [PULL 00/24] target/hppa patch queue Richard Henderson
2019-02-12 4:56 ` [Qemu-devel] [PULL 01/24] target/hppa: Use DisasContextBase.is_jmp Richard Henderson
2019-02-12 4:56 ` [Qemu-devel] [PULL 02/24] target/hppa: Begin using scripts/decodetree.py Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 03/24] target/hppa: Convert move to/from system registers Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 04/24] target/hppa: Convert remainder of system insns Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 05/24] target/hppa: Unify specializations of OR Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 06/24] target/hppa: Convert memory management insns Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 07/24] target/hppa: Convert arithmetic/logical insns Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 08/24] target/hppa: Convert indexed memory insns Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 09/24] target/hppa: Convert fp multiply-add Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 10/24] target/hppa: Convert conditional branches Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 11/24] target/hppa: Convert shift, extract, deposit insns Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 12/24] target/hppa: Convert direct and indirect branches Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 13/24] target/hppa: Convert arithmetic immediate insns Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 14/24] target/hppa: Convert offset memory insns Richard Henderson
2019-02-12 4:57 ` Richard Henderson [this message]
2019-02-12 4:57 ` [Qemu-devel] [PULL 16/24] target/hppa: Convert halt/reset insns Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 17/24] target/hppa: Convert fp fused multiply-add insns Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 18/24] target/hppa: Convert fp operate insns Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 19/24] target/hppa: Merge translate_one into hppa_tr_translate_insn Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 20/24] target/hppa: move GETPC to HELPER() functions Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 21/24] target/hppa: Rearrange log conditions Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 22/24] target/hppa: Fix addition '</<=' conditions Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 23/24] target/hppa: fix dcor instruction Richard Henderson
2019-02-12 4:57 ` [Qemu-devel] [PULL 24/24] hw/hppa: forward requests to CPU HPA Richard Henderson
2019-02-12 13:15 ` [Qemu-devel] [PULL 00/24] target/hppa patch queue Peter Maydell
2019-02-13 18:40 ` Philippe Mathieu-Daudé
2019-02-14 10:04 ` Peter Maydell
2019-02-14 11:32 ` Philippe Mathieu-Daudé
2019-02-13 16:33 ` no-reply
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=20190212045721.28041-16-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=peter.maydell@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).