From 1984aabe8362ee2b29711d2fa08e56e341eafddd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 10 Nov 2005 05:10:25 +0000 Subject: Move code to enable FP exceptions into debug.c (set MESA_DEBUG=fpexceptions). Get rid of MESA_DEBUG preprocessor symbol, just use DEBUG instead. --- src/mesa/main/debug.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/mesa/main/debug.c') diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index c21122080b..98ca65b96a 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -149,7 +149,7 @@ void _mesa_print_info( void ) */ static void add_debug_flags( const char *debug ) { -#ifdef MESA_DEBUG +#ifdef DEBUG if (_mesa_strstr(debug, "varray")) MESA_VERBOSE |= VERBOSE_VARRAY; @@ -184,6 +184,18 @@ static void add_debug_flags( const char *debug ) */ if (_mesa_strstr(debug, "flush")) MESA_DEBUG_FLAGS |= DEBUG_ALWAYS_FLUSH; + +#if defined(_FPU_GETCW) && defined(_FPU_SETCW) + if (_mesa_strstr(debug, "fpexceptions")) { + /* raise FP exceptions */ + fpu_control_t mask; + _FPU_GETCW(mask); + mask &= ~(_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM + | _FPU_MASK_OM | _FPU_MASK_UM); + _FPU_SETCW(mask); + } +#endif + #else (void) debug; #endif -- cgit v1.2.3