aboutsummaryrefslogtreecommitdiff
path: root/sys/alpha
diff options
context:
space:
mode:
authorDavid Schultz <das@FreeBSD.org>2004-05-06 09:35:57 +0000
committerDavid Schultz <das@FreeBSD.org>2004-05-06 09:35:57 +0000
commit88ddd9e832bb23dc8e03c0aa33ea1e3a3d034322 (patch)
tree24a61588c22e7d1818a5dc9212c20d0f325b1eec /sys/alpha
parentf71ae83f34031885219b516015b769ca01ed0caf (diff)
downloadsrc-88ddd9e832bb23dc8e03c0aa33ea1e3a3d034322.tar.gz
src-88ddd9e832bb23dc8e03c0aa33ea1e3a3d034322.zip
Don't clear the exception flags after we finish emulating a
floating-point instruction in the kernel. The flags are supposed to be cumulative. Thanks to marcel for helping me test this.
Notes
Notes: svn path=/head/; revision=128997
Diffstat (limited to 'sys/alpha')
-rw-r--r--sys/alpha/alpha/fp_emulate.c2
-rw-r--r--sys/alpha/include/fpu.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/sys/alpha/alpha/fp_emulate.c b/sys/alpha/alpha/fp_emulate.c
index e24ce8895736..243c17273466 100644
--- a/sys/alpha/alpha/fp_emulate.c
+++ b/sys/alpha/alpha/fp_emulate.c
@@ -296,7 +296,7 @@ static int fp_emulate(union alpha_instruction ins, struct thread *td)
td->td_pcb->pcb_fp_control = control;
/* Regenerate the control register */
- fpcr = fpregs->fpr_cr & FPCR_DYN_MASK;
+ fpcr = fpregs->fpr_cr & (FPCR_DYN_MASK | FPCR_STATUS_MASK);
fpcr |= ((control & IEEE_STATUS_MASK)
<< IEEE_STATUS_TO_FPCR_SHIFT);
if (!(control & IEEE_TRAP_ENABLE_INV))
diff --git a/sys/alpha/include/fpu.h b/sys/alpha/include/fpu.h
index 9f4800feeea1..ad539e90451c 100644
--- a/sys/alpha/include/fpu.h
+++ b/sys/alpha/include/fpu.h
@@ -56,6 +56,8 @@
#define FPCR_INED (1LL << 62) /* Inexact Disable */
#define FPCR_SUM (1LL << 63) /* Summary Bit */
#define FPCR_MASK (~0LL << 49)
+#define FPCR_STATUS_MASK (FPCR_INV | FPCR_DZE | FPCR_OVF | \
+ FPCR_UNF | FPCR_INE | FPCR_IOV)
/*
* Exception summary bits.