OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.target/] [powerpc/] [vsx-vector-5.c] - Diff between revs 322 and 338

Only display areas with differences | Details | Blame | View Log

Rev 322 Rev 338
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mvsx -O2" } */
/* { dg-options "-mvsx -O2" } */
 
 
/* This will run, and someday we should add the support to test whether we are
/* This will run, and someday we should add the support to test whether we are
   running on VSX hardware.  */
   running on VSX hardware.  */
 
 
#include <altivec.h>
#include <altivec.h>
#include <stdlib.h>
#include <stdlib.h>
 
 
#ifdef DEBUG
#ifdef DEBUG
#include <stdio.h>
#include <stdio.h>
 
 
static int errors = 0;
static int errors = 0;
#endif
#endif
 
 
union args {
union args {
  double scalar[2];
  double scalar[2];
  vector double vect;
  vector double vect;
};
};
 
 
union largs {
union largs {
  unsigned long scalar[2];
  unsigned long scalar[2];
  vector bool long vect;
  vector bool long vect;
};
};
 
 
static void
static void
do_test (union args *expected, union args *got, const char *name)
do_test (union args *expected, union args *got, const char *name)
{
{
  if (expected->scalar[0] != got->scalar[0]
  if (expected->scalar[0] != got->scalar[0]
      || expected->scalar[1] != got->scalar[1])
      || expected->scalar[1] != got->scalar[1])
    {
    {
#ifdef DEBUG
#ifdef DEBUG
      printf ("%s failed!\n", name);
      printf ("%s failed!\n", name);
      errors++;
      errors++;
#else
#else
      abort ();
      abort ();
#endif
#endif
    }
    }
}
}
 
 
static void
static void
do_ltest (union largs *expected, union largs *got, const char *name)
do_ltest (union largs *expected, union largs *got, const char *name)
{
{
  if (expected->scalar[0] != got->scalar[0]
  if (expected->scalar[0] != got->scalar[0]
      || expected->scalar[1] != got->scalar[1])
      || expected->scalar[1] != got->scalar[1])
    {
    {
#ifdef DEBUG
#ifdef DEBUG
      printf ("%s failed!\n", name);
      printf ("%s failed!\n", name);
      errors++;
      errors++;
#else
#else
      abort ();
      abort ();
#endif
#endif
    }
    }
}
}
 
 


