qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: qemu-devel@nongnu.org
Cc: Blue Swirl <blauwirbel@gmail.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Max Filippov <jcmvbkbc@gmail.com>
Subject: [Qemu-devel] [PATCH v2 06/10] target-xtensa: implement LSCX and LSCI groups
Date: Sun,  9 Sep 2012 20:04:35 +0400	[thread overview]
Message-ID: <1347206679-428-7-git-send-email-jcmvbkbc@gmail.com> (raw)
In-Reply-To: <1347206679-428-1-git-send-email-jcmvbkbc@gmail.com>

These are load/store instructions for FP registers with immediate or
register index and optional base post-update.
See ISA, 4.3.10 for more details.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 target-xtensa/translate.c |   58 +++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 54 insertions(+), 4 deletions(-)

diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
index 97c388a..d167e9d 100644
--- a/target-xtensa/translate.c
+++ b/target-xtensa/translate.c
@@ -1825,8 +1825,33 @@ static void disas_xtensa_insn(DisasContext *dc)
             break;
 
         case 8: /*LSCXp*/
-            HAS_OPTION(XTENSA_OPTION_COPROCESSOR);
-            TBD();
+            switch (OP2) {
+            case 0: /*LSXf*/
+            case 1: /*LSXUf*/
+            case 4: /*SSXf*/
+            case 5: /*SSXUf*/
+                HAS_OPTION(XTENSA_OPTION_FP_COPROCESSOR);
+                gen_window_check2(dc, RRR_S, RRR_T);
+                {
+                    TCGv_i32 addr = tcg_temp_new_i32();
+                    tcg_gen_add_i32(addr, cpu_R[RRR_S], cpu_R[RRR_T]);
+                    gen_load_store_alignment(dc, 2, addr, false);
+                    if (OP2 & 0x4) {
+                        tcg_gen_qemu_st32(cpu_FR[RRR_R], addr, dc->cring);
+                    } else {
+                        tcg_gen_qemu_ld32u(cpu_FR[RRR_R], addr, dc->cring);
+                    }
+                    if (OP2 & 0x1) {
+                        tcg_gen_mov_i32(cpu_R[RRR_S], addr);
+                    }
+                    tcg_temp_free(addr);
+                }
+                break;
+
+            default: /*reserved*/
+                RESERVED();
+                break;
+            }
             break;
 
         case 9: /*LSC4*/
@@ -2100,8 +2125,33 @@ static void disas_xtensa_insn(DisasContext *dc)
         break;
 
     case 3: /*LSCIp*/
-        HAS_OPTION(XTENSA_OPTION_COPROCESSOR);
-        TBD();
+        switch (RRI8_R) {
+        case 0: /*LSIf*/
+        case 4: /*SSIf*/
+        case 8: /*LSIUf*/
+        case 12: /*SSIUf*/
+            HAS_OPTION(XTENSA_OPTION_FP_COPROCESSOR);
+            gen_window_check1(dc, RRI8_S);
+            {
+                TCGv_i32 addr = tcg_temp_new_i32();
+                tcg_gen_addi_i32(addr, cpu_R[RRI8_S], RRI8_IMM8 << 2);
+                gen_load_store_alignment(dc, 2, addr, false);
+                if (RRI8_R & 0x4) {
+                    tcg_gen_qemu_st32(cpu_FR[RRI8_T], addr, dc->cring);
+                } else {
+                    tcg_gen_qemu_ld32u(cpu_FR[RRI8_T], addr, dc->cring);
+                }
+                if (RRI8_R & 0x8) {
+                    tcg_gen_mov_i32(cpu_R[RRI8_S], addr);
+                }
+                tcg_temp_free(addr);
+            }
+            break;
+
+        default: /*reserved*/
+            RESERVED();
+            break;
+        }
         break;
 
     case 4: /*MAC16d*/
-- 
1.7.7.6

  parent reply	other threads:[~2012-09-09 16:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-09 16:04 [Qemu-devel] [PATCH v2 00/10] target-xtensa: implement FP coprocessor option Max Filippov
2012-09-09 16:04 ` [Qemu-devel] [PATCH v2 01/10] softfloat: make float_muladd_negate_* flags independent Max Filippov
2012-09-09 16:04 ` [Qemu-devel] [PATCH v2 02/10] softfloat: add NO_SIGNALING_NANS Max Filippov
2012-09-09 16:18   ` Peter Maydell
2012-09-09 16:04 ` [Qemu-devel] [PATCH v2 03/10] target-xtensa: handle boolean option in overlays Max Filippov
2012-09-09 16:04 ` [Qemu-devel] [PATCH v2 04/10] target-xtensa: specialize softfloat NaN rules Max Filippov
2012-09-09 16:04 ` [Qemu-devel] [PATCH v2 05/10] target-xtensa: add FP registers Max Filippov
2012-09-09 16:04 ` Max Filippov [this message]
2012-09-09 16:04 ` [Qemu-devel] [PATCH v2 07/10] target-xtensa: implement FP0 arithmetic Max Filippov
2012-09-09 16:04 ` [Qemu-devel] [PATCH v2 08/10] target-xtensa: implement FP0 conversions Max Filippov
2012-09-09 16:16   ` Peter Maydell
2012-09-09 16:38     ` Max Filippov
2012-09-09 17:24       ` Marc Gauthier
2012-09-09 18:39         ` Max Filippov
2012-09-19  0:28       ` Max Filippov
2012-09-09 16:04 ` [Qemu-devel] [PATCH v2 09/10] target-xtensa: implement FP1 group Max Filippov
2012-09-09 16:04 ` [Qemu-devel] [PATCH v2 10/10] target-xtensa: implement coprocessor context option Max Filippov

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=1347206679-428-7-git-send-email-jcmvbkbc@gmail.com \
    --to=jcmvbkbc@gmail.com \
    --cc=blauwirbel@gmail.com \
    --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).