diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-05-08 21:08:41 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-05-08 21:08:41 +0000 |
commit | 2ee73ac3a855fb0cfba3db91fdd1ecebdbc6f971 (patch) | |
tree | 9759c191fd2b12e00749c4ea4b45298c9336c35c /target-i386/op.c | |
parent | 28c3ee3fed3bb51c45320bec1ede3585cd36f8a4 (diff) | |
download | qemu-2ee73ac3a855fb0cfba3db91fdd1ecebdbc6f971.zip |
division by zero FPU exception support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@795 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386/op.c')
-rw-r--r-- | target-i386/op.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/target-i386/op.c b/target-i386/op.c index 1169f121ad..37823319d6 100644 --- a/target-i386/op.c +++ b/target-i386/op.c @@ -1738,12 +1738,12 @@ void OPPROTO op_fsubr_ST0_FT0(void) void OPPROTO op_fdiv_ST0_FT0(void) { - ST0 /= FT0; + ST0 = helper_fdiv(ST0, FT0); } void OPPROTO op_fdivr_ST0_FT0(void) { - ST0 = FT0 / ST0; + ST0 = helper_fdiv(FT0, ST0); } /* fp operations between STN and ST0 */ @@ -1772,14 +1772,16 @@ void OPPROTO op_fsubr_STN_ST0(void) void OPPROTO op_fdiv_STN_ST0(void) { - ST(PARAM1) /= ST0; + CPU86_LDouble *p; + p = &ST(PARAM1); + *p = helper_fdiv(*p, ST0); } void OPPROTO op_fdivr_STN_ST0(void) { CPU86_LDouble *p; p = &ST(PARAM1); - *p = ST0 / *p; + *p = helper_fdiv(ST0, *p); } /* misc FPU operations */ @@ -1959,6 +1961,13 @@ void OPPROTO op_fclex(void) env->fpus &= 0x7f00; } +void OPPROTO op_fwait(void) +{ + if (env->fpus & FPUS_SE) + fpu_raise_exception(); + FORCE_RET(); +} + void OPPROTO op_fninit(void) { env->fpus = 0; |