summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Forsyth <charles.forsyth@gmail.com>2016-03-16 21:20:19 +0000
committerCharles Forsyth <charles.forsyth@gmail.com>2016-03-16 21:20:19 +0000
commita9a2bdd7c75a381b92a3356435a2402fd953ec77 (patch)
tree630fec9daf73f1a553fb133a8357d095f88a90eb
parentb1f3c80adb9d8c82abb94562a4e060cb12bdfca0 (diff)
save hardware fp status
-rw-r--r--emu/Plan9/asm-arm.s10
1 files changed, 10 insertions, 0 deletions
diff --git a/emu/Plan9/asm-arm.s b/emu/Plan9/asm-arm.s
index 4b9ab724..a6fbc071 100644
--- a/emu/Plan9/asm-arm.s
+++ b/emu/Plan9/asm-arm.s
@@ -1,3 +1,9 @@
+/* for VFP */
+#define VMRS(fp, cpu) WORD $(0xeef00a10 | (fp)<<16 | (cpu)<<12) /* FP → arm */
+#define VMSR(cpu, fp) WORD $(0xeee00a10 | (fp)<<16 | (cpu)<<12) /* arm → FP */
+
+#define Fpscr 1
+
TEXT tramp(SB), 1, $0
MOVW fn+4(FP), R1 /* func to exec */
MOVW arg+8(FP), R2 /* argument */
@@ -16,7 +22,11 @@
RET
TEXT FPsave(SB), 1, $0
+ VMRS(Fpscr, 1)
+ MOVW R1, 0(R0)
RET
TEXT FPrestore(SB), 1, $0
+ MOVW (R0), R0
+ VMSR(0, Fpscr)
RET