/* Vec functions taking a single argument.  */
/* Vec functions taking a single argument.  */
static vector double
static vector double
vabs (vector double arg)
vabs (vector double arg)
{
{
  return vec_abs (arg);
  return vec_abs (arg);
}
}
 
 
static vector double
static vector double
vceil (vector double arg)
vceil (vector double arg)
{
{
  return vec_ceil (arg);
  return vec_ceil (arg);
}
}
 
 
static vector double
static vector double
vfloor (vector double arg)
vfloor (vector double arg)
{
{
  return vec_floor (arg);
  return vec_floor (arg);
}
}
 
 
static vector double
static vector double
vnearbyint (vector double arg)
vnearbyint (vector double arg)
{
{
  return vec_nearbyint (arg);
  return vec_nearbyint (arg);
}
}
 
 
static vector double
static vector double
vrint (vector double arg)
vrint (vector double arg)
{
{
  return vec_rint (arg);
  return vec_rint (arg);
}
}
 
 
static vector double
static vector double
vsqrt (vector double arg)
vsqrt (vector double arg)
{
{
  return vec_sqrt (arg);
  return vec_sqrt (arg);
}
}
 
 
/* Single argument tests.  */
/* Single argument tests.  */
static struct
static struct
{
{
  union args result;
  union args result;
  union args input;
  union args input;
  vector double (*func) (vector double);
  vector double (*func) (vector double);
  const char *name;
  const char *name;
} arg1_tests[] = {
} arg1_tests[] = {
  /* result             input                   function        name */
  /* result             input                   function        name */
  { {  1.0,  2.0 },     { -1.0,  2.0 },         vabs,           "vabs" },
  { {  1.0,  2.0 },     { -1.0,  2.0 },         vabs,           "vabs" },
  { {  1.0,  2.0 },     {  1.0, -2.0 },         vabs,           "vabs" },
  { {  1.0,  2.0 },     {  1.0, -2.0 },         vabs,           "vabs" },
  { {  2.0,  2.0 },     {  1.1,  1.7 },         vceil,          "vceil" },
  { {  2.0,  2.0 },     {  1.1,  1.7 },         vceil,          "vceil" },
  { { -1.0, -1.0 },     { -1.1, -1.7 },         vceil,          "vceil" },
  { { -1.0, -1.0 },     { -1.1, -1.7 },         vceil,          "vceil" },
  { { -1.0,  2.0 },     { -1.5,  1.5 },         vceil,          "vceil" },
  { { -1.0,  2.0 },     { -1.5,  1.5 },         vceil,          "vceil" },
  { {  1.0,  1.0 },     {  1.1,  1.7 },         vfloor,         "vfloor" },
  { {  1.0,  1.0 },     {  1.1,  1.7 },         vfloor,         "vfloor" },
  { { -2.0, -2.0 },     { -1.1, -1.7 },         vfloor,         "vfloor" },
  { { -2.0, -2.0 },     { -1.1, -1.7 },         vfloor,         "vfloor" },
  { { -2.0,  1.0 },     { -1.5,  1.5 },         vfloor,         "vfloor" },
  { { -2.0,  1.0 },     { -1.5,  1.5 },         vfloor,         "vfloor" },
  { {  1.0,  2.0 },     {  1.1,  1.7 },         vnearbyint,     "vnearbyint" },
  { {  1.0,  2.0 },     {  1.1,  1.7 },         vnearbyint,     "vnearbyint" },
  { { -1.0, -2.0 },     { -1.1, -1.7 },         vnearbyint,     "vnearbyint" },
  { { -1.0, -2.0 },     { -1.1, -1.7 },         vnearbyint,     "vnearbyint" },
  { { -2.0,  2.0 },     { -1.5,  1.5 },         vnearbyint,     "vnearbyint" },
  { { -2.0,  2.0 },     { -1.5,  1.5 },         vnearbyint,     "vnearbyint" },
  { {  1.0,  2.0 },     {  1.1,  1.7 },         vrint,          "vrint" },
  { {  1.0,  2.0 },     {  1.1,  1.7 },         vrint,          "vrint" },
  { { -1.0, -2.0 },     { -1.1, -1.7 },         vrint,          "vrint" },
  { { -1.0, -2.0 },     { -1.1, -1.7 },         vrint,          "vrint" },
  { { -2.0,  2.0 },     { -1.5,  1.5 },         vrint,          "vrint" },
  { { -2.0,  2.0 },     { -1.5,  1.5 },         vrint,          "vrint" },
  { {  2.0,  4.0 },     {  4.0, 16.0 },         vsqrt,          "vsqrt" },
  { {  2.0,  4.0 },     {  4.0, 16.0 },         vsqrt,          "vsqrt" },
};
};
 
 
static void
static void
test_arg1 (void)
test_arg1 (void)
{
{
  unsigned i;
  unsigned i;
 
 
#ifdef DEBUG
#ifdef DEBUG
  printf ("Single argument tests:\n");
  printf ("Single argument tests:\n");
#endif
#endif
 
 
  for (i = 0; i < sizeof (arg1_tests) / sizeof (arg1_tests[0]); i++)
  for (i = 0; i < sizeof (arg1_tests) / sizeof (arg1_tests[0]); i++)
    {
    {
      union args u;
      union args u;
      u.vect = arg1_tests[i].func (arg1_tests[i].input.vect);
      u.vect = arg1_tests[i].func (arg1_tests[i].input.vect);
 
 
#ifdef DEBUG
#ifdef DEBUG
      printf ("test %-16s: expected { %4g, %4g }, got { %4g, %4g }, input { %4g, %4g }\n",
      printf ("test %-16s: expected { %4g, %4g }, got { %4g, %4g }, input { %4g, %4g }\n",
              arg1_tests[i].name,
              arg1_tests[i].name,
              arg1_tests[i].result.scalar[0],
              arg1_tests[i].result.scalar[0],
              arg1_tests[i].result.scalar[1],
              arg1_tests[i].result.scalar[1],
              u.scalar[0],
              u.scalar[0],
              u.scalar[1],
              u.scalar[1],
              arg1_tests[i].input.scalar[0],
              arg1_tests[i].input.scalar[0],
              arg1_tests[i].input.scalar[1]);
              arg1_tests[i].input.scalar[1]);
#endif
#endif
 
 
      do_test (&arg1_tests[i].result, &u, arg1_tests[i].name);
      do_test (&arg1_tests[i].result, &u, arg1_tests[i].name);
    }
    }
 
 
  return;
  return;
}
}
 
 


