int main() { TEST_SET_START("20040930102649EJL","EJL", "negatei4"); int x0n = hide_int(0); int x0p = hide_int(0); int x1n = hide_int(-83532); int x1p = hide_int(83532); int x2n = hide_int(-13152); int x2p = hide_int(13152); int x3n = hide_int(-1); int x3p = hide_int(1); vec_int4 x0n_v = vec_splat_int(x0n); vec_int4 x0p_v = vec_splat_int(x0p); vec_int4 x1n_v = vec_splat_int(x1n); vec_int4 x1p_v = vec_splat_int(x1p); vec_int4 x2n_v = vec_splat_int(x2n); vec_int4 x2p_v = vec_splat_int(x2p); vec_int4 x3n_v = vec_splat_int(x3n); vec_int4 x3p_v = vec_splat_int(x3p); vec_int4 res_v; TEST_START("negatei4"); res_v = negatei4(x0n_v); TEST_CHECK("20040930102652EJL", allequal_int4( res_v, x0p_v ), 0); res_v = negatei4(x0p_v); TEST_CHECK("20040930102653EJL", allequal_int4( res_v, x0n_v ), 0); res_v = negatei4(x1n_v); TEST_CHECK("20040930102655EJL", allequal_int4( res_v, x1p_v ), 0); res_v = negatei4(x1p_v); TEST_CHECK("20040930102657EJL", allequal_int4( res_v, x1n_v ), 0); res_v = negatei4(x2n_v); TEST_CHECK("20040930102659EJL", allequal_int4( res_v, x2p_v ), 0); res_v = negatei4(x2p_v); TEST_CHECK("20040930102701EJL", allequal_int4( res_v, x2n_v ), 0); res_v = negatei4(x3n_v); TEST_CHECK("20040930102703EJL", allequal_int4( res_v, x3p_v ), 0); res_v = negatei4(x3p_v); TEST_CHECK("20040930102705EJL", allequal_int4( res_v, x3n_v ), 0); TEST_SET_DONE(); TEST_EXIT(); }
int main() { TEST_SET_START("20040908101807EJL","EJL", "abs"); int x0n = hide_int(0); int x0p = hide_int(0); int x1n = hide_int(-1); int x1p = hide_int(1); int x2n = hide_int(-83532); int x2p = hide_int(83532); vec_int4 x0n_v = vec_splat_int(x0n); vec_int4 x0p_v = vec_splat_int(x0p); vec_int4 x1n_v = vec_splat_int(x1n); vec_int4 x1p_v = vec_splat_int(x1p); vec_int4 x2n_v = vec_splat_int(x2n); vec_int4 x2p_v = vec_splat_int(x2p); vec_int4 res_v; TEST_START("absi4"); res_v = absi4(x0n_v); TEST_CHECK("20040908103824EJL", allequal_int4( res_v, x0p_v ), 0); res_v = absi4(x0p_v); TEST_CHECK("20040908103903EJL", allequal_int4( res_v, x0p_v ), 0); res_v = absi4(x1n_v); TEST_CHECK("20040908103905EJL", allequal_int4( res_v, x1p_v ), 0); res_v = absi4(x1p_v); TEST_CHECK("20040908114003EJL", allequal_int4( res_v, x1p_v ), 0); res_v = absi4(x2n_v); TEST_CHECK("20040908114714EJL", allequal_int4( res_v, x2p_v ), 0); res_v = absi4(x2p_v); TEST_CHECK("20040908114715EJL", allequal_int4( res_v, x2p_v ), 0); TEST_SET_DONE(); TEST_EXIT(); }