Ignore:
Timestamp:
11/10/06 22:04:46 (17 years ago)
Author:
zorg
Message:

Remove math aliasing issues which were breaking gcc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mppenc/trunk/src/fastmath.c

    r97 r109  
    1919
    2020#include "mppenc.h"
     21#include "fastmath.h"
    2122
    2223#ifdef FAST_MATH
     
    3031void   Init_FastMath ( void )
    3132{
    32     int     i;
    33     float   X;
    34     float   Y;
    35     double  xm;
    36     double  x0;
    37     double  xp;
    38     double  x;
    39     double  y;
    40     float*  p;
     33    int i; mpc_floatint X, Y; double xm, x0, xp, x, y; float* p;
    4134
    4235    p = (float*) tabatan2;
     
    6457    p = (float*) tabsqrt_ex;
    6558    for ( i = 0; i < 255; i++ ) {
    66         *(int*)&X = (i << 23);
    67         *(int*)&Y = (i << 23) + (1<<23) - 1;
    68         *p++ = sqrt(X);
     59        X.n = (i << 23);
     60        Y.n = (i << 23) + (1<<23) - 1;
     61        *p++ = sqrt(X.f);
    6962    }
    70     *(int*)&X = (255 << 23) - 1;
    71     *p++ = sqrt(X);
     63    X.n = (255 << 23) - 1;
     64    *p++ = sqrt(X.f);
    7265
    7366    p = (float*) tabsqrt_m;
Note: See TracChangeset for help on using the changeset viewer.