Ignore:
Timestamp:
May 23, 2000, 10:41:28 PM (25 years ago)
Author:
jeroen
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/opengl/mesa/mmath.c

    r2938 r3598  
    1 /* $Id: mmath.c,v 1.1 2000-02-29 00:50:07 sandervl Exp $ */
     1/* $Id: mmath.c,v 1.2 2000-05-23 20:40:41 jeroen Exp $ */
    22
    33/*
    44 * Mesa 3-D graphics library
    5  * Version:  3.1
     5 * Version:  3.3
    66 *
    77 * Copyright (C) 1999  Brian Paul   All Rights Reserved.
     
    2424 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    2525 */
    26 /* $XFree86: xc/lib/GL/mesa/src/mmath.c,v 1.2 1999/04/04 00:20:28 dawes Exp $ */
    27 
    28 
    29 
    3026
    3127
     
    3329#include "all.h"
    3430#else
    35 #ifndef XFree86Server
    36 #include <math.h>
    37 #else
    38 #include "GL/xf86glx.h"
    39 #endif
    40 #include "gl.h"
     31#include "glheader.h"
    4132#include "mmath.h"
    4233#endif
     
    4435
    4536static int in_fast_math;
    46 
    4737
    4838/*
     
    5747 * SPARC floating point format is as follows:
    5848 *
    59  * BIT 31       30      23      22      0
    60  *     sign     exponent        mantissa
     49 * BIT 31       30      23      22      0
     50 *     sign     exponent        mantissa
    6151 */
    6252static short sqrttab[0x100];    /* declare table of square roots */
     
    10090   }
    10191#else
    102    (void) sqrttab;  /* silence compiler warning - unused var */
    103 #endif
     92   (void) sqrttab;  /* silence compiler warnings */
     93#endif /*FAST_MATH*/
    10494}
    10595
     
    152142 * Initialize tables, etc for fast math functions.
    153143 */
    154 void gl_init_math(void)
     144void _mesa_init_math(void)
    155145{
    156146   static GLboolean initialized = GL_FALSE;
     
    162152      initialized = GL_TRUE;
    163153      in_fast_math = 0;
     154
     155#if defined(_FPU_GETCW) && defined(_FPU_SETCW)
     156      {
     157         const char *debug = getenv("MESA_DEBUG");
     158         if (debug && strcmp(debug, "FP")==0) {
     159            /* die on FP exceptions */
     160            fpu_control_t mask;
     161            _FPU_GETCW(mask);
     162            mask &= ~(_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM
     163                      | _FPU_MASK_OM | _FPU_MASK_UM);
     164            _FPU_SETCW(mask);
     165         }
     166      }
     167#endif
    164168   }
    165169}
Note: See TracChangeset for help on using the changeset viewer.