aboutsummaryrefslogtreecommitdiff
path: root/target/m68k/helper.c
diff options
context:
space:
mode:
authorLaurent Vivier <laurent@vivier.eu>2017-06-20 22:51:20 +0200
committerLaurent Vivier <laurent@vivier.eu>2017-06-21 22:11:55 +0200
commitba62494483ab51ee31c70952b6ce5171a31860b1 (patch)
tree34879597689b9df1d8b8e9548051e1abdbb66e5f /target/m68k/helper.c
parent5a4526b26ab22b255126301227c5ceb2f0222bc5 (diff)
target-m68k: add FPCR and FPSR
Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <rth@twiddle.net> Message-Id: <20170620205121.26515-6-laurent@vivier.eu>
Diffstat (limited to 'target/m68k/helper.c')
-rw-r--r--target/m68k/helper.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/target/m68k/helper.c b/target/m68k/helper.c
index f2de6b5097..caae29100c 100644
--- a/target/m68k/helper.c
+++ b/target/m68k/helper.c
@@ -80,8 +80,14 @@ static int cf_fpu_gdb_get_reg(CPUM68KState *env, uint8_t *mem_buf, int n)
stfq_p(mem_buf, floatx80_to_float64(env->fregs[n].d, &s));
return 8;
}
- if (n < 11) {
- /* FP control registers (not implemented) */
+ switch (n) {
+ case 8: /* fpcontrol */
+ stl_be_p(mem_buf, env->fpcr);
+ return 4;
+ case 9: /* fpstatus */
+ stl_be_p(mem_buf, env->fpsr);
+ return 4;
+ case 10: /* fpiar, not implemented */
memset(mem_buf, 0, 4);
return 4;
}
@@ -95,8 +101,14 @@ static int cf_fpu_gdb_set_reg(CPUM68KState *env, uint8_t *mem_buf, int n)
env->fregs[n].d = float64_to_floatx80(ldfq_p(mem_buf), &s);
return 8;
}
- if (n < 11) {
- /* FP control registers (not implemented) */
+ switch (n) {
+ case 8: /* fpcontrol */
+ cpu_m68k_set_fpcr(env, ldl_p(mem_buf));
+ return 4;
+ case 9: /* fpstatus */
+ env->fpsr = ldl_p(mem_buf);
+ return 4;
+ case 10: /* fpiar, not implemented */
return 4;
}
return 0;
@@ -133,7 +145,7 @@ static int m68k_fpu_gdb_set_reg(CPUM68KState *env, uint8_t *mem_buf, int n)
}
switch (n) {
case 8: /* fpcontrol */
- env->fpcr = ldl_p(mem_buf);
+ cpu_m68k_set_fpcr(env, ldl_p(mem_buf));
return 4;
case 9: /* fpstatus */
env->fpsr = ldl_p(mem_buf);