Example #1
0
int main()
{
   TEST_SET_START("20040928182349EJL","EJL", "rsqrtf4");

   unsigned int i3 =   0x742c4455;
   unsigned int i3r =  0x251c099a;
   unsigned int i4 =   0x75e7753f; 
   unsigned int i4r =  0x243e5fe2;
   unsigned int i5 =   0x4baa9e3c; 
   unsigned int i5r =  0x395dbbeb;
   unsigned int i6 =   0x39344296; 
   unsigned int i6r =  0x429889eb; 
   unsigned int i7 =   0x68a586b0; 
   unsigned int i7r =  0x2ae11e67;

   float x3 = hide_float(make_float(i3));
   float x3r = hide_float(make_float(i3r));   
   float x4 = hide_float(make_float(i4));     
   float x4r = hide_float(make_float(i4r));   
   float x5 = hide_float(make_float(i5));     
   float x5r = hide_float(make_float(i5r));   
   float x6 = hide_float(make_float(i6));     
   float x6r = hide_float(make_float(i6r));   
   float x7 = hide_float(make_float(i7));
   float x7r = hide_float(make_float(i7r));
   
   vec_float4 x3_v = spu_splats(x3);
   vec_float4 x3r_v = spu_splats(x3r);
   vec_float4 x4_v = spu_splats(x4);
   vec_float4 x4r_v = spu_splats(x4r);
   vec_float4 x5_v = spu_splats(x5);
   vec_float4 x5r_v = spu_splats(x5r);
   vec_float4 x6_v = spu_splats(x6);
   vec_float4 x6r_v = spu_splats(x6r);
   vec_float4 x7_v = spu_splats(x7);
   vec_float4 x7r_v = spu_splats(x7r);
   
   vec_float4 res_v;

   TEST_START("rsqrtf4");
   res_v = rsqrtf4(x3_v);
   TEST_CHECK("20040928182352EJL", allequal_ulps_float4( res_v, x3r_v, 2 ), 0);
   res_v = rsqrtf4(x4_v);
   TEST_CHECK("20040928182355EJL", allequal_ulps_float4( res_v, x4r_v, 2 ), 0);
   res_v = rsqrtf4(x5_v);
   TEST_CHECK("20040928182357EJL", allequal_ulps_float4( res_v, x5r_v, 2 ), 0);
   res_v = rsqrtf4(x6_v);
   TEST_CHECK("20040928182358EJL", allequal_ulps_float4( res_v, x6r_v, 2 ), 0);
   res_v = rsqrtf4(x7_v);
   TEST_CHECK("20040928182401EJL", allequal_ulps_float4( res_v, x7r_v, 2 ), 0);
   
   TEST_SET_DONE();
   
   TEST_EXIT();
}
Example #2
0
int main()
{
   TEST_SET_START("20040928182549EJL","EJL", "sqrtf4");

   unsigned int i3 =   0x742c4455;
   unsigned int i3r =  0x59d20034;
   unsigned int i4 =   0x75e7753f; 
   unsigned int i4r =  0x5aac1fb5;
   unsigned int i5 =   0x4baa9e3c; 
   unsigned int i5r =  0x4593c7d8;
   unsigned int i6 =   0x39344296; 
   unsigned int i6r =  0x3c56d14c; 
   unsigned int i7 =   0x68a586b0; 
   unsigned int i7r =  0x54118f09;

   float x3 = hide_float(make_float(i3));
   float x3r = hide_float(make_float(i3r));   
   float x4 = hide_float(make_float(i4));     
   float x4r = hide_float(make_float(i4r));   
   float x5 = hide_float(make_float(i5));     
   float x5r = hide_float(make_float(i5r));   
   float x6 = hide_float(make_float(i6));     
   float x6r = hide_float(make_float(i6r));   
   float x7 = hide_float(make_float(i7));
   float x7r = hide_float(make_float(i7r));
   
   vec_float4 x3_v = spu_splats(x3);
   vec_float4 x3r_v = spu_splats(x3r);
   vec_float4 x4_v = spu_splats(x4);
   vec_float4 x4r_v = spu_splats(x4r);
   vec_float4 x5_v = spu_splats(x5);
   vec_float4 x5r_v = spu_splats(x5r);
   vec_float4 x6_v = spu_splats(x6);
   vec_float4 x6r_v = spu_splats(x6r);
   vec_float4 x7_v = spu_splats(x7);
   vec_float4 x7r_v = spu_splats(x7r);
   
   vec_float4 res_v;

   TEST_START("sqrtf4");
   res_v = sqrtf4(x3_v);
   TEST_CHECK("20040928182552EJL", allequal_ulps_float4( res_v, x3r_v, 2 ), 0);
   res_v = sqrtf4(x4_v);
   TEST_CHECK("20040928182554EJL", allequal_ulps_float4( res_v, x4r_v, 2 ), 0);
   res_v = sqrtf4(x5_v);
   TEST_CHECK("20040928182556EJL", allequal_ulps_float4( res_v, x5r_v, 2 ), 0);
   res_v = sqrtf4(x6_v);
   TEST_CHECK("20040928182557EJL", allequal_ulps_float4( res_v, x6r_v, 2 ), 0);
   res_v = sqrtf4(x7_v);
   TEST_CHECK("20040928182559EJL", allequal_ulps_float4( res_v, x7r_v, 2 ), 0);
   
   TEST_SET_DONE();
   
   TEST_EXIT();
}
Example #3
0
int main()
{
    TEST_SET_START("20040930102649EJL","EJL", "negatef4");

    unsigned int i3n = 0xffffffff;
    unsigned int i3p = 0x7fffffff;

    float x0n = hide_float(-0.0f);
    float x0p = hide_float(0.0f);
    float x1n = hide_float(-83532.96153153f);
    float x1p = hide_float(83532.96153153f);
    float x2n = hide_float(-0.0000000013152f);
    float x2p = hide_float(0.0000000013152f);
    float x3n = hide_float(make_float(i3n));
    float x3p = hide_float(make_float(i3p));

    vec_float4 x0n_v = spu_splats(x0n);
    vec_float4 x0p_v = spu_splats(x0p);
    vec_float4 x1n_v = spu_splats(x1n);
    vec_float4 x1p_v = spu_splats(x1p);
    vec_float4 x2n_v = spu_splats(x2n);
    vec_float4 x2p_v = spu_splats(x2p);
    vec_float4 x3n_v = spu_splats(x3n);
    vec_float4 x3p_v = spu_splats(x3p);

    vec_float4 res_v;

    TEST_START("negatef4");
    res_v = negatef4(x0n_v);
    TEST_CHECK("20040930102652EJL", allequal_float4( res_v, x0p_v ), 0);
    res_v = negatef4(x0p_v);
    TEST_CHECK("20040930102653EJL", allequal_float4( res_v, x0n_v ), 0);
    res_v = negatef4(x1n_v);
    TEST_CHECK("20040930102655EJL", allequal_float4( res_v, x1p_v ), 0);
    res_v = negatef4(x1p_v);
    TEST_CHECK("20040930102657EJL", allequal_float4( res_v, x1n_v ), 0);
    res_v = negatef4(x2n_v);
    TEST_CHECK("20040930102659EJL", allequal_float4( res_v, x2p_v ), 0);
    res_v = negatef4(x2p_v);
    TEST_CHECK("20040930102701EJL", allequal_float4( res_v, x2n_v ), 0);
    res_v = negatef4(x3n_v);
    TEST_CHECK("20040930102703EJL", allequal_float4( res_v, x3p_v ), 0);
    res_v = negatef4(x3p_v);
    TEST_CHECK("20040930102705EJL", allequal_float4( res_v, x3n_v ), 0);

    TEST_SET_DONE();

    TEST_EXIT();
}
Example #4
0
int main()
{
   TEST_SET_START("20040916145017EJL","EJL", "floorf");
   
   unsigned int i3 = 0x4affffff;  // 2^23 - 0.5, largest truncatable value.           
   unsigned int i3i = 0x4afffffe;                                                      
   unsigned int i4 = 0x4b000000;  // 2^23, no fractional part.                        
   unsigned int i5 = 0xcf000001;  // -2^31, one more large, and negative, value.      

   float x0 = hide_float(0.91825f);
   float x0i = hide_float(0.0f);
   float x1 = hide_float(-0.12958f);
   float x1i = hide_float(-1.0f);
   float x2 = hide_float(-79615.1875f);
   float x2i = hide_float(-79616.0f);
   float x3 = hide_float(make_float(i3));
   float x3i = hide_float(make_float(i3i));
   float x4 = hide_float(make_float(i4));
   float x4i = hide_float(make_float(i4));
   float x5 = hide_float(make_float(i5));
   float x5i = hide_float(make_float(i5));

   vec_float4 x0_v = vec_splat_float(x0);
   vec_float4 x0i_v = vec_splat_float(x0i);
   vec_float4 x1_v = vec_splat_float(x1);
   vec_float4 x1i_v = vec_splat_float(x1i);
   vec_float4 x2_v = vec_splat_float(x2);
   vec_float4 x2i_v = vec_splat_float(x2i);
   vec_float4 x3_v = vec_splat_float(x3);
   vec_float4 x3i_v = vec_splat_float(x3i);
   vec_float4 x4_v = vec_splat_float(x4);
   vec_float4 x4i_v = vec_splat_float(x4i);
   vec_float4 x5_v = vec_splat_float(x5);
   vec_float4 x5i_v = vec_splat_float(x5i);
   
   vec_float4 res_v;

   TEST_START("floorf4");
   res_v = floorf4(x0_v);
   TEST_CHECK("20040916145022EJL", allequal_float4( res_v, x0i_v ), 0);
   res_v = floorf4(x1_v);
   TEST_CHECK("20040916145024EJL", allequal_float4( res_v, x1i_v ), 0);
   res_v = floorf4(x2_v);
   TEST_CHECK("20040916145027EJL", allequal_float4( res_v, x2i_v ), 0);
   res_v = floorf4(x3_v);
   TEST_CHECK("20040916145029EJL", allequal_float4( res_v, x3i_v ), 0);
   res_v = floorf4(x4_v);
   TEST_CHECK("20040916145032EJL", allequal_float4( res_v, x4i_v ), 0);
   res_v = floorf4(x5_v);
   TEST_CHECK("20040916145034EJL", allequal_float4( res_v, x5i_v ), 0);
   
   TEST_SET_DONE();
   
   TEST_EXIT();
}
Example #5
0
int main()
{
   TEST_SET_START("20040928105926EJL","EJL", "divf4");

   unsigned int i0n = 0x75013340;
   unsigned int i0d = 0x75e7753f;
   unsigned int i0r = 0x3e8ee64b;
   unsigned int i1n = 0x4c7fed5a;
   unsigned int i1d = 0x3a0731f0;
   unsigned int i1r = 0x51f24e86;
   unsigned int i2n = 0x5b08b303;
   unsigned int i2d = 0x562f5046;
   unsigned int i2r = 0x44479d24;
   unsigned int i3n = 0x748a9b87;
   unsigned int i3d = 0x6b014b46;
   unsigned int i3r = 0x49093864;
   unsigned int i4n = 0x35dcf9d8;
   unsigned int i4d = 0x6278d6e0;
   unsigned int i4r = 0x12e355b5;
   unsigned int i5n = 0x74d505fd;
   unsigned int i5d = 0x61ef565e;
   unsigned int i5r = 0x5263daa3;

   float x0n = hide_float(make_float(i0n));
   float x0d = hide_float(make_float(i0d));
   float x0r = hide_float(make_float(i0r));
                                       
   float x1n = hide_float(make_float(i1n));
   float x1d = hide_float(make_float(i1d));
   float x1r = hide_float(make_float(i1r));
                                       
   float x2n = hide_float(make_float(i2n));
   float x2d = hide_float(make_float(i2d));
   float x2r = hide_float(make_float(i2r));
                                       
   float x3n = hide_float(make_float(i3n));
   float x3d = hide_float(make_float(i3d));
   float x3r = hide_float(make_float(i3r));
                                       
   float x4n = hide_float(make_float(i4n));
   float x4d = hide_float(make_float(i4d));
   float x4r = hide_float(make_float(i4r));
                                       
   float x5n = hide_float(make_float(i5n));
   float x5d = hide_float(make_float(i5d));
   float x5r = hide_float(make_float(i5r));
   
   vec_float4 x0n_v = spu_splats(x0n);
   vec_float4 x0d_v = spu_splats(x0d);
   vec_float4 x0r_v = spu_splats(x0r);
                                   
   vec_float4 x1n_v = spu_splats(x1n);
   vec_float4 x1d_v = spu_splats(x1d);
   vec_float4 x1r_v = spu_splats(x1r);
                                   
   vec_float4 x2n_v = spu_splats(x2n);
   vec_float4 x2d_v = spu_splats(x2d);
   vec_float4 x2r_v = spu_splats(x2r);
                                   
   vec_float4 x3n_v = spu_splats(x3n);
   vec_float4 x3d_v = spu_splats(x3d);
   vec_float4 x3r_v = spu_splats(x3r);
                                   
   vec_float4 x4n_v = spu_splats(x4n);
   vec_float4 x4d_v = spu_splats(x4d);
   vec_float4 x4r_v = spu_splats(x4r);
                                   
   vec_float4 x5n_v = spu_splats(x5n);
   vec_float4 x5d_v = spu_splats(x5d);
   vec_float4 x5r_v = spu_splats(x5r);
   
   vec_float4 res_v;

   TEST_START("divf4");
   res_v = divf4(x0n_v, x0d_v);
   TEST_CHECK("20040928105932EJL", allequal_ulps_float4( res_v, x0r_v, 2 ), 0);
   res_v = divf4(x1n_v, x1d_v);
   TEST_CHECK("20040928105934EJL", allequal_ulps_float4( res_v, x1r_v, 2 ), 0);
   res_v = divf4(x2n_v, x2d_v);
   TEST_CHECK("20040928105936EJL", allequal_ulps_float4( res_v, x2r_v, 2 ), 0);
   res_v = divf4(x3n_v, x3d_v);
   TEST_CHECK("20040928105938EJL", allequal_ulps_float4( res_v, x3r_v, 2 ), 0);
   res_v = divf4(x4n_v, x4d_v);
   TEST_CHECK("20040928105940EJL", allequal_ulps_float4( res_v, x4r_v, 2 ), 0);
   res_v = divf4(x5n_v, x5d_v);
   TEST_CHECK("20040928105943EJL", allequal_ulps_float4( res_v, x5r_v, 2 ), 0);
   
   TEST_SET_DONE();
   
   TEST_EXIT();
}
Example #6
0
int main()
{
   TEST_SET_START("20040920142553EJL","EJL", "recipf4");

   unsigned int i0r = 0x7fffffff;  
   unsigned int i1 = 0xff000000;   // -2^127
   unsigned int i2 = 0xfe7fffff;   // -2^126 - 1 ulp
   unsigned int i2r = 0x80800001;  
   unsigned int i3 =   0x75013340; // random values
   unsigned int i3r =  0x09fd9f35;
   unsigned int i4 =   0x75e7753f; 
   unsigned int i4r =  0x090d9277;
   unsigned int i5 =   0x4c7fed5a; 
   unsigned int i5r =  0x32800954;
   unsigned int i6 =   0x3a0731f0; 
   unsigned int i6r =  0x44f2602e; 
   unsigned int i7 =   0x69784a07; 
   unsigned int i7r =  0x1583f9a3;

   float x0 = hide_float(0.0f);
   float x0r = hide_float(make_float(i0r));
   float x1 = hide_float(make_float(i1));
   float x1r = hide_float(0.0f);
   float x2 = hide_float(make_float(i2));
   float x2r = hide_float(make_float(i2r));   
   float x3 = hide_float(make_float(i3));
   float x3r = hide_float(make_float(i3r));   
   float x4 = hide_float(make_float(i4));     
   float x4r = hide_float(make_float(i4r));   
   float x5 = hide_float(make_float(i5));     
   float x5r = hide_float(make_float(i5r));   
   float x6 = hide_float(make_float(i6));     
   float x6r = hide_float(make_float(i6r));   
   float x7 = hide_float(make_float(i7));
   float x7r = hide_float(make_float(i7r));
   
   vec_float4 x0_v = spu_splats(x0);
   vec_float4 x0r_v = spu_splats(x0r);
   vec_float4 x1_v = spu_splats(x1);
   vec_float4 x1r_v = spu_splats(x1r);
   vec_float4 x2_v = spu_splats(x2);
   vec_float4 x2r_v = spu_splats(x2r);
   vec_float4 x3_v = spu_splats(x3);
   vec_float4 x3r_v = spu_splats(x3r);
   vec_float4 x4_v = spu_splats(x4);
   vec_float4 x4r_v = spu_splats(x4r);
   vec_float4 x5_v = spu_splats(x5);
   vec_float4 x5r_v = spu_splats(x5r);
   vec_float4 x6_v = spu_splats(x6);
   vec_float4 x6r_v = spu_splats(x6r);
   vec_float4 x7_v = spu_splats(x7);
   vec_float4 x7r_v = spu_splats(x7r);
   
   vec_float4 res_v;

   TEST_START("recipf4");
   res_v = recipf4(x0_v);
   TEST_CHECK("20040920142558EJL", allequal_float4( res_v, x0r_v ), 0);
   res_v = recipf4(x1_v);
   TEST_CHECK("20040920142600EJL", allequal_float4( res_v, x1r_v), 0);
   res_v = recipf4(x2_v);
   TEST_CHECK("20040920142602EJL", allequal_ulps_float4( res_v, x2r_v, 2 ), 0);
   res_v = recipf4(x3_v);
   TEST_CHECK("20040920142604EJL", allequal_ulps_float4( res_v, x3r_v, 2 ), 0);
   res_v = recipf4(x4_v);
   TEST_CHECK("20040920142606EJL", allequal_ulps_float4( res_v, x4r_v, 2 ), 0);
   res_v = recipf4(x5_v);
   TEST_CHECK("20040920142608EJL", allequal_ulps_float4( res_v, x5r_v, 2 ), 0);
   res_v = recipf4(x6_v);
   TEST_CHECK("20040920142609EJL", allequal_ulps_float4( res_v, x6r_v, 2 ), 0);
   res_v = recipf4(x7_v);
   TEST_CHECK("20040920142611EJL", allequal_ulps_float4( res_v, x7r_v, 2 ), 0);
   
   TEST_SET_DONE();
   
   TEST_EXIT();
}
Example #7
0
int main()
{
   TEST_SET_START("20040928191240EJL","EJL", "fmodf4");

   unsigned int i0n = 0x449edbc6;
   unsigned int i0d = 0x40cf799d;
   unsigned int i0r = 0x3daa7300;
   unsigned int i1n = 0x6bca107a;
   unsigned int i1d = 0x6c4a107a;
   unsigned int i1r = 0x6bca107a;
   unsigned int i2n = 0x1c123605;
   unsigned int i2d = 0x1c923602;
   unsigned int i2r = 0x1c123605;
   unsigned int i3n = 0x2b4c50fa;
   unsigned int i3d = 0x253a3ae3;
   unsigned int i3r = 0x25141df9;
   unsigned int i4n = 0x73addffc;
   unsigned int i4d = 0x742ddffc;
   unsigned int i4r = 0x73addffc;
   unsigned int i5n = 0x29d4d97c;
   unsigned int i5d = 0x2a546e77;
   unsigned int i5r = 0x29d4d97c;

   float x0n = hide_float(make_float(i0n));
   float x0d = hide_float(make_float(i0d));
   float x0r = hide_float(make_float(i0r));
                                       
   float x1n = hide_float(make_float(i1n));
   float x1d = hide_float(make_float(i1d));
   float x1r = hide_float(make_float(i1r));
                                       
   float x2n = hide_float(make_float(i2n));
   float x2d = hide_float(make_float(i2d));
   float x2r = hide_float(make_float(i2r));
                                       
   float x3n = hide_float(make_float(i3n));
   float x3d = hide_float(make_float(i3d));
   float x3r = hide_float(make_float(i3r));
                                       
   float x4n = hide_float(make_float(i4n));
   float x4d = hide_float(make_float(i4d));
   float x4r = hide_float(make_float(i4r));
                                       
   float x5n = hide_float(make_float(i5n));
   float x5d = hide_float(make_float(i5d));
   float x5r = hide_float(make_float(i5r));
   
   vec_float4 x0n_v = spu_splats(x0n);
   vec_float4 x0d_v = spu_splats(x0d);
   vec_float4 x0r_v = spu_splats(x0r);
                                   
   vec_float4 x1n_v = spu_splats(x1n);
   vec_float4 x1d_v = spu_splats(x1d);
   vec_float4 x1r_v = spu_splats(x1r);
                                   
   vec_float4 x2n_v = spu_splats(x2n);
   vec_float4 x2d_v = spu_splats(x2d);
   vec_float4 x2r_v = spu_splats(x2r);
                                   
   vec_float4 x3n_v = spu_splats(x3n);
   vec_float4 x3d_v = spu_splats(x3d);
   vec_float4 x3r_v = spu_splats(x3r);
                                   
   vec_float4 x4n_v = spu_splats(x4n);
   vec_float4 x4d_v = spu_splats(x4d);
   vec_float4 x4r_v = spu_splats(x4r);
                                   
   vec_float4 x5n_v = spu_splats(x5n);
   vec_float4 x5d_v = spu_splats(x5d);
   vec_float4 x5r_v = spu_splats(x5r);
   
   float res;
   vec_float4 res_v;

   TEST_START("fmodf4");
   res_v = fmodf4(x0n_v, x0d_v);
   TEST_CHECK("20040928191245EJL", allequal_ulps_float4( res_v, x0r_v, 1 ), 0);
   res_v = fmodf4(x1n_v, x1d_v);
   TEST_CHECK("20040928191247EJL", allequal_ulps_float4( res_v, x1r_v, 1 ), 0);
   res_v = fmodf4(x2n_v, x2d_v);
   TEST_CHECK("20040928191249EJL", allequal_ulps_float4( res_v, x2r_v, 1 ), 0);
   res_v = fmodf4(x3n_v, x3d_v);
   TEST_CHECK("20040928191251EJL", allequal_ulps_float4( res_v, x3r_v, 1 ), 0);
   res_v = fmodf4(x4n_v, x4d_v);
   TEST_CHECK("20040928191253EJL", allequal_ulps_float4( res_v, x4r_v, 1 ), 0);
   res_v = fmodf4(x5n_v, x5d_v);
   TEST_CHECK("20040928191255EJL", allequal_ulps_float4( res_v, x5r_v, 1 ), 0);
   
   TEST_START("fmodf");
   res = fmodf(x0n, x0d);
   TEST_CHECK("20040928191258EJL", ulpDiff_f( res, x0r ) <= 1, 0);
   res = fmodf(x1n, x1d);
   TEST_CHECK("20040928191300EJL", ulpDiff_f( res, x1r ) <= 1, 0);
   res = fmodf(x2n, x2d);
   TEST_CHECK("20040928191302EJL", ulpDiff_f( res, x2r ) <= 1, 0);
   res = fmodf(x3n, x3d);               
   TEST_CHECK("20040928191303EJL", ulpDiff_f( res, x3r ) <= 1, 0);
   res = fmodf(x4n, x4d);
   TEST_CHECK("20040928191305EJL", ulpDiff_f( res, x4r ) <= 1, 0);
   res = fmodf(x5n, x5d);
   TEST_CHECK("20040928191307EJL", ulpDiff_f( res, x5r ) <= 1, 0);

   TEST_SET_DONE();
   
   TEST_EXIT();
}
Example #8
0
int main()
{
	TEST_SET_START("20060918101000NM","NM", "llrintf4");

//   unsigned long i11 = 0x5efffffful; // 9223371487098961920
//   unsigned long i12 = 0xdefffffful; //-9223371487098961920
//   unsigned long i11 = 0x49fffffful; //2097151.875000
//   unsigned long i12 = 0x4a7ffffful; //4194303.750000

//   float x0  = hide_float(-FLT_MAX);           // -Inf
//   float x1  = hide_float(FLT_MAX);            // Inf
   float x2  = hide_float(0.0);                  // +0
   float x3  = hide_float(-0.0);                 // -0
//   float x4  = hide_float(NANF);            // NaN -> NaN
   float x5  = hide_float( 0.5);
   float x6  = hide_float(-0.5);
   float x7  = hide_float(-0.499999);
   float x8  = hide_float( 0.499999);
   float x9  = hide_float(-999999.5);
   float x10 = hide_float( 999999.5);
//   float x11 = hide_float(make_float(i11));
//   float x12 = hide_float(make_float(i12));
   float x11 = hide_float( 9223371487098961920.);
   float x12 = hide_float(-9223371487098961920.);
   float x13 = (0.0 - FLT_MIN);
   float x14 = FLT_MIN;
   float x15 = hide_float(-2097151.875000);
   float x16 = hide_float(-4194303.750000);
   float x17 = hide_float( 4194303.750000);
   float x18 = hide_float( 2097151.875000);

	vec_float4  x0_v = ((vec_float4){ x2, x3, x5, x6});
	llroundf4_t r0_v = set_llrintf4_t(0,  0,  0, 0);

	vec_float4  x1_v = ((vec_float4){ x7, x8,       x9,     x10});
	llroundf4_t r1_v = set_llrintf4_t(0,  0, -999999, 999999);

	vec_float4  x2_v = ((vec_float4){                    x11,                    x12, x13, x14});
	llroundf4_t r2_v = set_llrintf4_t(9223371487098961920ll, -9223371487098961920ll,    0,  0);

	vec_float4  x3_v = ((vec_float4){       x15,      x16,     x17,     x18});
	llroundf4_t r3_v = set_llrintf4_t(-2097151, -4194303, 4194303, 2097151);

	llroundf4_t  res_v;

   TEST_START("llrintf4");
   res_v = llrintf4 (x0_v);
   TEST_CHECK("20060918101001NM", allequal_llroundf4( res_v, r0_v ), 0);
   res_v = llrintf4 (x1_v);
   TEST_CHECK("20060918101002NM", allequal_llroundf4( res_v, r1_v ), 0);
   res_v = llrintf4 (x2_v);
   TEST_CHECK("20060918101003NM", allequal_llroundf4( res_v, r2_v ), 0);
   res_v = llrintf4 (x3_v);
   TEST_CHECK("20060918101004NM", allequal_llroundf4( res_v, r3_v ), 0);

   TEST_SET_DONE();

   TEST_EXIT();

}
Example #9
0
int main()
{
   TEST_SET_START("20060817000000AAN","AAN", "isgreaterequalf4");
   
   float x0 = hide_float(-0.0f);
   float y0 = hide_float( 0.0f);
   unsigned int r0 = 0xffffffff;

   float x1 = hide_float(FLT_MAX);  //+Smax
   float y1 = hide_float(-FLT_MAX);  //-Smax
   unsigned int r1 = 0xffffffff;

   float x2 = hide_float(-0.0000000013152f);
   float y2 = hide_float(-234245.85323441f);
   unsigned int r2 = 0xffffffff;

   float x3 = hide_float(-168.97345223013f);
   float y3 = hide_float(-168.97345223013f);
   unsigned int r3 = 0xffffffff;

   float x4 = hide_float(-83532.96153153f);
   float y4 = hide_float(-FLT_MIN);  //-Smin
   unsigned int r4 = 0x00000000;

   float x5 = hide_float(-321.01234567f);
   float y5 = hide_float(876543.12345f);
   unsigned int r5 = 0x00000000;

   float x6 = hide_float(FLT_MIN);  // Smin
   float y6 = hide_float(0.0031529324f);
   unsigned int r6 = 0x00000000;

   float x7 = hide_float(5172.2845321f);
   float y7 = hide_float(5172.2845321f);
   unsigned int r7 = 0xffffffff;

   float x8 = hide_float(264.345643345f);
   float y8 = hide_float(2353705.31415f);
   unsigned int r8 = 0x00000000;

   float x9 = hide_float(FLT_MAX);  // Smax
   float y9 = hide_float(9.43574552184f);
   unsigned int r9 = 0xffffffff;

   vec_float4 x0_v = spu_splats(x0);
   vec_float4 y0_v = spu_splats(y0);
   vec_uint4  r0_v = spu_splats(r0);

   vec_float4 x1_v = spu_splats(x1);
   vec_float4 y1_v = spu_splats(y1);
   vec_uint4  r1_v = spu_splats(r1);

   vec_float4 x2_v = spu_splats(x2);
   vec_float4 y2_v = spu_splats(y2);
   vec_uint4  r2_v = spu_splats(r2);

   vec_float4 x3_v = spu_splats(x3);
   vec_float4 y3_v = spu_splats(y3);
   vec_uint4  r3_v = spu_splats(r3);

   vec_float4 x4_v = spu_splats(x4);
   vec_float4 y4_v = spu_splats(y4);
   vec_uint4  r4_v = spu_splats(r4);

   vec_float4 x5_v = spu_splats(x5);
   vec_float4 y5_v = spu_splats(y5);
   vec_uint4  r5_v = spu_splats(r5);

   vec_float4 x6_v = spu_splats(x6);
   vec_float4 y6_v = spu_splats(y6);
   vec_uint4  r6_v = spu_splats(r6);

   vec_float4 x7_v = spu_splats(x7);
   vec_float4 y7_v = spu_splats(y7);
   vec_uint4  r7_v = spu_splats(r7);

   vec_float4 x8_v = spu_splats(x8);
   vec_float4 y8_v = spu_splats(y8);
   vec_uint4  r8_v = spu_splats(r8);

   vec_float4 x9_v = spu_splats(x9);
   vec_float4 y9_v = spu_splats(y9);
   vec_uint4  r9_v = spu_splats(r9);
   
   vec_uint4 res_v;

   TEST_START("isgreaterequalf4");

   res_v = (vec_uint4)isgreaterequalf4(x0_v, y0_v);
   TEST_CHECK("20060817000000AAN", allequal_uint4( res_v, r0_v ), 0);
   res_v = (vec_uint4)isgreaterequalf4(x1_v, y1_v);
   TEST_CHECK("20060817000001AAN", allequal_uint4( res_v, r1_v ), 0);
   res_v = (vec_uint4)isgreaterequalf4(x2_v, y2_v);
   TEST_CHECK("20060817000002AAN", allequal_uint4( res_v, r2_v ), 0);
   res_v = (vec_uint4)isgreaterequalf4(x3_v, y3_v);
   TEST_CHECK("20060817000003AAN", allequal_uint4( res_v, r3_v ), 0);
   res_v = (vec_uint4)isgreaterequalf4(x4_v, y4_v);
   TEST_CHECK("20060817000004AAN", allequal_uint4( res_v, r4_v ), 0);
   res_v = (vec_uint4)isgreaterequalf4(x5_v, y5_v);
   TEST_CHECK("20060817000005AAN", allequal_uint4( res_v, r5_v ), 0);
   res_v = (vec_uint4)isgreaterequalf4(x6_v, y6_v);
   TEST_CHECK("20060817000006AAN", allequal_uint4( res_v, r6_v ), 0);
   res_v = (vec_uint4)isgreaterequalf4(x7_v, y7_v);
   TEST_CHECK("20060817000007AAN", allequal_uint4( res_v, r7_v ), 0);
   res_v = (vec_uint4)isgreaterequalf4(x8_v, y8_v);
   TEST_CHECK("20060817000008AAN", allequal_uint4( res_v, r8_v ), 0);
   res_v = (vec_uint4)isgreaterequalf4(x9_v, y9_v);
   TEST_CHECK("20060817000009AAN", allequal_uint4( res_v, r9_v ), 0);
   
   TEST_SET_DONE();
   
   TEST_EXIT();
}
Example #10
0
int main()
{
   TEST_SET_START("20060822000000AAN","AAN", "isnormalf4");
   
   float x0 = hide_float(-0.0f);
   unsigned int r0 = 0x00000000;

   float x1 = hide_float(-FLT_MAX);  //-Smax
   unsigned int r1 = 0xffffffff;

   float x2 = hide_float( 0.0f);
   unsigned int r2 = 0x00000000;

   float x3 = hide_float(-168.97345223013f);
   unsigned int r3 = 0xffffffff;

   float x4 = hide_float(-1e-999);  //-Smin
   unsigned int r4 = 0x00000000;

   float x5 = hide_float(876543.12345f);
   unsigned int r5 = 0xffffffff;

   float x6 = hide_float(1e-999);  // Smin
   unsigned int r6 = 0x00000000;

   float x7 = hide_float(5172.2845321f);
   unsigned int r7 = 0xffffffff;

   float x8 = hide_float(2353705.31415f);
   unsigned int r8 = 0xffffffff;

   float x9 = hide_float(FLT_MAX);  // Smax
   unsigned int r9 = 0xffffffff;
   
   vec_float4 x0_v = spu_splats(x0);
   vec_uint4  r0_v = spu_splats(r0);

   vec_float4 x1_v = spu_splats(x1);
   vec_uint4  r1_v = spu_splats(r1);

   vec_float4 x2_v = spu_splats(x2);
   vec_uint4  r2_v = spu_splats(r2);

   vec_float4 x3_v = spu_splats(x3);
   vec_uint4  r3_v = spu_splats(r3);

   vec_float4 x4_v = spu_splats(x4);
   vec_uint4  r4_v = spu_splats(r4);

   vec_float4 x5_v = spu_splats(x5);
   vec_uint4  r5_v = spu_splats(r5);

   vec_float4 x6_v = spu_splats(x6);
   vec_uint4  r6_v = spu_splats(r6);

   vec_float4 x7_v = spu_splats(x7);
   vec_uint4  r7_v = spu_splats(r7);

   vec_float4 x8_v = spu_splats(x8);
   vec_uint4  r8_v = spu_splats(r8);

   vec_float4 x9_v = spu_splats(x9);
   vec_uint4  r9_v = spu_splats(r9);
   
   vec_uint4 res_v;

   TEST_START("isnormalf4");
   
   res_v = (vec_uint4)isnormalf4(x0_v);
   TEST_CHECK("20060822000000AAN", allequal_uint4( res_v, r0_v ), 0);
   res_v = (vec_uint4)isnormalf4(x1_v);
   TEST_CHECK("20060822000001AAN", allequal_uint4( res_v, r1_v ), 0);
   res_v = (vec_uint4)isnormalf4(x2_v);
   TEST_CHECK("20060822000002AAN", allequal_uint4( res_v, r2_v ), 0);
   res_v = (vec_uint4)isnormalf4(x3_v);
   TEST_CHECK("20060822000003AAN", allequal_uint4( res_v, r3_v ), 0);
   res_v = (vec_uint4)isnormalf4(x4_v);
   TEST_CHECK("20060822000004AAN", allequal_uint4( res_v, r4_v ), 0);
   res_v = (vec_uint4)isnormalf4(x5_v);
   TEST_CHECK("20060822000005AAN", allequal_uint4( res_v, r5_v ), 0);
   res_v = (vec_uint4)isnormalf4(x6_v);
   TEST_CHECK("20060822000006AAN", allequal_uint4( res_v, r6_v ), 0);
   res_v = (vec_uint4)isnormalf4(x7_v);
   TEST_CHECK("20060822000007AAN", allequal_uint4( res_v, r7_v ), 0);
   res_v = (vec_uint4)isnormalf4(x8_v);
   TEST_CHECK("20060822000008AAN", allequal_uint4( res_v, r8_v ), 0);
   res_v = (vec_uint4)isnormalf4(x9_v);
   TEST_CHECK("20060822000009AAN", allequal_uint4( res_v, r9_v ), 0);
  
   TEST_SET_DONE();
   
   TEST_EXIT();
}
Example #11
0
int main()
{
   TEST_SET_START("20040928184342EJL","EJL", "fminf4_fmaxf4");
   
   float x0min = hide_float(1760.135f);
   float x0max = hide_float(19355.03f);

   float x1min = hide_float(-12351.9f);
   float x1max = hide_float(-139.035f);

   float x2min = hide_float(-1.0);
   float x2max = hide_float(0.0);

   vec_float4 x0min_v = spu_splats(x0min);
   vec_float4 x0max_v = spu_splats(x0max);

   vec_float4 x1min_v = spu_splats(x1min); 
   vec_float4 x1max_v = spu_splats(x1max); 

   vec_float4 x2min_v = spu_splats(x2min); 
   vec_float4 x2max_v = spu_splats(x2max); 

   float res;
   vec_float4 res_v;

   TEST_START("fminf4");
   res_v = fminf4(x0min_v, x0max_v);
   TEST_CHECK("20040928184345EJL", allequal_float4( res_v, x0min_v ), 0);
   res_v = fminf4(x0max_v, x0min_v);      
   TEST_CHECK("20040928184349EJL", allequal_float4( res_v, x0min_v ), 0);
   res_v = fminf4(x1min_v, x1max_v);
   TEST_CHECK("20040928184351EJL", allequal_float4( res_v, x1min_v ), 0);
   res_v = fminf4(x1max_v, x1min_v);      
   TEST_CHECK("20040928184353EJL", allequal_float4( res_v, x1min_v ), 0);
   res_v = fminf4(x2min_v, x2max_v);
   TEST_CHECK("20040928184354EJL", allequal_float4( res_v, x2min_v ), 0);
   res_v = fminf4(x2max_v, x2min_v);      
   TEST_CHECK("20040928184356EJL", allequal_float4( res_v, x2min_v ), 0);
   
   TEST_START("fminf");
   res = fminf(x0min, x0max);
   TEST_CHECK("20040928184358EJL", res == x0min, 0);
   res = fminf(x0max, x0min);
   TEST_CHECK("20040928184400EJL", res == x0min, 0);
   res = fminf(x1min, x1max);
   TEST_CHECK("20040928184401EJL", res == x1min, 0);
   res = fminf(x1max, x1min);
   TEST_CHECK("20040928184403EJL", res == x1min, 0);
   res = fminf(x2min, x2max);
   TEST_CHECK("20040928184405EJL", res == x2min, 0);
   res = fminf(x2max, x2min);
   TEST_CHECK("20040928184406EJL", res == x2min, 0);
   
   TEST_START("fmaxf4");
   res_v = fmaxf4(x0min_v, x0max_v);
   TEST_CHECK("20040928184411EJL", allequal_float4( res_v, x0max_v ), 0);
   res_v = fmaxf4(x0max_v, x0min_v);      
   TEST_CHECK("20040928184413EJL", allequal_float4( res_v, x0max_v ), 0);
   res_v = fmaxf4(x1min_v, x1max_v);
   TEST_CHECK("20040928184415EJL", allequal_float4( res_v, x1max_v ), 0);
   res_v = fmaxf4(x1max_v, x1min_v);      
   TEST_CHECK("20040928184416EJL", allequal_float4( res_v, x1max_v ), 0);
   res_v = fmaxf4(x2min_v, x2max_v);
   TEST_CHECK("20040928184417EJL", allequal_float4( res_v, x2max_v ), 0);
   res_v = fmaxf4(x2max_v, x2min_v);      
   TEST_CHECK("20040928184419EJL", allequal_float4( res_v, x2max_v ), 0);
   
   TEST_START("fmaxf");
   res = fmaxf(x0min, x0max);
   TEST_CHECK("20040928184420EJL", res == x0max, 0);
   res = fmaxf(x0max, x0min);
   TEST_CHECK("20040928184422EJL", res == x0max, 0);
   res = fmaxf(x1min, x1max);
   TEST_CHECK("20040928184423EJL", res == x1max, 0);
   res = fmaxf(x1max, x1min);
   TEST_CHECK("20040928184424EJL", res == x1max, 0);
   res = fmaxf(x2min, x2max);
   TEST_CHECK("20040928184426EJL", res == x2max, 0);
   res = fmaxf(x2max, x2min);
   TEST_CHECK("20040928184428EJL", res == x2max, 0);

   TEST_SET_DONE();
   
   TEST_EXIT();
}
Example #12
0
int main()
{
   TEST_SET_START("20060905000000AAN","AAN", "logbf4");

   // -Norm (IEEE-754: -Nan)
   float x0 = hide_float(make_float(0xFFC00000));
   float r0 = 128.0f;
   
   // -Norm (IEEE-754: -Inf)
   float x1 = hide_float(-HUGE_VALF);
   float r1 = 128.0f;
   
   // -Smax
   float x2 = hide_float(-FLT_MAX);
   float r2 = 128.0f;

   // -Norm
   float x3 = hide_float(-824842.58421394);
   float r3 = 19.0f;
   
   // -Smin
   float x4 = hide_float(make_float(0x80800000));
   float r4 = -126.0f;
   
   // -Denorm
   float x5 = hide_float(make_float(0x807AAAAA));
   float r5 = -HUGE_VALF;
   
   // -Unf
   float x6 = hide_float(-1.0e-999);
   float r6 = -HUGE_VALF;
   
   // -0
   float x7 = hide_float(-0.0);
   float r7 = -HUGE_VALF;

   // 0
   float x8 = hide_float( 0.0);
   float r8 = -HUGE_VALF;
   
   // +Unf
   float x9 = hide_float( 1.0e-999);
   float r9 = -HUGE_VALF;

   // +Denorm
   float x10 = hide_float(make_float(0x007AAAAA));
   float r10 = -HUGE_VALF;
   
   // +Smin
   float x11 = hide_float(make_float(0x00800000));
   float r11 = -126.0f;
   
   // +Norm
   float x12 = hide_float(3.14152634);
   float r12 = 1.0f;

   // +Norm
   float x13 = hide_float(7.0673903e37);
   float r13 = 125.0f;

   // +Norm
   float x14 = hide_float(2.4673e14);
   float r14 = 47.0f;

   // +Norm
   float x15 = hide_float(7.235672e-25);
   float r15 = -81.0f;

   // +Norm
   float x16 = hide_float(9.452854e17);
   float r16 = 59.0f;

   // +Norm
   float x17 = hide_float(3.045784e-18);
   float r17 = -59.0f;

   // -Norm
   float x18 = hide_float(-6.459273e7);
   float r18 = 25.0f;

   // -Norm
   float x19 = hide_float(-2.493472e-9);
   float r19 = -29.0f;

   // -Norm
   float x20 = hide_float(-1.4824543e28);
   float r20 = 93.0f;

   // -Norm
   float x21 = hide_float(-5.53856231e-27);
   float r21 = -88.0f;

   // -Norm
   float x22 = hide_float(-1.000001);
   float r22 = 0.0f;

   // +Smax
   float x23 = hide_float(FLT_MAX);
   float r23 = 128.0f;
   
   //+Norm (IEEE-754: +Inf)
   float x24 = hide_float(HUGE_VALF);
   float r24 = 128.0f;
   
   //+Norm (IEEE-754: +Nan)
   float x25 = hide_float(make_float(0x7FC00000));
   float r25 = 128.0f;

   // Compound
   vec_float4 x26_v = (vec_float4) { -2.561286432e10, FLT_MAX, -1.0e-999, 7.235672e-25 };
   vec_float4 r26_v = (vec_float4) { 34.0f, 128.0f, -HUGE_VALF, -81.0f };

   // Compound
   vec_float4 x27_v = (vec_float4) { 345.27533f, 7.0673903e37, -0.0f, -2.40e-310 };
   vec_float4 r27_v = (vec_float4) { 8.0f, 125.0f, -HUGE_VALF, -HUGE_VALF };

   // Compound
   vec_float4 x28_v = (vec_float4) { make_float(0x7FC00000), -824842.58421394f, -0.0f, -3678342.8765343f };
   vec_float4 r28_v = (vec_float4) { 128.0f, 19.0f, -HUGE_VALF, 21.0f };

   // Compound
   vec_float4 x29_v = (vec_float4) { HUGE_VALF, 1.0e-99, -5.53856231e-27, make_float(0xFFC00000) };
   vec_float4 r29_v = (vec_float4) { 128.0f, -HUGE_VALF, -88.0f, 128.0f };

   // Compound
   vec_float4 x30_v = (vec_float4) { 1.2e-57, -1.2e-19, 3.045784e-18, -HUGE_VALF } ;
   vec_float4 r30_v = (vec_float4) { -HUGE_VALF, -63.0f, -59.0f, 128.0f };

   vec_float4 x0_v = spu_splats(x0);
   vec_float4 r0_v = spu_splats(r0);

   vec_float4 x1_v = spu_splats(x1);
   vec_float4 r1_v = spu_splats(r1);

   vec_float4 x2_v = spu_splats(x2);
   vec_float4 r2_v = spu_splats(r2);

   vec_float4 x3_v = spu_splats(x3);
   vec_float4 r3_v = spu_splats(r3);

   vec_float4 x4_v = spu_splats(x4);
   vec_float4 r4_v = spu_splats(r4);

   vec_float4 x5_v = spu_splats(x5);
   vec_float4 r5_v = spu_splats(r5);

   vec_float4 x6_v = spu_splats(x6);
   vec_float4 r6_v = spu_splats(r6);

   vec_float4 x7_v = spu_splats(x7);
   vec_float4 r7_v = spu_splats(r7);

   vec_float4 x8_v = spu_splats(x8);
   vec_float4 r8_v = spu_splats(r8);

   vec_float4 x9_v = spu_splats(x9);
   vec_float4 r9_v = spu_splats(r9);

   vec_float4 x10_v = spu_splats(x10);
   vec_float4 r10_v = spu_splats(r10);

   vec_float4 x11_v = spu_splats(x11);
   vec_float4 r11_v = spu_splats(r11);

   vec_float4 x12_v = spu_splats(x12);
   vec_float4 r12_v = spu_splats(r12);

   vec_float4 x13_v = spu_splats(x13);
   vec_float4 r13_v = spu_splats(r13);

   vec_float4 x14_v = spu_splats(x14);
   vec_float4 r14_v = spu_splats(r14);

   vec_float4 x15_v = spu_splats(x15);
   vec_float4 r15_v = spu_splats(r15);

   vec_float4 x16_v = spu_splats(x16);
   vec_float4 r16_v = spu_splats(r16);

   vec_float4 x17_v = spu_splats(x17);
   vec_float4 r17_v = spu_splats(r17);

   vec_float4 x18_v = spu_splats(x18);
   vec_float4 r18_v = spu_splats(r18);

   vec_float4 x19_v = spu_splats(x19);
   vec_float4 r19_v = spu_splats(r19);

   vec_float4 x20_v = spu_splats(x20);
   vec_float4 r20_v = spu_splats(r20);

   vec_float4 x21_v = spu_splats(x21);
   vec_float4 r21_v = spu_splats(r21);

   vec_float4 x22_v = spu_splats(x22);
   vec_float4 r22_v = spu_splats(r22);

   vec_float4 x23_v = spu_splats(x23);
   vec_float4 r23_v = spu_splats(r23);

   vec_float4 x24_v = spu_splats(x24);
   vec_float4 r24_v = spu_splats(r24);

   vec_float4 x25_v = spu_splats(x25);
   vec_float4 r25_v = spu_splats(r25);
   
   vec_float4 res_v;

   TEST_START("logbf4");

   res_v = (vec_float4)logbf4(x0_v);
   TEST_CHECK("20060905000000AAN", allequal_float4( res_v, r0_v ), 0);
   res_v = (vec_float4)logbf4(x1_v);
   TEST_CHECK("20060905000001AAN", allequal_float4( res_v, r1_v ), 0);
   res_v = (vec_float4)logbf4(x2_v);
   TEST_CHECK("20060905000002AAN", allequal_float4( res_v, r2_v ), 0);
   res_v = (vec_float4)logbf4(x3_v);
   TEST_CHECK("20060905000003AAN", allequal_float4( res_v, r3_v ), 0);
   res_v = (vec_float4)logbf4(x4_v);
   TEST_CHECK("20060905000004AAN", allequal_float4( res_v, r4_v ), 0);
   res_v = (vec_float4)logbf4(x5_v);
   TEST_CHECK("20060905000005AAN", allequal_float4( res_v, r5_v ), 0);
   res_v = (vec_float4)logbf4(x6_v);
   TEST_CHECK("20060905000006AAN", allequal_float4( res_v, r6_v ), 0);
   res_v = (vec_float4)logbf4(x7_v);
   TEST_CHECK("20060905000007AAN", allequal_float4( res_v, r7_v ), 0);
   res_v = (vec_float4)logbf4(x8_v);
   TEST_CHECK("20060905000008AAN", allequal_float4( res_v, r8_v ), 0);
   res_v = (vec_float4)logbf4(x9_v);
   TEST_CHECK("20060905000009AAN", allequal_float4( res_v, r9_v ), 0);
   res_v = (vec_float4)logbf4(x10_v);
   TEST_CHECK("20060905000010AAN", allequal_float4( res_v, r10_v ), 0);
   res_v = (vec_float4)logbf4(x11_v);
   TEST_CHECK("20060905000011AAN", allequal_float4( res_v, r11_v ), 0);
   res_v = (vec_float4)logbf4(x12_v);
   TEST_CHECK("20060905000012AAN", allequal_float4( res_v, r12_v ), 0);
   res_v = (vec_float4)logbf4(x13_v);
   TEST_CHECK("20060905000013AAN", allequal_float4( res_v, r13_v ), 0);
   res_v = (vec_float4)logbf4(x14_v);
   TEST_CHECK("20060905000014AAN", allequal_float4( res_v, r14_v ), 0);
   res_v = (vec_float4)logbf4(x15_v);
   TEST_CHECK("20060905000015AAN", allequal_float4( res_v, r15_v ), 0);
   res_v = (vec_float4)logbf4(x16_v);
   TEST_CHECK("20060905000016AAN", allequal_float4( res_v, r16_v ), 0);
   res_v = (vec_float4)logbf4(x17_v);
   TEST_CHECK("20060905000017AAN", allequal_float4( res_v, r17_v ), 0);
   res_v = (vec_float4)logbf4(x18_v);
   TEST_CHECK("20060905000018AAN", allequal_float4( res_v, r18_v ), 0);
   res_v = (vec_float4)logbf4(x19_v);
   TEST_CHECK("20060905000019AAN", allequal_float4( res_v, r19_v ), 0);
   res_v = (vec_float4)logbf4(x20_v);
   TEST_CHECK("20060905000020AAN", allequal_float4( res_v, r20_v ), 0);
   res_v = (vec_float4)logbf4(x21_v);
   TEST_CHECK("20060905000021AAN", allequal_float4( res_v, r21_v ), 0);
   res_v = (vec_float4)logbf4(x22_v);
   TEST_CHECK("20060905000022AAN", allequal_float4( res_v, r22_v ), 0);
   res_v = (vec_float4)logbf4(x23_v);
   TEST_CHECK("20060905000023AAN", allequal_float4( res_v, r23_v ), 0);
   res_v = (vec_float4)logbf4(x24_v);
   TEST_CHECK("20060905000024AAN", allequal_float4( res_v, r24_v ), 0);
   res_v = (vec_float4)logbf4(x25_v);
   TEST_CHECK("20060905000025AAN", allequal_float4( res_v, r25_v ), 0);
   res_v = (vec_float4)logbf4(x26_v);
   TEST_CHECK("20060905000026AAN", allequal_float4( res_v, r26_v ), 0);
   res_v = (vec_float4)logbf4(x27_v);
   TEST_CHECK("20060905000027AAN", allequal_float4( res_v, r27_v ), 0);
   res_v = (vec_float4)logbf4(x28_v);
   TEST_CHECK("20060905000028AAN", allequal_float4( res_v, r28_v ), 0);
   res_v = (vec_float4)logbf4(x29_v);
   TEST_CHECK("20060905000029AAN", allequal_float4( res_v, r29_v ), 0);
   res_v = (vec_float4)logbf4(x30_v);
   TEST_CHECK("20060905000030AAN", allequal_float4( res_v, r30_v ), 0);
   
   TEST_SET_DONE();
   
   TEST_EXIT();
}
Example #13
0
int main()
{
   TEST_SET_START("20060829000000AAN","AAN", "signbitf4");
   
   //-Nan
   float x0 = hide_float(-NANF);
   unsigned int r0 = 0xffffffff;

   //-Inf
   float x1 = hide_float(-HUGE_VAL);
   unsigned int r1 = 0xffffffff;

   //-Smax
   float x2 = hide_float(-FLT_MAX);
   unsigned int r2 = 0xffffffff;
   
   //-Norm
   float x3 = hide_float(-168.97345223013f);
   unsigned int r3 = 0xffffffff;

   //-Denorm
   float x4 = hide_float(make_float(0x803AAAAA));
   unsigned int r4 = 0xffffffff;

   //-Smin
   float x5 = hide_float(-FLT_MIN);
   unsigned int r5 = 0xffffffff;

   //-Unf
   float x6 = hide_float(-1.0e-999);
   unsigned int r6 = 0xffffffff;

   // -0
   float x7 = hide_float(-0.0f);
   unsigned int r7 = 0xffffffff;

   // 0
   float x8 = hide_float( 0.0f);
   unsigned int r8 = 0x00000000;

   //+Unf
   float x9 = hide_float( 1.0e-999);
   unsigned int r9 = 0x00000000;

   //+Smin
   float x10 = hide_float( FLT_MIN);
   unsigned int r10 = 0x00000000;

   //+Denorm
   float x11 = hide_float(make_float(0x007AAAAA));
   unsigned int r11 = 0x00000000;

   //+Norm
   float x12 = hide_float( 672953.74593f);
   unsigned int r12 = 0x00000000;
   
   //+Smax
   float x13 = hide_float( FLT_MAX);
   unsigned int r13 = 0x00000000;

   //+Inf
   float x14 = hide_float(HUGE_VAL);
   unsigned int r14 = 0x00000000;
   
   //+NaN
   float x15 = hide_float(NANF);
   unsigned int r15 = 0x00000000;

   vec_float4 x0_v = spu_splats(x0);
   vec_uint4  r0_v = spu_splats(r0);

   vec_float4 x1_v = spu_splats(x1);
   vec_uint4  r1_v = spu_splats(r1);

   vec_float4 x2_v = spu_splats(x2);
   vec_uint4  r2_v = spu_splats(r2);

   vec_float4 x3_v = spu_splats(x3);
   vec_uint4  r3_v = spu_splats(r3);

   vec_float4 x4_v = spu_splats(x4);
   vec_uint4  r4_v = spu_splats(r4);

   vec_float4 x5_v = spu_splats(x5);
   vec_uint4  r5_v = spu_splats(r5);

   vec_float4 x6_v = spu_splats(x6);
   vec_uint4  r6_v = spu_splats(r6);

   vec_float4 x7_v = spu_splats(x7);
   vec_uint4  r7_v = spu_splats(r7);

   vec_float4 x8_v = spu_splats(x8);
   vec_uint4  r8_v = spu_splats(r8);

   vec_float4 x9_v = spu_splats(x9);
   vec_uint4  r9_v = spu_splats(r9);

   vec_float4 x10_v = spu_splats(x10);
   vec_uint4  r10_v = spu_splats(r10);

   vec_float4 x11_v = spu_splats(x11);
   vec_uint4  r11_v = spu_splats(r11);

   vec_float4 x12_v = spu_splats(x12);
   vec_uint4  r12_v = spu_splats(r12);

   vec_float4 x13_v = spu_splats(x13);
   vec_uint4  r13_v = spu_splats(r13);

   vec_float4 x14_v = spu_splats(x14);
   vec_uint4  r14_v = spu_splats(r14);

   vec_float4 x15_v = spu_splats(x15);
   vec_uint4  r15_v = spu_splats(r15);
   
   vec_uint4 res_v;

   TEST_START("signbitf4");

   res_v = (vec_uint4)signbitf4(x0_v);
   TEST_CHECK("20060829000000AAN", allequal_uint4( res_v, r0_v ), 0);
   res_v = (vec_uint4)signbitf4(x1_v);
   TEST_CHECK("20060829000001AAN", allequal_uint4( res_v, r1_v ), 0);
   res_v = (vec_uint4)signbitf4(x2_v);
   TEST_CHECK("20060829000002AAN", allequal_uint4( res_v, r2_v ), 0);
   res_v = (vec_uint4)signbitf4(x3_v);
   TEST_CHECK("20060829000003AAN", allequal_uint4( res_v, r3_v ), 0);
   res_v = (vec_uint4)signbitf4(x4_v);
   TEST_CHECK("20060829000004AAN", allequal_uint4( res_v, r4_v ), 0);
   res_v = (vec_uint4)signbitf4(x5_v);
   TEST_CHECK("20060829000005AAN", allequal_uint4( res_v, r5_v ), 0);
   res_v = (vec_uint4)signbitf4(x6_v);
   TEST_CHECK("20060829000006AAN", allequal_uint4( res_v, r6_v ), 0);
   res_v = (vec_uint4)signbitf4(x7_v);
   TEST_CHECK("20060829000007AAN", allequal_uint4( res_v, r7_v ), 0);
   res_v = (vec_uint4)signbitf4(x8_v);
   TEST_CHECK("20060829000008AAN", allequal_uint4( res_v, r8_v ), 0);
   res_v = (vec_uint4)signbitf4(x9_v);
   TEST_CHECK("20060829000009AAN", allequal_uint4( res_v, r9_v ), 0);
   res_v = (vec_uint4)signbitf4(x10_v);
   TEST_CHECK("20060829000010AAN", allequal_uint4( res_v, r10_v ), 0);
   res_v = (vec_uint4)signbitf4(x11_v);
   TEST_CHECK("20060829000011AAN", allequal_uint4( res_v, r11_v ), 0);
   res_v = (vec_uint4)signbitf4(x12_v);
   TEST_CHECK("20060829000012AAN", allequal_uint4( res_v, r12_v ), 0);
   res_v = (vec_uint4)signbitf4(x13_v);
   TEST_CHECK("20060829000013AAN", allequal_uint4( res_v, r13_v ), 0);
   res_v = (vec_uint4)signbitf4(x14_v);
   TEST_CHECK("20060829000014AAN", allequal_uint4( res_v, r14_v ), 0);
   res_v = (vec_uint4)signbitf4(x15_v);
   TEST_CHECK("20060829000015AAN", allequal_uint4( res_v, r15_v ), 0);
   
   TEST_SET_DONE();
   
   TEST_EXIT();
}
Example #14
0
int main()
{
   TEST_SET_START("20040916103300EJL","EJL", "ceilf");
   
   unsigned int i3 = 0x4affffff;  // 2^23 - 0.5, largest truncatable value.           
   unsigned int i3i = 0x4b000000;                                                       
   unsigned int i4 = 0x4b000000;  // 2^23, no fractional part.                        
   unsigned int i5 = 0xcf000001;  // -2^31, one more large, and negative, value.      

   float x0 = hide_float(0.91825f);
   float x0i = hide_float(1.0f);
   float x1 = hide_float(-0.12958f);
   float x1i = hide_float(0.0f);
   float x2 = hide_float(-79615.1875f);
   float x2i = hide_float(-79615.0f);
   float x3 = hide_float(make_float(i3));
   float x3i = hide_float(make_float(i3i));
   float x4 = hide_float(make_float(i4));
   float x4i = hide_float(make_float(i4));
   float x5 = hide_float(make_float(i5));
   float x5i = hide_float(make_float(i5));

   vec_float4 x0_v = spu_splats(x0);
   vec_float4 x0i_v = spu_splats(x0i);
   vec_float4 x1_v = spu_splats(x1);
   vec_float4 x1i_v = spu_splats(x1i);
   vec_float4 x2_v = spu_splats(x2);
   vec_float4 x2i_v = spu_splats(x2i);
   vec_float4 x3_v = spu_splats(x3);
   vec_float4 x3i_v = spu_splats(x3i);
   vec_float4 x4_v = spu_splats(x4);
   vec_float4 x4i_v = spu_splats(x4i);
   vec_float4 x5_v = spu_splats(x5);
   vec_float4 x5i_v = spu_splats(x5i);
   
   float res;
   vec_float4 res_v;

   TEST_START("ceilf4");
   res_v = ceilf4(x0_v);
   TEST_CHECK("20040916103310EJL", allequal_float4( res_v, x0i_v ), 0);
   res_v = ceilf4(x1_v);
   TEST_CHECK("20040916103324EJL", allequal_float4( res_v, x1i_v ), 0);
   res_v = ceilf4(x2_v);
   TEST_CHECK("20040916103334EJL", allequal_float4( res_v, x2i_v ), 0);
   res_v = ceilf4(x3_v);
   TEST_CHECK("20040916103341EJL", allequal_float4( res_v, x3i_v ), 0);
   res_v = ceilf4(x4_v);
   TEST_CHECK("20040916103350EJL", allequal_float4( res_v, x4i_v ), 0);
   res_v = ceilf4(x5_v);
   TEST_CHECK("20040916103357EJL", allequal_float4( res_v, x5i_v ), 0);
   
   TEST_START("ceilf");
   res = ceilf(x0);
   TEST_CHECK("20040916103407EJL", res == x0i, 0);
   res = ceilf(x1);
   TEST_CHECK("20040916103418EJL", res == x1i, 0);
   res = ceilf(x2);
   TEST_CHECK("20040916103428EJL", res == x2i, 0);
   res = ceilf(x3);
   TEST_CHECK("20040916103437EJL", res == x3i, 0);
   res = ceilf(x4);
   TEST_CHECK("20040916103448EJL", res == x4i, 0);
   res = ceilf(x5);
   TEST_CHECK("20040916103457EJL", res == x5i, 0);
   
   TEST_SET_DONE();
   
   TEST_EXIT();
}