diff options
-rw-r--r-- | include/asm-sparc/sfp-machine.h | 6 | ||||
-rw-r--r-- | include/asm-sparc64/sfp-machine.h | 2 | ||||
-rw-r--r-- | include/math-emu/op-common.h | 5 | ||||
-rw-r--r-- | include/math-emu/soft-fp.h | 7 |
4 files changed, 19 insertions, 1 deletions
diff --git a/include/asm-sparc/sfp-machine.h b/include/asm-sparc/sfp-machine.h index ecfc86a4a725..266a42b8f99f 100644 --- a/include/asm-sparc/sfp-machine.h +++ b/include/asm-sparc/sfp-machine.h | |||
@@ -203,4 +203,10 @@ extern struct task_struct *last_task_used_math; | |||
203 | #define FP_INHIBIT_RESULTS ((last_task_used_math->thread.fsr >> 23) & _fex) | 203 | #define FP_INHIBIT_RESULTS ((last_task_used_math->thread.fsr >> 23) & _fex) |
204 | #endif | 204 | #endif |
205 | 205 | ||
206 | #ifdef CONFIG_SMP | ||
207 | #define FP_TRAPPING_EXCEPTIONS ((current->thread.fsr >> 23) & 0x1f) | ||
208 | #else | ||
209 | #define FP_TRAPPING_EXCEPTIONS ((last_task_used_math->thread.fsr >> 23) & 0x1f) | ||
210 | #endif | ||
211 | |||
206 | #endif | 212 | #endif |
diff --git a/include/asm-sparc64/sfp-machine.h b/include/asm-sparc64/sfp-machine.h index 89d42431efb5..c9331b02d9c8 100644 --- a/include/asm-sparc64/sfp-machine.h +++ b/include/asm-sparc64/sfp-machine.h | |||
@@ -88,4 +88,6 @@ | |||
88 | 88 | ||
89 | #define FP_INHIBIT_RESULTS ((current_thread_info()->xfsr[0] >> 23) & _fex) | 89 | #define FP_INHIBIT_RESULTS ((current_thread_info()->xfsr[0] >> 23) & _fex) |
90 | 90 | ||
91 | #define FP_TRAPPING_EXCEPTIONS ((current_thread_info()->xfsr[0] >> 23) & 0x1f) | ||
92 | |||
91 | #endif | 93 | #endif |
diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h index 93780abd01bc..bb46e7645d53 100644 --- a/include/math-emu/op-common.h +++ b/include/math-emu/op-common.h | |||
@@ -145,13 +145,16 @@ do { \ | |||
145 | { \ | 145 | { \ |
146 | X##_e = 1; \ | 146 | X##_e = 1; \ |
147 | _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \ | 147 | _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \ |
148 | FP_SET_EXCEPTION(FP_EX_INEXACT); \ | ||
148 | } \ | 149 | } \ |
149 | else \ | 150 | else \ |
150 | { \ | 151 | { \ |
151 | X##_e = 0; \ | 152 | X##_e = 0; \ |
152 | _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ | 153 | _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ |
153 | FP_SET_EXCEPTION(FP_EX_UNDERFLOW); \ | ||
154 | } \ | 154 | } \ |
155 | if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT) || \ | ||
156 | (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW)) \ | ||
157 | FP_SET_EXCEPTION(FP_EX_UNDERFLOW); \ | ||
155 | } \ | 158 | } \ |
156 | else \ | 159 | else \ |
157 | { \ | 160 | { \ |
diff --git a/include/math-emu/soft-fp.h b/include/math-emu/soft-fp.h index d02eb64a865b..a0721ef5c2f9 100644 --- a/include/math-emu/soft-fp.h +++ b/include/math-emu/soft-fp.h | |||
@@ -97,12 +97,19 @@ | |||
97 | #define FP_INHIBIT_RESULTS 0 | 97 | #define FP_INHIBIT_RESULTS 0 |
98 | #endif | 98 | #endif |
99 | 99 | ||
100 | #ifndef FP_TRAPPING_EXCEPTIONS | ||
101 | #define FP_TRAPPING_EXCPETIONS 0 | ||
102 | #endif | ||
103 | |||
100 | #define FP_SET_EXCEPTION(ex) \ | 104 | #define FP_SET_EXCEPTION(ex) \ |
101 | _fex |= (ex) | 105 | _fex |= (ex) |
102 | 106 | ||
103 | #define FP_UNSET_EXCEPTION(ex) \ | 107 | #define FP_UNSET_EXCEPTION(ex) \ |
104 | _fex &= ~(ex) | 108 | _fex &= ~(ex) |
105 | 109 | ||
110 | #define FP_CUR_EXCEPTIONS \ | ||
111 | (_fex) | ||
112 | |||
106 | #define FP_CLEAR_EXCEPTIONS \ | 113 | #define FP_CLEAR_EXCEPTIONS \ |
107 | _fex = 0 | 114 | _fex = 0 |
108 | 115 | ||