Exemple #1
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();
}
Exemple #2
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();
}
Exemple #3
0
int main()
{
   TEST_SET_START("20060901150000MH","MH", "divu4");

   unsigned int x0n = 0xffccb78d;
   unsigned int x0d = 0x0       ;
   unsigned int x0q = 0x0       ;
   unsigned int x0r = 0xffccb78d;
   unsigned int x1n = 0xff978333;
   unsigned int x1d = 0xff976bb6;
   unsigned int x1q = 0x1       ;
   unsigned int x1r = 0x177d    ;
   unsigned int x2n = 0x5e146   ;
   unsigned int x2d = 0xd14ebe0e;
   unsigned int x2q = 0x0       ;
   unsigned int x2r = 0x5e146   ;
   unsigned int x3n = 0xf0e91618;
   unsigned int x3d = 0xfddff7ac;
   unsigned int x3q = 0x0       ;
   unsigned int x3r = 0xf0e91618;
                       
   unsigned int x4n = 0xf2128d9d;
   unsigned int x4d = 0xe0f76   ;
   unsigned int x4q = 0x1137    ;
   unsigned int x4r = 0x66543   ;
   unsigned int x5n = 0xda1ba2ce;
   unsigned int x5d = 0x4c9     ;
   unsigned int x5q = 0x2d9482  ;
   unsigned int x5r = 0xbc      ;
   unsigned int x6n = 0xdd4426a6;
   unsigned int x6d = 0xf8d245cf;
   unsigned int x6q = 0x0       ;
   unsigned int x6r = 0xdd4426a6;
   unsigned int x7n = 0xd1d5ae9 ;
   unsigned int x7d = 0x333ab105;
   unsigned int x7q = 0x0       ;
   unsigned int x7r = 0xd1d5ae9 ;
                       
   unsigned int x8n = 0x3e0c6   ;
   unsigned int x8d = 0xfff24255;
   unsigned int x8q = 0x0       ;
   unsigned int x8r = 0x3e0c6   ;
   unsigned int x9n = 0xfd6fe27e;
   unsigned int x9d = 0xf32454  ;
   unsigned int x9q = 0x10a     ;
   unsigned int x9r = 0xcc2336  ;
   unsigned int x10n =0xfb150f79;
   unsigned int x10d =0xf521    ;
   unsigned int x10q =0x10637   ;
   unsigned int x10r =0x9f62    ;
   unsigned int x11n =0xfe88071f;
   unsigned int x11d =0xfff937c2;
   unsigned int x11q =0x0       ;
   unsigned int x11r =0xfe88071f;

   unsigned int x12n =0xc374fa4 ;
   unsigned int x12d =0x1234    ;
   unsigned int x12q =0xabcd    ;
   unsigned int x12r =0x0       ;
   unsigned int x13n =0xffffffff;
   unsigned int x13d =0x2       ;
   unsigned int x13q =0x7fffffff;
   unsigned int x13r =0x1       ;
   unsigned int x14n =0x0       ;
   unsigned int x14d =0x12345678;
   unsigned int x14q =0x0       ;
   unsigned int x14r =0x0       ;
   unsigned int x15n =0xffffffff;
   unsigned int x15d =0x1       ;
   unsigned int x15q =0xffffffff;
   unsigned int x15r =0x0       ;

   vec_uint4 x0n_v = (vec_uint4){ x0n, x1n, x2n, x3n };
   vec_uint4 x1n_v = (vec_uint4){ x4n, x5n, x6n, x7n };
   vec_uint4 x2n_v = (vec_uint4){ x8n, x9n, x10n, x11n };
   vec_uint4 x3n_v = (vec_uint4){ x12n, x13n, x14n, x15n };

   vec_uint4 x0d_v = (vec_uint4){ x0d, x1d, x2d, x3d };
   vec_uint4 x1d_v = (vec_uint4){ x4d, x5d, x6d, x7d };
   vec_uint4 x2d_v = (vec_uint4){ x8d, x9d, x10d, x11d };
   vec_uint4 x3d_v = (vec_uint4){ x12d, x13d, x14d, x15d };

   vec_uint4 x0q_v = (vec_uint4){ x0q, x1q, x2q, x3q };
   vec_uint4 x1q_v = (vec_uint4){ x4q, x5q, x6q, x7q };
   vec_uint4 x2q_v = (vec_uint4){ x8q, x9q, x10q, x11q };
   vec_uint4 x3q_v = (vec_uint4){ x12q, x13q, x14q, x15q };

   vec_uint4 x0r_v = (vec_uint4){ x0r, x1r, x2r, x3r };
   vec_uint4 x1r_v = (vec_uint4){ x4r, x5r, x6r, x7r };
   vec_uint4 x2r_v = (vec_uint4){ x8r, x9r, x10r, x11r };
   vec_uint4 x3r_v = (vec_uint4){ x12r, x13r, x14r, x15r };
   
   divu4_t res;

   TEST_START("divu4");
   res = divu4(x0n_v, x0d_v);
   TEST_CHECK("20060901150001MH", allequal_uint4( res.quot, x0q_v ) && allequal_uint4( res.rem,  x0r_v ), 0);
   res = divu4(x1n_v, x1d_v);
   TEST_CHECK("20060901150002MH", allequal_uint4( res.quot, x1q_v ) && allequal_uint4( res.rem,  x1r_v ), 0);
   res = divu4(x2n_v, x2d_v);
   TEST_CHECK("20060901150003MH", allequal_uint4( res.quot, x2q_v ) && allequal_uint4( res.rem,  x2r_v ), 0);
   res = divu4(x3n_v, x3d_v);
   TEST_CHECK("20060901150004MH", allequal_uint4( res.quot, x3q_v ) && allequal_uint4( res.rem,  x3r_v ), 0);
   
   TEST_SET_DONE();
   
   TEST_EXIT();
}
Exemple #4
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();
}