aboutsummaryrefslogtreecommitdiff
path: root/target-i386/op.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-05-12 19:32:15 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-05-12 19:32:15 +0000
commit7d3505c55aae54c9610e8be1ff476ec8849c98e6 (patch)
tree8e8b024b2e8b547dc48d8024fe5b3001a7c46c0d /target-i386/op.c
parentfd872598d8d8cf78c1f12ed9661baf9ac0943c04 (diff)
bsd port (Markus Niemisto)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@800 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386/op.c')
-rw-r--r--target-i386/op.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/target-i386/op.c b/target-i386/op.c
index 37823319d6..fad8a730e7 100644
--- a/target-i386/op.c
+++ b/target-i386/op.c
@@ -1938,6 +1938,24 @@ void OPPROTO op_fldcw_A0(void)
int rnd_type;
env->fpuc = lduw((void *)A0);
/* set rounding mode */
+#ifdef _BSD
+ switch(env->fpuc & RC_MASK) {
+ default:
+ case RC_NEAR:
+ rnd_type = FP_RN;
+ break;
+ case RC_DOWN:
+ rnd_type = FP_RM;
+ break;
+ case RC_UP:
+ rnd_type = FP_RP;
+ break;
+ case RC_CHOP:
+ rnd_type = FP_RZ;
+ break;
+ }
+ fpsetround(rnd_type);
+#else
switch(env->fpuc & RC_MASK) {
default:
case RC_NEAR:
@@ -1954,6 +1972,7 @@ void OPPROTO op_fldcw_A0(void)
break;
}
fesetround(rnd_type);
+#endif
}
void OPPROTO op_fclex(void)