VirtualBox

Changeset 11455 in vbox


Ignore:
Timestamp:
Aug 18, 2008 8:47:54 AM (16 years ago)
Author:
vboxsync
Message:

gcc-4.3 testmath fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/Sun/testmath.c

    r8189 r11455  
    1818#endif
    1919
    20 #if defined(__GNUC__) && ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) || (__GNUC__ > 4))
    21   /* gcc starting with version 4.3 uses the MPFR library which results in more accurate results */
    22 # define SIN180 -0.8011526357338304777463731115L
    23 #else
    24 # define SIN180 -0.801152635733830477871L
    25 #endif
     20/* gcc starting with version 4.3 uses the MPFR library which results in more accurate results. gcc-4.3.1 seems to emit the less accurate result. So just allow both results. */
     21#define SIN180a -0.8011526357338304777463731115L
     22#define SIN180b -0.801152635733830477871L
    2623
    2724static void bitch(const char *pszWhat, const long double *plrdResult, const long double *plrdExpected)
     
    5451extern int testsin(void)
    5552{
    56     return sinl(180.0L) == SIN180;
     53    return sinl(180.0L) == SIN180a || sinl(180.0L) == SIN180b;
    5754}
    5855
     
    292289    lrd = 180.0L;
    293290    CHECK(sinl(lrd), -0.801152635733830477871L);
     291#if 0
    294292    CHECK(sinl(180.0L), SIN180);
     293#else
     294    lrdExpect = SIN180a;
     295    lrdResult = sinl(180.0L);
     296    if (lrdResult != lrdExpect)
     297    {
     298        lrdExpect = SIN180b;
     299        if (lrdResult != lrdExpect)
     300        {
     301            bitch("sinl(180.0L)",  &lrdResult, &lrdExpect);
     302            cErrors++;
     303        }
     304    }
     305#endif
    295306    CHECKLL(testsin(), 1);
    296307
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette