示例#1
0
int
main (void)
{
  uint64_t args[] = { 0x0, 0xdeadbeef, ~0xdeadbeef, 0xffff,
                      ~0xffff, 0xffffffff, ~0xffffffff, ~0x0 };
  int i, j;

  for (i = 0; i < sizeof (args) / sizeof (args[0]); ++i)
    {
       for (j = 0; j < sizeof (args) / sizeof (args[0]); ++j)
         {
           uint64_t a1 = args[i];
           uint64_t a2 = args[j];
           uint64_t res = vtst_p64 (vreinterpret_p64_u64 (a1),
                                    vreinterpret_p64_u64 (a2));
           uint64_t exp = (a1 & a2) ? ~0x0 : 0x0;

           if (res != exp)
             {
               fprintf (stderr, "vtst_p64 (a1= %lx, a2= %lx)"
                                " returned %lx, expected %lx\n",
                                 a1, a2, res, exp);
               abort ();
             }
         }
    }
  return 0;
}
uint64x1_t test_vtst_p64(poly64x1_t a, poly64x1_t b) {
  // CHECK-LABEL: test_vtst_p64
  return vtst_p64(a, b);
  // CHECK: cmtst {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
}