Skip to contentSkip to conversation

qemu sh4 fmov et al

PATCH New [email protected] 1 participant 1 message May 11, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu sh4 fmov et al

I've been working on the sh4 target, mostly adding floating-point instructions needed to run some of debian's sh4 userland. These instructions include: fmov, frchg, fschg, sts and lds to/from fpul and fpscr, fsts, flds, and maybe some others. I'm posting my work now to avoid duplication by other people.

Index: qemu/target-sh4/cpu.h
===================================================================
RCS file: /sources/qemu/qemu/target-sh4/cpu.h,v
retrieving revision 1.1

target-sh4/cpu.h +6 -0
diff -u -r1.1 cpu.h
@@ -27,6 +27,8 @@
 
 #include "cpu-defs.h"
 
+#include "softfloat.h"
+
 #define TARGET_PAGE_BITS 12	/* 4k XXXXX */
 
 #define SR_MD (1 << 30)
@@ -90,6 +92,10 @@
     uint32_t fpscr;		/* floating point status/control register */
     uint32_t fpul;		/* floating point communication register */
 
+    /* temporary float registers */
+    float32 ft0, ft1;
+    float64 dt0, dt1;
+
     /* Those belong to the specific unit (SH7750) but are handled here */
     uint32_t mmucr;		/* MMU control register */
     uint32_t pteh;		/* page table entry high register */

Index: qemu/target-sh4/exec.h
===================================================================
RCS file: /sources/qemu/qemu/target-sh4/exec.h,v
retrieving revision 1.1

target-sh4/exec.h +5 -0
diff -u -r1.1 exec.h
@@ -28,6 +28,11 @@
 register uint32_t T1 asm(AREG2);
 register uint32_t T2 asm(AREG3);
 
+#define FT0 (env->ft0)
+#define FT1 (env->ft1)
+#define DT0 (env->dt0)
+#define DT1 (env->dt1)
+
 #include "cpu.h"
 #include "exec-all.h"
 

Index: qemu/target-sh4/op.c
===================================================================
RCS file: /sources/qemu/qemu/target-sh4/op.c,v
retrieving revision 1.1

target-sh4/op.c +85 -1

134 lines not on this page · raw message

Index: qemu/target-sh4/op_mem.c
===================================================================
RCS file: /sources/qemu/qemu/target-sh4/op_mem.c,v retrieving revision 1.1

target-sh4/op_mem.c +20 -0
diff -u -r1.1 op_mem.c
@@ -56,3 +56,23 @@
     glue(stl, MEMSUFFIX) (T1, T0);
     RETURN();
 }
+
+void glue(op_ldfl_T0_FT0, MEMSUFFIX) (void) {
+    FT0 = glue(ldfl, MEMSUFFIX) (T0);
+    RETURN();
+}
+
+void glue(op_stfl_FT0_T1, MEMSUFFIX) (void) {
+    glue(stfl, MEMSUFFIX) (T1, FT0);
+    RETURN();
+}
+
+void glue(op_ldfq_T0_DT0, MEMSUFFIX) (void) {
+    DT0 = glue(ldfq, MEMSUFFIX) (T0);
+    RETURN();
+}
+
+void glue(op_stfq_DT0_T1, MEMSUFFIX) (void) {
+    glue(stfq, MEMSUFFIX) (T1, DT0);
+    RETURN();
+}

Index: qemu/target-sh4/translate.c
===================================================================
RCS file: /sources/qemu/qemu/target-sh4/translate.c,v retrieving revision 1.1

target-sh4/translate.c +187 -37

296 lines not on this page · raw message