/* Vect functions taking 2 arguments.  */
/* Vect functions taking 2 arguments.  */
static vector double
static vector double
vadd (vector double arg1, vector double arg2)
vadd (vector double arg1, vector double arg2)
{
{
  return vec_add (arg1, arg2);
  return vec_add (arg1, arg2);
}
}
 
 
static vector double
static vector double
vadd2 (vector double arg1, vector double arg2)
vadd2 (vector double arg1, vector double arg2)
{
{
  return arg1 + arg2;
  return arg1 + arg2;
}
}
 
 
static vector double
static vector double
vsub (vector double arg1, vector double arg2)
vsub (vector double arg1, vector double arg2)
{
{
  return vec_sub (arg1, arg2);
  return vec_sub (arg1, arg2);
}
}
 
 
static vector double
static vector double
vsub2 (vector double arg1, vector double arg2)
vsub2 (vector double arg1, vector double arg2)
{
{
  return arg1 - arg2;
  return arg1 - arg2;
}
}
 
 
static vector double
static vector double
vmul (vector double arg1, vector double arg2)
vmul (vector double arg1, vector double arg2)
{
{
  return vec_mul (arg1, arg2);
  return vec_mul (arg1, arg2);
}
}
 
 
static vector double
static vector double
vmul2 (vector double arg1, vector double arg2)
vmul2 (vector double arg1, vector double arg2)
{
{
  return arg1 * arg2;
  return arg1 * arg2;
}
}
 
 
static vector double
static vector double
vdiv (vector double arg1, vector double arg2)
vdiv (vector double arg1, vector double arg2)
{
{
  return vec_div (arg1, arg2);
  return vec_div (arg1, arg2);
}
}
 
 
static vector double
static vector double
vdiv2 (vector double arg1, vector double arg2)
vdiv2 (vector double arg1, vector double arg2)
{
{
  return arg1 / arg2;
  return arg1 / arg2;
}
}
 
 
static vector double
static vector double
vmax (vector double arg1, vector double arg2)
vmax (vector double arg1, vector double arg2)
{
{
  return vec_max (arg1, arg2);
  return vec_max (arg1, arg2);
}
}
 
 
static vector double
static vector double
vmin (vector double arg1, vector double arg2)
vmin (vector double arg1, vector double arg2)
{
{
  return vec_min (arg1, arg2);
  return vec_min (arg1, arg2);
}
}
 
 
/* 2 argument tests.  */
/* 2 argument tests.  */
static struct
static struct
{
{
  union args result;
  union args result;
  union args input[2];
  union args input[2];
  vector double (*func) (vector double, vector double);
  vector double (*func) (vector double, vector double);
  const char *name;
  const char *name;
} arg2_tests[] = {
} arg2_tests[] = {
  /* result */
  /* result */
  { {  4.0,  6.0 },     { {  1.0,  2.0 }, {  3.0,  4.0 } },     vadd,   "vadd"  },
  { {  4.0,  6.0 },     { {  1.0,  2.0 }, {  3.0,  4.0 } },     vadd,   "vadd"  },
  { {  4.0, -6.0 },     { {  1.0, -2.0 }, {  3.0, -4.0 } },     vadd,   "vadd"  },
  { {  4.0, -6.0 },     { {  1.0, -2.0 }, {  3.0, -4.0 } },     vadd,   "vadd"  },
  { {  4.0,  6.0 },     { {  1.0,  2.0 }, {  3.0,  4.0 } },     vadd2,  "vadd2" },
  { {  4.0,  6.0 },     { {  1.0,  2.0 }, {  3.0,  4.0 } },     vadd2,  "vadd2" },
  { {  4.0, -6.0 },     { {  1.0, -2.0 }, {  3.0, -4.0 } },     vadd2,  "vadd2" },
  { {  4.0, -6.0 },     { {  1.0, -2.0 }, {  3.0, -4.0 } },     vadd2,  "vadd2" },
  { { -2.0, -2.0 },     { {  1.0,  2.0 }, {  3.0,  4.0 } },     vsub,   "vsub"  },
  { { -2.0, -2.0 },     { {  1.0,  2.0 }, {  3.0,  4.0 } },     vsub,   "vsub"  },
  { { -2.0,  2.0 },     { {  1.0, -2.0 }, {  3.0, -4.0 } },     vsub,   "vsub"  },
  { { -2.0,  2.0 },     { {  1.0, -2.0 }, {  3.0, -4.0 } },     vsub,   "vsub"  },
  { { -2.0, -2.0 },     { {  1.0,  2.0 }, {  3.0,  4.0 } },     vsub2,  "vsub2" },
  { { -2.0, -2.0 },     { {  1.0,  2.0 }, {  3.0,  4.0 } },     vsub2,  "vsub2" },
  { { -2.0,  2.0 },     { {  1.0, -2.0 }, {  3.0, -4.0 } },     vsub2,  "vsub2" },
  { { -2.0,  2.0 },     { {  1.0, -2.0 }, {  3.0, -4.0 } },     vsub2,  "vsub2" },
  { {  6.0,  4.0 },     { {  2.0,  8.0 }, {  3.0,  0.5 } },     vmul,   "vmul"  },
  { {  6.0,  4.0 },     { {  2.0,  8.0 }, {  3.0,  0.5 } },     vmul,   "vmul"  },
  { {  6.0,  4.0 },     { {  2.0,  8.0 }, {  3.0,  0.5 } },     vmul2,  "vmul2" },
  { {  6.0,  4.0 },     { {  2.0,  8.0 }, {  3.0,  0.5 } },     vmul2,  "vmul2" },
  { {  2.0,  0.5 },     { {  6.0,  4.0 }, {  3.0,  8.0 } },     vdiv,   "vdiv"  },
  { {  2.0,  0.5 },     { {  6.0,  4.0 }, {  3.0,  8.0 } },     vdiv,   "vdiv"  },
  { {  2.0,  0.5 },     { {  6.0,  4.0 }, {  3.0,  8.0 } },     vdiv2,  "vdiv2" },
  { {  2.0,  0.5 },     { {  6.0,  4.0 }, {  3.0,  8.0 } },     vdiv2,  "vdiv2" },
  { {  3.0,  4.0 },     { {  1.0,  2.0 }, {  3.0,  4.0 } },     vmax,   "vmax"  },
  { {  3.0,  4.0 },     { {  1.0,  2.0 }, {  3.0,  4.0 } },     vmax,   "vmax"  },
  { {  1.0,  4.0 },     { {  1.0, -2.0 }, { -3.0,  4.0 } },     vmax,   "vmax"  },
  { {  1.0,  4.0 },     { {  1.0, -2.0 }, { -3.0,  4.0 } },     vmax,   "vmax"  },
  { {  1.0,  2.0 },     { {  1.0,  2.0 }, {  3.0,  4.0 } },     vmin,   "vmin"  },
  { {  1.0,  2.0 },     { {  1.0,  2.0 }, {  3.0,  4.0 } },     vmin,   "vmin"  },
  { { -3.0, -2.0 },     { {  1.0, -2.0 }, { -3.0,  4.0 } },     vmin,   "vmin"  },
  { { -3.0, -2.0 },     { {  1.0, -2.0 }, { -3.0,  4.0 } },     vmin,   "vmin"  },
};
};
 
 
static void
static void
test_arg2 (void)
test_arg2 (void)
{
{
  unsigned i;
  unsigned i;
 
 
#ifdef DEBUG
#ifdef DEBUG
  printf ("\nTwo argument tests:\n");
  printf ("\nTwo argument tests:\n");
#endif
#endif
 
 
  for (i = 0; i < sizeof (arg2_tests) / sizeof (arg2_tests[0]); i++)
  for (i = 0; i < sizeof (arg2_tests) / sizeof (arg2_tests[0]); i++)
    {
    {
      union args u;
      union args u;
      u.vect = arg2_tests[i].func (arg2_tests[i].input[0].vect,
      u.vect = arg2_tests[i].func (arg2_tests[i].input[0].vect,
                                   arg2_tests[i].input[1].vect);
                                   arg2_tests[i].input[1].vect);
 
 
#ifdef DEBUG
#ifdef DEBUG
      printf ("test %-16s: expected { %4g, %4g }, got { %4g, %4g }, input { %4g, %4g }, { %4g, %4g }\n",
      printf ("test %-16s: expected { %4g, %4g }, got { %4g, %4g }, input { %4g, %4g }, { %4g, %4g }\n",
              arg2_tests[i].name,
              arg2_tests[i].name,
              arg2_tests[i].result.scalar[0],
              arg2_tests[i].result.scalar[0],
              arg2_tests[i].result.scalar[1],
              arg2_tests[i].result.scalar[1],
              u.scalar[0],
              u.scalar[0],
              u.scalar[1],
              u.scalar[1],
              arg2_tests[i].input[0].scalar[0],
              arg2_tests[i].input[0].scalar[0],
              arg2_tests[i].input[0].scalar[1],
              arg2_tests[i].input[0].scalar[1],
              arg2_tests[i].input[1].scalar[0],
              arg2_tests[i].input[1].scalar[0],
              arg2_tests[i].input[1].scalar[1]);
              arg2_tests[i].input[1].scalar[1]);
#endif
#endif
 
 
      do_test (&arg2_tests[i].result, &u, arg2_tests[i].name);
      do_test (&arg2_tests[i].result, &u, arg2_tests[i].name);
    }
    }
 
 
  return;
  return;
}
}
 
 


