static void
ssse3_test (void)
{
  int i;
  int r [4] __attribute__ ((aligned(16)));
  int ck [4];
  int fail = 0;

  for (i = 0; i < 256; i += 8)
    {
      /* Manually compute the result */
      compute_correct_result (&vals[i + 0], &vals[i + 4], ck);

      /* Run the 64-bit tests */
      ssse3_test_pmaddubsw (&vals[i + 0], &vals[i + 4], &r[0]);
      ssse3_test_pmaddubsw (&vals[i + 2], &vals[i + 6], &r[2]);
      fail += chk_128 (ck, r);

      /* Run the 128-bit tests */
      ssse3_test_pmaddubsw128 (&vals[i + 0], &vals[i + 4], r);
      fail += chk_128 (ck, r);
    }

  if (fail != 0)
    abort ();
}
Exemple #2
0
static void
TEST (void)
{
    int i;
    int r [4] __attribute__ ((aligned(16)));
    int ck [4];
    int fail = 0;

    for (i = 0; i < 256; i += 8)
    {
#ifndef __AVX__
        /* Manually compute the result */
        compute_correct_result_64 (&vals[i + 0], &vals[i + 4], ck);

        /* Run the 64-bit tests */
        ssse3_test_pshufb (&vals[i + 0], &vals[i + 4], &r[0]);
        ssse3_test_pshufb (&vals[i + 2], &vals[i + 6], &r[2]);
        fail += chk_128 (ck, r);
#endif

        /* Recompute the result for 128-bits */
        compute_correct_result_128 (&vals[i + 0], &vals[i + 4], ck);

        /* Run the 128-bit tests */
        ssse3_test_pshufb128 (&vals[i + 0], &vals[i + 4], r);
        fail += chk_128 (ck, r);
    }

    if (fail != 0)
        abort ();
}