SH4: Implement FD bit
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 7 Dec 2008 22:46:31 +0000 (22:46 +0000)
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 7 Dec 2008 22:46:31 +0000 (22:46 +0000)
commitd8299bccf265b72db967a064e8151660b78cdfae
treed4333d881e01ccea7680165495345d8b05aa14e9
parent54604f74ae618aca3715cf0d8cb2ede923c0d6c0
SH4: Implement FD bit

SH4 manual say that if a floating point instruction is executed while
FD bit in the status register is 1, an exception should be raised. QEMU
presently does not do that, so the kernel does not initialize FP state
for any thread, nor does it save/restore FP state. The most apparent
consequence is that while recent gcc/libc expect double-precision mode
to be set by kernel, they run in single-precision mode, and all FP code
produces wrong values.

This patch fixes this. It also fixes a couple of places where PC was
not updated before handling an exception, although both those places
deal with invalid instruction and don't lead to any user-visible bugs.

(Vladimir Prus)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5937 c046a42c-6fe2-441c-8c8c-71466251a162
target-sh4/cpu.h
target-sh4/helper.h
target-sh4/op_helper.c
target-sh4/translate.c