/* Comparisons, returnning a boolean vector.  */
/* Comparisons, returnning a boolean vector.  */
static vector bool long
static vector bool long
vcmpeq (vector double arg1, vector double arg2)
vcmpeq (vector double arg1, vector double arg2)
{
{
  return vec_cmpeq (arg1, arg2);
  return vec_cmpeq (arg1, arg2);
}
}
 
 
static vector bool long
static vector bool long
vcmplt (vector double arg1, vector double arg2)
vcmplt (vector double arg1, vector double arg2)
{
{
  return vec_cmplt (arg1, arg2);
  return vec_cmplt (arg1, arg2);
}
}
 
 
static vector bool long
static vector bool long
vcmple (vector double arg1, vector double arg2)
vcmple (vector double arg1, vector double arg2)
{
{
  return vec_cmple (arg1, arg2);
  return vec_cmple (arg1, arg2);
}
}
 
 
static vector bool long
static vector bool long
vcmpgt (vector double arg1, vector double arg2)
vcmpgt (vector double arg1, vector double arg2)
{
{
  return vec_cmpgt (arg1, arg2);
  return vec_cmpgt (arg1, arg2);
}
}
 
 
static vector bool long
static vector bool long
vcmpge (vector double arg1, vector double arg2)
vcmpge (vector double arg1, vector double arg2)
{
{
  return vec_cmpge (arg1, arg2);
  return vec_cmpge (arg1, arg2);
}
}
 
 
#define ONE  0xffffffffffffffffUL
#define ONE  0xffffffffffffffffUL
#define ZERO 0x0000000000000000UL
#define ZERO 0x0000000000000000UL
 
 
/* comparison tests.  */
/* comparison tests.  */
static struct
static struct
{
{
  union largs result;
  union largs result;
  union args input[2];
  union args input[2];
  vector bool long (*func) (vector double, vector double);
  vector bool long (*func) (vector double, vector double);
  const char *name;
  const char *name;
} argcmp_tests[] = {
} argcmp_tests[] = {
  { { ONE,  ZERO }, { {  1.0,  2.0 }, {  1.0, -2.0 } }, vcmpeq, "vcmpeq" },
  { { ONE,  ZERO }, { {  1.0,  2.0 }, {  1.0, -2.0 } }, vcmpeq, "vcmpeq" },
  { { ZERO, ONE  }, { { -1.0,  2.0 }, {  1.0,  2.0 } }, vcmpeq, "vcmpeq" },
  { { ZERO, ONE  }, { { -1.0,  2.0 }, {  1.0,  2.0 } }, vcmpeq, "vcmpeq" },
 
 
  { { ONE,  ONE  }, { {  1.0, -2.0 }, {  1.0, -2.0 } }, vcmple, "vcmple" },
  { { ONE,  ONE  }, { {  1.0, -2.0 }, {  1.0, -2.0 } }, vcmple, "vcmple" },
  { { ONE,  ONE  }, { {  1.0, -2.0 }, {  2.0, -1.0 } }, vcmple, "vcmple" },
  { { ONE,  ONE  }, { {  1.0, -2.0 }, {  2.0, -1.0 } }, vcmple, "vcmple" },
  { { ZERO, ZERO }, { {  2.0, -1.0 }, {  1.0, -2.0 } }, vcmple, "vcmple" },
  { { ZERO, ZERO }, { {  2.0, -1.0 }, {  1.0, -2.0 } }, vcmple, "vcmple" },
 
 
  { { ZERO, ZERO }, { {  1.0, -2.0 }, {  1.0, -2.0 } }, vcmplt, "vcmplt" },
  { { ZERO, ZERO }, { {  1.0, -2.0 }, {  1.0, -2.0 } }, vcmplt, "vcmplt" },
  { { ONE,  ONE  }, { {  1.0, -2.0 }, {  2.0, -1.0 } }, vcmplt, "vcmplt" },
  { { ONE,  ONE  }, { {  1.0, -2.0 }, {  2.0, -1.0 } }, vcmplt, "vcmplt" },
  { { ZERO, ZERO }, { {  2.0, -1.0 }, {  1.0, -2.0 } }, vcmplt, "vcmplt" },
  { { ZERO, ZERO }, { {  2.0, -1.0 }, {  1.0, -2.0 } }, vcmplt, "vcmplt" },
 
 
  { { ZERO, ZERO }, { {  1.0, -2.0 }, {  1.0, -2.0 } }, vcmpgt, "vcmpgt" },
  { { ZERO, ZERO }, { {  1.0, -2.0 }, {  1.0, -2.0 } }, vcmpgt, "vcmpgt" },
  { { ZERO, ZERO }, { {  1.0, -2.0 }, {  2.0, -1.0 } }, vcmpgt, "vcmpgt" },
  { { ZERO, ZERO }, { {  1.0, -2.0 }, {  2.0, -1.0 } }, vcmpgt, "vcmpgt" },
  { { ONE,  ONE  }, { {  2.0, -1.0 }, {  1.0, -2.0 } }, vcmpgt, "vcmpgt" },
  { { ONE,  ONE  }, { {  2.0, -1.0 }, {  1.0, -2.0 } }, vcmpgt, "vcmpgt" },
 
 
  { { ONE,  ONE  }, { {  1.0, -2.0 }, {  1.0, -2.0 } }, vcmpge, "vcmpge" },
  { { ONE,  ONE  }, { {  1.0, -2.0 }, {  1.0, -2.0 } }, vcmpge, "vcmpge" },
  { { ZERO, ZERO }, { {  1.0, -2.0 }, {  2.0, -1.0 } }, vcmpge, "vcmpge" },
  { { ZERO, ZERO }, { {  1.0, -2.0 }, {  2.0, -1.0 } }, vcmpge, "vcmpge" },
  { { ONE,  ONE  }, { {  2.0, -1.0 }, {  1.0, -2.0 } }, vcmpge, "vcmpge" },
  { { ONE,  ONE  }, { {  2.0, -1.0 }, {  1.0, -2.0 } }, vcmpge, "vcmpge" },
};
};
 
 
static void
static void
test_argcmp (void)
test_argcmp (void)
{
{
  unsigned i;
  unsigned i;
 
 
#ifdef DEBUG
#ifdef DEBUG
  printf ("\nComparison tests:\n");
  printf ("\nComparison tests:\n");
#endif
#endif
 
 
  for (i = 0; i < sizeof (argcmp_tests) / sizeof (argcmp_tests[0]); i++)
  for (i = 0; i < sizeof (argcmp_tests) / sizeof (argcmp_tests[0]); i++)
    {
    {
      union largs u;
      union largs u;
      u.vect = argcmp_tests[i].func (argcmp_tests[i].input[0].vect,
      u.vect = argcmp_tests[i].func (argcmp_tests[i].input[0].vect,
                                     argcmp_tests[i].input[1].vect);
                                     argcmp_tests[i].input[1].vect);
 
 
#ifdef DEBUG
#ifdef DEBUG
      printf ("test %-16s: expected { 0x%016lx, 0x%016lx }, got { 0x%016lx, 0x%016lx }, input { %4g, %4g }, { %4g, %4g }\n",
      printf ("test %-16s: expected { 0x%016lx, 0x%016lx }, got { 0x%016lx, 0x%016lx }, input { %4g, %4g }, { %4g, %4g }\n",
              argcmp_tests[i].name,
              argcmp_tests[i].name,
              argcmp_tests[i].result.scalar[0],
              argcmp_tests[i].result.scalar[0],
              argcmp_tests[i].result.scalar[1],
              argcmp_tests[i].result.scalar[1],
              u.scalar[0],
              u.scalar[0],
              u.scalar[1],
              u.scalar[1],
              argcmp_tests[i].input[0].scalar[0],
              argcmp_tests[i].input[0].scalar[0],
              argcmp_tests[i].input[0].scalar[1],
              argcmp_tests[i].input[0].scalar[1],
              argcmp_tests[i].input[1].scalar[0],
              argcmp_tests[i].input[1].scalar[0],
              argcmp_tests[i].input[1].scalar[1]);
              argcmp_tests[i].input[1].scalar[1]);
#endif
#endif
 
 
      do_ltest (&argcmp_tests[i].result, &u, argcmp_tests[i].name);
      do_ltest (&argcmp_tests[i].result, &u, argcmp_tests[i].name);
    }
    }
 
 
  return;
  return;
}
}
 
 


int
int
main (int argc, char *argv[])
main (int argc, char *argv[])
{
{
  test_arg1 ();
  test_arg1 ();
  test_arg2 ();
  test_arg2 ();
  test_argcmp ();
  test_argcmp ();
 
 
#ifdef DEBUG
#ifdef DEBUG
  if (errors)
  if (errors)
    {
    {
      printf ("There were %d error(s)\n", errors);
      printf ("There were %d error(s)\n", errors);
      return errors;
      return errors;
    }
    }
  else
  else
    printf ("There were no errors\n");
    printf ("There were no errors\n");
#endif
#endif
 
 
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.