Ignore:
Timestamp:
Aug 28, 2011, 11:07:09 PM (10 years ago)
Author:
sam
Message:

test: augment the half precision numbers testsuite.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/lol-bench.cpp

    r868 r870  
    2323    Timer timer;
    2424
     25    float ftotal = 0.0f;
     26    for (uint32_t i = 0; i < 0xffffffffu; i += 7)
     27    {
     28        union { float f; uint32_t x; } u;
     29        u.x = i;
     30
     31        float h = (float)half::makefast(u.f);
     32        ftotal += h;
     33    }
     34    Log::Info("time for makeslow: %f (hash %f)\n", timer.GetMs(), ftotal);
     35
    2536    uint16_t total = 0;
    26     for (uint32_t i = 0; i < 0xffffffffu; i++)
     37    for (uint32_t i = 0; i < 0xffffffffu; i += 7)
    2738    {
    2839        union { float f; uint32_t x; } u;
     
    3445    Log::Info("time for makeslow: %f (hash %04x)\n", timer.GetMs(), total);
    3546
    36     for (uint32_t i = 0; i < 0xffffffffu; i++)
     47    for (uint32_t i = 0; i < 0xffffffffu; i += 7)
    3748    {
    3849        union { float f; uint32_t x; } u;
Note: See TracChangeset for help on using the changeset viewer.