testint.c File Reference

#include <stdio.h>
#include "arith.h"
#include "arith.internal.h"
Include dependency graph for testint.c:

Go to the source code of this file.

Defines

#define IS_SUPPORTED_INT_TYPE(t)
#define is_zero8(v)   (DSEXT8(v) == 0)
#define is_neg8(v)   (((v) & 0x80) != 0)
#define is_zero16(v)   (DSEXT16(v) == 0)
#define is_neg16(v)   (((v) & 0x8000) != 0)
#define is_zero32(v)   (DSEXT32(v) == 0)
#define is_neg32(v)   (((v) & 0x80000000) != 0)
#define is_zero46(v)   ((v) == 0)
#define is_neg46(v)   ((v) < 0)
#define is_zero64(v)   ((v) == 0)
#define is_neg64(v)   ((v) < 0)
#define TEST_BINARY_BIT_OP_SIGNED(size, opr, func)
#define TEST_BINARY_BIT_OP_UNSIGNED(size, opr, func)
#define TEST_BINARY_BIT_OP_TYPES(opr, func)
#define TEST_UNARY_BIT_OP_SIGNED(size, opr, func)
#define TEST_UNARY_BIT_OP_UNSIGNED(size, opr, func)
#define TEST_UNARY_BIT_OP_TYPES(opr, func)
#define TEST_SHIFT_OP_SIGNED(size, max_shift, opr, func)
#define TEST_SHIFT_OP_UNSIGNED(size, max_shift, opr, func)
#define TEST_SHIFT_OP_TYPES(opr, func)
#define TEST_DSHIFT_OP_SIGNED(size, max_shift, opr)
#define TEST_DSHIFT_OP_UNSIGNED(size, max_shift, opr)
#define TEST_DSHIFT_OP_TYPES(opr)
#define TEST_ISHFT_TYPES
#define TEST_ISHFTC_TYPES
#define TEST_IBITS_TYPES
#define TEST_MASK_OP_SIGNED(size, max_shift)
#define TEST_MASK_OP_UNSIGNED(size, max_shift)
#define TEST_MASK_OP_TYPES
#define TEST_LP_OP_SIGNED(size, opr, func)
#define TEST_LP_OP_UNSIGNED(size, opr, func)
#define TEST_LP_OP_TYPES(opr, func)
#define TEST_STATUS_SIGNED(size)
#define TEST_STATUS_UNSIGNED(size)
#define TEST_STATUS_TYPES
#define TEST_ADDSUB_OP_SIGNED(size, opr, func)
#define TEST_ADDSUB_OP_UNSIGNED(size, opr, func)
#define TEST_ADDSUB_OP_TYPES(opr, func)
#define TEST_NEG_OP_SIGNED(size)
#define TEST_NEG_OP_UNSIGNED(size)
#define TEST_NEG_OP_TYPES
#define TEST_ABS_OP_SIGNED(size)
#define TEST_ABS_OP_UNSIGNED(size)
#define TEST_ABS_OP_TYPES
#define TEST_MUL_OP_SIGNED(size)
#define TEST_MUL_OP_UNSIGNED(size)
#define TEST_MUL_OP_TYPES
#define TEST_DIV_OP_SIGNED(size)
#define TEST_DIV_OP_UNSIGNED(size)
#define TEST_DIV_OP_TYPES
#define TEST_MOD_OP_SIGNED(size)
#define TEST_MOD_OP_UNSIGNED(size)
#define TEST_MOD_OP_TYPES
#define TEST_COMPARE_OP_SIGNED(size)
#define TEST_COMPARE_OP_UNSIGNED(size)
#define TEST_COMPARE_OP_TYPES

Functions

SINT64 DSEXT8 (SINT64 v)
SINT64 SEXT8 (SINT64 v)
SINT64 LS8 (AR_INT_64 *vp)
UINT64 LU8 (AR_INT_64 *vp)
static SINT64 _dshiftl8 (SINT64 op1, SINT64 op2, SINT64 shcnt)
static SINT64 _dshiftr8 (SINT64 op1, SINT64 op2, SINT64 shcnt)
static SINT64 _mask8 (SINT64 bits)
static SINT64 _leadz8 (SINT64 val)
static SINT64 _popcnt8 (SINT64 val)
static SINT64 _poppar8 (SINT64 val)
SINT64 DSEXT16 (SINT64 v)
SINT64 SEXT16 (SINT64 v)
SINT64 LS16 (AR_INT_64 *vp)
UINT64 LU16 (AR_INT_64 *vp)
static SINT64 _dshiftl16 (SINT64 op1, SINT64 op2, SINT64 shcnt)
static SINT64 _dshiftr16 (SINT64 op1, SINT64 op2, SINT64 shcnt)
static SINT64 _mask16 (SINT64 bits)
static SINT64 _leadz16 (SINT64 val)
static SINT64 _popcnt16 (SINT64 val)
static SINT64 _poppar16 (SINT64 val)
SINT64 DSEXT32 (SINT64 v)
SINT64 SEXT32 (SINT64 v)
SINT64 LS32 (AR_INT_64 *vp)
UINT64 LU32 (AR_INT_64 *vp)
static SINT64 _dshiftl32 (SINT64 op1, SINT64 op2, SINT64 shcnt)
static SINT64 _dshiftr32 (SINT64 op1, SINT64 op2, SINT64 shcnt)
static SINT64 _mask32 (SINT64 bits)
static SINT64 _leadz32 (SINT64 val)
static SINT64 _popcnt32 (SINT64 val)
static SINT64 _poppar32 (SINT64 val)
SINT64 DSEXT46 (SINT64 v)
SINT64 SEXT46 (SINT64 v)
static SINT64 _dshiftl46 (SINT64 op1, SINT64 op2, SINT64 shcnt)
static SINT64 _dshiftr46 (SINT64 op1, SINT64 op2, SINT64 shcnt)
static SINT64 _mask46 (SINT64 bits)
static SINT64 _leadz46 (SINT64 val)
static SINT64 _popcnt46 (SINT64 val)
static SINT64 _poppar46 (SINT64 val)
SINT64 DSEXT64 (SINT64 v)
SINT64 SEXT64 (SINT64 v)
static SINT64 _dshiftl64 (SINT64 op1, SINT64 op2, SINT64 shcnt)
static SINT64 _dshiftr64 (SINT64 op1, SINT64 op2, SINT64 shcnt)
static SINT64 _mask64 (SINT64 bits)
static SINT64 _leadz64 (SINT64 val)
static SINT64 _popcnt64 (SINT64 val)
static SINT64 _poppar64 (SINT64 val)
 main ()
 test_bitor ()
 test_bitand ()
 test_bitxor ()
 test_bitcomplement ()
 test_shiftl ()
 test_shiftr ()
 test_dshiftl ()
 test_dshiftr ()
static void test_ishft_signed (int size)
 test_ishft ()
static void test_ishftc_signed (int size)
 test_ishftc ()
static void test_ibits_signed (int size)
 test_ibits ()
 test_mask ()
 test_leadz ()
 test_popcnt ()
 test_poppar ()
 test_arstatus ()
 test_add ()
 test_subtract ()
 test_negate ()
 test_abs ()
 test_multiply ()
 test_divide ()
 test_modulo ()
 test_compare ()

Variables

AR_INT_64 cool_ints []
int num_cool_ints = sizeof(cool_ints)/sizeof(AR_INT_64)
AR_INT_64 dshift_vals []
int num_dshift_vals = sizeof(dshift_vals)/sizeof(AR_INT_64)
AR_TYPE ar_types []
int num_ar_types = sizeof(ar_types) / sizeof(AR_TYPE)
AR_TYPE sint8_artype = AR_Int_8_S
AR_TYPE uint8_artype = AR_Int_8_U
AR_TYPE sint16_artype = AR_Int_16_S
AR_TYPE uint16_artype = AR_Int_16_U
AR_TYPE sint24_artype = AR_Int_24_S
AR_TYPE uint24_artype = AR_Int_24_U
AR_TYPE sint32_artype = AR_Int_32_S
AR_TYPE uint32_artype = AR_Int_32_U
AR_TYPE sint46_artype = AR_Int_46_S
AR_TYPE sint64_artype = AR_Int_64_S
AR_TYPE uint64_artype = AR_Int_64_U
SINT64 act_result [sizeof(cool_ints)/sizeof(AR_INT_64)]
int act_status [sizeof(cool_ints)/sizeof(AR_INT_64)]
AR_INT_64 test_result [sizeof(cool_ints)/sizeof(AR_INT_64)]
int test_status [sizeof(cool_ints)/sizeof(AR_INT_64)]
static char USMID [] = "\n%Z%%M% %I% %G% %U%\n"
static char rcsid [] = "$Id: testint.c,v 1.1.1.1 2002-05-22 20:06:19 dsystem Exp $"

Define Documentation

#define is_neg16 (  )     (((v) & 0x8000) != 0)

Definition at line 615 of file testint.c.

Referenced by test_ibits_signed(), test_ishft_signed(), and test_ishftc_signed().

#define is_neg32 (  )     (((v) & 0x80000000) != 0)

Definition at line 715 of file testint.c.

Referenced by test_ibits_signed(), test_ishft_signed(), and test_ishftc_signed().

#define is_neg46 (  )     ((v) < 0)

Definition at line 802 of file testint.c.

#define is_neg64 (  )     ((v) < 0)

Definition at line 865 of file testint.c.

Referenced by test_ibits_signed(), test_ishft_signed(), and test_ishftc_signed().

#define is_neg8 (  )     (((v) & 0x80) != 0)

Definition at line 515 of file testint.c.

Referenced by test_ibits_signed(), test_ishft_signed(), and test_ishftc_signed().

#define IS_SUPPORTED_INT_TYPE (  ) 
Value:
((t) == AR_Int_8_S  || (t) == AR_Int_8_U  ||    \
         (t) == AR_Int_16_S || (t) == AR_Int_16_U ||    \
         (t) == AR_Int_32_S || (t) == AR_Int_32_U ||    \
         (t) == AR_Int_46_S                       ||    \
         (t) == AR_Int_64_S || (t) == AR_Int_64_U)

Definition at line 344 of file testint.c.

#define is_zero16 (  )     (DSEXT16(v) == 0)

Definition at line 614 of file testint.c.

Referenced by test_ibits_signed(), test_ishft_signed(), and test_ishftc_signed().

#define is_zero32 (  )     (DSEXT32(v) == 0)

Definition at line 714 of file testint.c.

Referenced by test_ibits_signed(), test_ishft_signed(), and test_ishftc_signed().

#define is_zero46 (  )     ((v) == 0)

Definition at line 801 of file testint.c.

#define is_zero64 (  )     ((v) == 0)

Definition at line 864 of file testint.c.

Referenced by test_ibits_signed(), test_ishft_signed(), and test_ishftc_signed().

#define is_zero8 (  )     (DSEXT8(v) == 0)

Definition at line 514 of file testint.c.

Referenced by test_ibits_signed(), test_ishft_signed(), and test_ishftc_signed().

#define TEST_ABS_OP_SIGNED ( size   ) 

Definition at line 3472 of file testint.c.

Referenced by test_abs().

#define TEST_ABS_OP_TYPES
Value:
do {                                                                    \
      int j, k;                                                         \
                                                                        \
      printf(" Testing:           types  %-10s: ", "abs");              \
                                                                        \
      for (j=0; j<num_ar_types; j++)                                    \
      {                                                                 \
         for (k=0; k<num_ar_types; k++)                                 \
         {                                                              \
            act_status[k] = AR_STAT_OK;                                 \
            if (ar_types[j] != ar_types[k] ||                           \
                !IS_SUPPORTED_INT_TYPE(ar_types[j]))                    \
               act_status[k] = AR_STAT_INVALID_TYPE;                    \
                                                                        \
            test_status[k] = AR_abs((AR_DATA *)&test_result[1],         \
                                    &ar_types[j],                       \
                                    (AR_DATA *)&cool_ints[1],           \
                                    &ar_types[k]);                      \
                                                                        \
            if ((act_status[k] ^ test_status[k]) &                      \
                AR_STAT_INVALID_TYPE)                                   \
            {                                                           \
               printf(" ERROR:  incorrect status at %d,%d\n", j, k);    \
               abort();                                                 \
            }                                                           \
         }                                                              \
      }                                                                 \
                                                                        \
      printf("PASSED\n");                                               \
   } while (0)

Definition at line 3561 of file testint.c.

Referenced by test_abs().

#define TEST_ABS_OP_UNSIGNED ( size   ) 

Definition at line 3521 of file testint.c.

Referenced by test_abs().

#define TEST_ADDSUB_OP_SIGNED ( size,
opr,
func   ) 

Definition at line 3113 of file testint.c.

Referenced by test_add(), and test_subtract().

#define TEST_ADDSUB_OP_TYPES ( opr,
func   ) 

Definition at line 3222 of file testint.c.

Referenced by test_add(), and test_subtract().

#define TEST_ADDSUB_OP_UNSIGNED ( size,
opr,
func   ) 

Definition at line 3176 of file testint.c.

Referenced by test_add(), and test_subtract().

#define TEST_BINARY_BIT_OP_SIGNED ( size,
opr,
func   ) 

Definition at line 939 of file testint.c.

Referenced by test_bitand(), test_bitor(), and test_bitxor().

#define TEST_BINARY_BIT_OP_TYPES ( opr,
func   ) 

Definition at line 1034 of file testint.c.

Referenced by test_bitand(), test_bitor(), and test_bitxor().

#define TEST_BINARY_BIT_OP_UNSIGNED ( size,
opr,
func   ) 

Definition at line 987 of file testint.c.

Referenced by test_bitand(), test_bitor(), and test_bitxor().

#define TEST_COMPARE_OP_SIGNED ( size   ) 

Definition at line 4253 of file testint.c.

Referenced by test_compare().

#define TEST_COMPARE_OP_TYPES
Value:
do {                                                                    \
      int j, k;                                                         \
                                                                        \
      printf(" Testing:           types  %-10s: ", "compare");          \
                                                                        \
      for (j=0; j<num_ar_types; j++)                                    \
      {                                                                 \
         for (k=0; k<num_ar_types; k++)                                 \
         {                                                              \
            act_status[k] = AR_STAT_OK;                                 \
            if (ar_types[j] != ar_types[k] ||                           \
                !IS_SUPPORTED_INT_TYPE(ar_types[j]))                    \
               act_status[k] = AR_Compare_Invalid;                      \
                                                                        \
            test_status[k] = AR_compare((AR_DATA *)&cool_ints[1],       \
                                        &ar_types[j],                   \
                                        (AR_DATA *)&cool_ints[1],       \
                                        &ar_types[k]);                  \
                                                                        \
            if ((act_status[k] == AR_Compare_Invalid) ^                 \
                (test_status[k] == AR_Compare_Invalid))                 \
            {                                                           \
               printf(" ERROR:  incorrect status at %d,%d\n", j, k);    \
               abort();                                                 \
            }                                                           \
         }                                                              \
      }                                                                 \
                                                                        \
      printf("PASSED\n");                                               \
   } while (0)

Definition at line 4335 of file testint.c.

#define TEST_COMPARE_OP_UNSIGNED ( size   ) 

Definition at line 4301 of file testint.c.

Referenced by test_compare().

#define TEST_DIV_OP_SIGNED ( size   ) 

Definition at line 3831 of file testint.c.

Referenced by test_divide().

#define TEST_DIV_OP_TYPES

Definition at line 3991 of file testint.c.

#define TEST_DIV_OP_UNSIGNED ( size   ) 

Definition at line 3935 of file testint.c.

Referenced by test_divide().

#define TEST_DSHIFT_OP_SIGNED ( size,
max_shift,
opr   ) 

Definition at line 1503 of file testint.c.

Referenced by test_dshiftl(), and test_dshiftr().

#define TEST_DSHIFT_OP_TYPES ( opr   ) 

Definition at line 1636 of file testint.c.

Referenced by test_dshiftl(), and test_dshiftr().

#define TEST_DSHIFT_OP_UNSIGNED ( size,
max_shift,
opr   ) 

Definition at line 1571 of file testint.c.

Referenced by test_dshiftl(), and test_dshiftr().

#define TEST_IBITS_TYPES

Definition at line 2581 of file testint.c.

Referenced by test_ibits().

#define TEST_ISHFT_TYPES

Definition at line 1909 of file testint.c.

Referenced by test_ishft().

#define TEST_ISHFTC_TYPES

Definition at line 2275 of file testint.c.

Referenced by test_ishftc().

#define TEST_LP_OP_SIGNED ( size,
opr,
func   ) 

Definition at line 2787 of file testint.c.

Referenced by test_leadz(), test_popcnt(), and test_poppar().

#define TEST_LP_OP_TYPES ( opr,
func   ) 
Value:
do {                                                                    \
      int j, k;                                                         \
                                                                        \
      printf(" Testing:           types  %-10s: ", #opr);               \
                                                                        \
      for (j=0; j<num_ar_types; j++)                                    \
      {                                                                 \
         for (k=0; k<num_ar_types; k++)                                 \
         {                                                              \
            act_status[k] = AR_STAT_OK;                                 \
            if (!IS_SUPPORTED_INT_TYPE(ar_types[j]) ||                  \
                !IS_SUPPORTED_INT_TYPE(ar_types[k]))                    \
               act_status[k] = AR_STAT_INVALID_TYPE;                    \
                                                                        \
            test_status[k] = func((AR_DATA *)&test_result[1],           \
                                  &ar_types[j],                         \
                                  (AR_DATA *)&cool_ints[1],             \
                                  &ar_types[k]);                        \
                                                                        \
            if ((act_status[k] ^ test_status[k]) &                      \
                AR_STAT_INVALID_TYPE)                                   \
            {                                                           \
               printf(" ERROR:  incorrect status at %d,%d\n", j, k);    \
               abort();                                                 \
            }                                                           \
         }                                                              \
      }                                                                 \
                                                                        \
      printf("PASSED\n");                                               \
   } while (0)

Definition at line 2868 of file testint.c.

Referenced by test_leadz(), test_popcnt(), and test_poppar().

#define TEST_LP_OP_UNSIGNED ( size,
opr,
func   ) 

Definition at line 2829 of file testint.c.

Referenced by test_leadz(), test_popcnt(), and test_poppar().

#define TEST_MASK_OP_SIGNED ( size,
max_shift   ) 

Definition at line 2655 of file testint.c.

Referenced by test_mask().

#define TEST_MASK_OP_TYPES
Value:
do {                                                                    \
      int j, k;                                                         \
                                                                        \
      printf(" Testing:           types  %-10s: ", "_mask");            \
                                                                        \
      for (j=0; j<num_ar_types; j++)                                    \
      {                                                                 \
         for (k=0; k<num_ar_types; k++)                                 \
         {                                                              \
            act_status[k] = AR_STAT_OK;                                 \
            if (ar_types[j] != ar_types[k] ||                           \
                !IS_SUPPORTED_INT_TYPE(ar_types[j]))                    \
               act_status[k] = AR_STAT_INVALID_TYPE;                    \
                                                                        \
            test_status[k] = AR_mask((AR_DATA *)&test_result[1],        \
                                     &ar_types[j],                      \
                                     (AR_DATA *)&cool_ints[1],          \
                                     &ar_types[k]);                     \
                                                                        \
            if ((act_status[k] ^ test_status[k]) &                      \
                AR_STAT_INVALID_TYPE)                                   \
            {                                                           \
               printf(" ERROR:  incorrect status at %d,%d\n", j, k);    \
               abort();                                                 \
            }                                                           \
         }                                                              \
      }                                                                 \
                                                                        \
      printf("PASSED\n");                                               \
   } while (0)

Definition at line 2754 of file testint.c.

Referenced by test_mask().

#define TEST_MASK_OP_UNSIGNED ( size,
max_shift   ) 

Definition at line 2706 of file testint.c.

Referenced by test_mask().

#define TEST_MOD_OP_SIGNED ( size   ) 

Definition at line 4057 of file testint.c.

Referenced by test_modulo().

#define TEST_MOD_OP_TYPES

Definition at line 4179 of file testint.c.

Referenced by test_modulo().

#define TEST_MOD_OP_UNSIGNED ( size   ) 

Definition at line 4123 of file testint.c.

Referenced by test_modulo().

#define TEST_MUL_OP_SIGNED ( size   ) 

Definition at line 3621 of file testint.c.

Referenced by test_multiply().

#define TEST_MUL_OP_TYPES

Definition at line 3764 of file testint.c.

#define TEST_MUL_OP_UNSIGNED ( size   ) 

Definition at line 3718 of file testint.c.

Referenced by test_multiply().

#define TEST_NEG_OP_SIGNED ( size   ) 

Definition at line 3311 of file testint.c.

Referenced by test_negate().

#define TEST_NEG_OP_TYPES
Value:
do {                                                                    \
      int j, k;                                                         \
                                                                        \
      printf(" Testing:           types  %-10s: ", "unary -");          \
                                                                        \
      for (j=0; j<num_ar_types; j++)                                    \
      {                                                                 \
         for (k=0; k<num_ar_types; k++)                                 \
         {                                                              \
            act_status[k] = AR_STAT_OK;                                 \
            if (ar_types[j] != ar_types[k] ||                           \
                !IS_SUPPORTED_INT_TYPE(ar_types[j]))                    \
               act_status[k] = AR_STAT_INVALID_TYPE;                    \
                                                                        \
            test_status[k] = AR_negate((AR_DATA *)&test_result[1],      \
                                       &ar_types[j],                    \
                                       (AR_DATA *)&cool_ints[1],        \
                                       &ar_types[k]);                   \
                                                                        \
            if ((act_status[k] ^ test_status[k]) &                      \
                AR_STAT_INVALID_TYPE)                                   \
            {                                                           \
               printf(" ERROR:  incorrect status at %d,%d\n", j, k);    \
               abort();                                                 \
            }                                                           \
         }                                                              \
      }                                                                 \
                                                                        \
      printf("PASSED\n");                                               \
   } while (0)

Definition at line 3412 of file testint.c.

Referenced by test_negate().

#define TEST_NEG_OP_UNSIGNED ( size   ) 

Definition at line 3372 of file testint.c.

Referenced by test_negate().

#define TEST_SHIFT_OP_SIGNED ( size,
max_shift,
opr,
func   ) 

Definition at line 1293 of file testint.c.

Referenced by test_shiftl(), and test_shiftr().

#define TEST_SHIFT_OP_TYPES ( opr,
func   ) 

Definition at line 1415 of file testint.c.

Referenced by test_shiftl(), and test_shiftr().

#define TEST_SHIFT_OP_UNSIGNED ( size,
max_shift,
opr,
func   ) 

Definition at line 1360 of file testint.c.

Referenced by test_shiftl(), and test_shiftr().

#define TEST_STATUS_SIGNED ( size   ) 
Value:
do {                                                                    \
      int j;                                                            \
                                                                        \
      printf(" Testing:   SIGNED %2d INT  %-10s: ", size, "status");    \
                                                                        \
      for (j=0; j<num_cool_ints; j++)                                   \
      {                                                                 \
         act_status[j] = is_zero##size(                                 \
                            DSEXT##size(LS##size(&cool_ints[j])))       \
                         ? AR_STAT_ZERO : AR_STAT_OK;                   \
                                                                        \
         if (is_neg##size(LS##size(&cool_ints[j])))                     \
            act_status[j] |= AR_STAT_NEGATIVE;                          \
                                                                        \
         test_status[j] = AR_status((AR_DATA *)&cool_ints[j],           \
                                    &sint##size##_artype);              \
                                                                        \
         if (act_status[j] != test_status[j])                           \
         {                                                              \
            printf(" ERROR:  incorrect status at %d\n", j);             \
            abort();                                                    \
         }                                                              \
      }                                                                 \
                                                                        \
      printf("PASSED\n");                                               \
   } while (0)

Definition at line 3003 of file testint.c.

Referenced by test_arstatus().

#define TEST_STATUS_TYPES
Value:
do {                                                                    \
      int k;                                                            \
                                                                        \
      printf(" Testing:           types  %-10s: ", "status");           \
                                                                        \
      for (k=0; k<num_ar_types; k++)                                    \
      {                                                                 \
         test_status[k] = AR_status((AR_DATA *)&cool_ints[1],           \
                                    &ar_types[k]);                      \
                                                                        \
         if (test_status[k] & AR_STAT_INVALID_TYPE)                     \
         {                                                              \
            printf(" ERROR:  incorrect status at %d\n", k);             \
            abort();                                                    \
         }                                                              \
      }                                                                 \
                                                                        \
      printf("PASSED\n");                                               \
   } while (0)

Definition at line 3057 of file testint.c.

Referenced by test_arstatus().

#define TEST_STATUS_UNSIGNED ( size   ) 
Value:
do {                                                                    \
      int j;                                                            \
                                                                        \
      printf(" Testing:   SIGNED %2d INT  %-10s: ", size, "status");    \
                                                                        \
      for (j=0; j<num_cool_ints; j++)                                   \
      {                                                                 \
         act_status[j] = is_zero##size(LU##size(&cool_ints[j]))         \
                         ? AR_STAT_ZERO : AR_STAT_OK;                   \
                                                                        \
         test_status[j] = AR_status((AR_DATA *)&cool_ints[j],           \
                                    &uint##size##_artype);              \
                                                                        \
         if (act_status[j] != test_status[j])                           \
         {                                                              \
            printf(" ERROR:  incorrect status at %d\n", j);             \
            abort();                                                    \
         }                                                              \
      }                                                                 \
                                                                        \
      printf("PASSED\n");                                               \
   } while (0)

Definition at line 3032 of file testint.c.

Referenced by test_arstatus().

#define TEST_UNARY_BIT_OP_SIGNED ( size,
opr,
func   ) 

Definition at line 1074 of file testint.c.

Referenced by test_bitcomplement().

#define TEST_UNARY_BIT_OP_TYPES ( opr,
func   ) 
Value:
do {                                                                    \
      int j, k;                                                         \
                                                                        \
      printf(" Testing:           types  %-10s: ", #opr);               \
                                                                        \
      for (j=0; j<num_ar_types; j++)                                    \
      {                                                                 \
         for (k=0; k<num_ar_types; k++)                                 \
         {                                                              \
            act_status[k] = AR_STAT_OK;                                 \
            if (ar_types[j] != ar_types[k] ||                           \
                !IS_SUPPORTED_INT_TYPE(ar_types[j]))                    \
               act_status[k] = AR_STAT_INVALID_TYPE;                    \
                                                                        \
            test_status[k] = func((AR_DATA *)&test_result[1],           \
                                  &ar_types[j],                         \
                                  (AR_DATA *)&cool_ints[1],             \
                                  &ar_types[k]);                        \
                                                                        \
            if ((act_status[k] ^ test_status[k]) &                      \
                AR_STAT_INVALID_TYPE)                                   \
            {                                                           \
               printf(" ERROR:  incorrect status at %d,%d\n", j, k);    \
               abort();                                                 \
            }                                                           \
         }                                                              \
      }                                                                 \
                                                                        \
      printf("PASSED\n");                                               \
   } while (0)

Definition at line 1158 of file testint.c.

Referenced by test_bitcomplement().

#define TEST_UNARY_BIT_OP_UNSIGNED ( size,
opr,
func   ) 

Definition at line 1117 of file testint.c.

Referenced by test_bitcomplement().


Function Documentation

static SINT64 _dshiftl16 ( SINT64  op1,
SINT64  op2,
SINT64  shcnt 
) [static]

Definition at line 621 of file testint.c.

static SINT64 _dshiftl32 ( SINT64  op1,
SINT64  op2,
SINT64  shcnt 
) [static]

Definition at line 721 of file testint.c.

static SINT64 _dshiftl46 ( SINT64  op1,
SINT64  op2,
SINT64  shcnt 
) [static]

Definition at line 809 of file testint.c.

References _dshiftl().

Here is the call graph for this function:

static SINT64 _dshiftl64 ( SINT64  op1,
SINT64  op2,
SINT64  shcnt 
) [static]

Definition at line 872 of file testint.c.

References _dshiftl().

Here is the call graph for this function:

static SINT64 _dshiftl8 ( SINT64  op1,
SINT64  op2,
SINT64  shcnt 
) [static]

Definition at line 521 of file testint.c.

static SINT64 _dshiftr16 ( SINT64  op1,
SINT64  op2,
SINT64  shcnt 
) [static]

Definition at line 629 of file testint.c.

static SINT64 _dshiftr32 ( SINT64  op1,
SINT64  op2,
SINT64  shcnt 
) [static]

Definition at line 729 of file testint.c.

static SINT64 _dshiftr46 ( SINT64  op1,
SINT64  op2,
SINT64  shcnt 
) [static]

Definition at line 814 of file testint.c.

References _dshiftr().

Here is the call graph for this function:

static SINT64 _dshiftr64 ( SINT64  op1,
SINT64  op2,
SINT64  shcnt 
) [static]

Definition at line 877 of file testint.c.

References _dshiftr().

Here is the call graph for this function:

static SINT64 _dshiftr8 ( SINT64  op1,
SINT64  op2,
SINT64  shcnt 
) [static]

Definition at line 529 of file testint.c.

static SINT64 _leadz16 ( SINT64  val  )  [static]

Definition at line 647 of file testint.c.

static SINT64 _leadz32 ( SINT64  val  )  [static]

Definition at line 747 of file testint.c.

static SINT64 _leadz46 ( SINT64  val  )  [static]

Definition at line 824 of file testint.c.

References _leadz().

Here is the call graph for this function:

static SINT64 _leadz64 ( SINT64  val  )  [static]

Definition at line 887 of file testint.c.

References _leadz().

Here is the call graph for this function:

static SINT64 _leadz8 ( SINT64  val  )  [static]

Definition at line 547 of file testint.c.

static SINT64 _mask16 ( SINT64  bits  )  [static]

Definition at line 637 of file testint.c.

static SINT64 _mask32 ( SINT64  bits  )  [static]

Definition at line 737 of file testint.c.

static SINT64 _mask46 ( SINT64  bits  )  [static]

Definition at line 819 of file testint.c.

References _mask().

Here is the call graph for this function:

static SINT64 _mask64 ( SINT64  bits  )  [static]

Definition at line 882 of file testint.c.

References _mask().

Here is the call graph for this function:

static SINT64 _mask8 ( SINT64  bits  )  [static]

Definition at line 537 of file testint.c.

static SINT64 _popcnt16 ( SINT64  val  )  [static]

Definition at line 660 of file testint.c.

Referenced by _poppar16().

static SINT64 _popcnt32 ( SINT64  val  )  [static]

Definition at line 760 of file testint.c.

Referenced by _poppar32().

static SINT64 _popcnt46 ( SINT64  val  )  [static]

Definition at line 829 of file testint.c.

static SINT64 _popcnt64 ( SINT64  val  )  [static]

Definition at line 892 of file testint.c.

static SINT64 _popcnt8 ( SINT64  val  )  [static]

Definition at line 560 of file testint.c.

Referenced by _poppar8().

static SINT64 _poppar16 ( SINT64  val  )  [static]

Definition at line 671 of file testint.c.

References _popcnt16().

Here is the call graph for this function:

static SINT64 _poppar32 ( SINT64  val  )  [static]

Definition at line 771 of file testint.c.

References _popcnt32().

Here is the call graph for this function:

static SINT64 _poppar46 ( SINT64  val  )  [static]

Definition at line 834 of file testint.c.

static SINT64 _poppar64 ( SINT64  val  )  [static]

Definition at line 897 of file testint.c.

static SINT64 _poppar8 ( SINT64  val  )  [static]

Definition at line 571 of file testint.c.

References _popcnt8().

Here is the call graph for this function:

SINT64 DSEXT16 ( SINT64  v  ) 

Definition at line 586 of file testint.c.

Referenced by SEXT16(), test_ishft_signed(), and test_ishftc_signed().

SINT64 DSEXT32 ( SINT64  v  ) 

Definition at line 686 of file testint.c.

Referenced by SEXT32(), test_ishft_signed(), and test_ishftc_signed().

SINT64 DSEXT46 ( SINT64  v  ) 

Definition at line 787 of file testint.c.

SINT64 DSEXT64 ( SINT64  v  ) 

Definition at line 850 of file testint.c.

Referenced by test_ishft_signed(), and test_ishftc_signed().

SINT64 DSEXT8 ( SINT64  v  ) 

Definition at line 486 of file testint.c.

Referenced by SEXT8(), test_ishft_signed(), and test_ishftc_signed().

SINT64 LS16 ( AR_INT_64 vp  ) 

Definition at line 600 of file testint.c.

References AR_INT_64::part4, and SEXT16().

Referenced by test_ibits_signed(), test_ishft_signed(), and test_ishftc_signed().

Here is the call graph for this function:

SINT64 LS32 ( AR_INT_64 vp  ) 

Definition at line 700 of file testint.c.

References AR_INT_64::part3, AR_INT_64::part4, and SEXT32().

Referenced by test_ibits_signed(), test_ishft_signed(), and test_ishftc_signed().

Here is the call graph for this function:

SINT64 LS8 ( AR_INT_64 vp  ) 

Definition at line 500 of file testint.c.

References AR_INT_64::part4, and SEXT8().

Referenced by test_ibits_signed(), test_ishft_signed(), and test_ishftc_signed().

Here is the call graph for this function:

UINT64 LU16 ( AR_INT_64 vp  ) 

Definition at line 605 of file testint.c.

References AR_INT_64::part4.

Referenced by test_ibits_signed(), test_ishft_signed(), and test_ishftc_signed().

UINT64 LU32 ( AR_INT_64 vp  ) 

Definition at line 705 of file testint.c.

References AR_INT_64::part3, and AR_INT_64::part4.

Referenced by test_ibits_signed(), test_ishft_signed(), and test_ishftc_signed().

UINT64 LU8 ( AR_INT_64 vp  ) 

Definition at line 505 of file testint.c.

References AR_INT_64::part4.

Referenced by test_ibits_signed(), test_ishft_signed(), and test_ishftc_signed().

main (  ) 
SINT64 SEXT16 ( SINT64  v  ) 

Definition at line 591 of file testint.c.

References DSEXT16().

Referenced by LS16().

Here is the call graph for this function:

SINT64 SEXT32 ( SINT64  v  ) 

Definition at line 691 of file testint.c.

References DSEXT32().

Referenced by LS32().

Here is the call graph for this function:

SINT64 SEXT46 ( SINT64  v  ) 

Definition at line 792 of file testint.c.

SINT64 SEXT64 ( SINT64  v  ) 

Definition at line 855 of file testint.c.

SINT64 SEXT8 ( SINT64  v  ) 

Definition at line 491 of file testint.c.

References DSEXT8().

Referenced by LS8().

Here is the call graph for this function:

test_abs (  ) 

Definition at line 3594 of file testint.c.

References TEST_ABS_OP_SIGNED, TEST_ABS_OP_TYPES, and TEST_ABS_OP_UNSIGNED.

Referenced by main().

test_add (  ) 

Definition at line 3262 of file testint.c.

References AR_add(), TEST_ADDSUB_OP_SIGNED, TEST_ADDSUB_OP_TYPES, and TEST_ADDSUB_OP_UNSIGNED.

Referenced by main().

Here is the call graph for this function:

test_arstatus (  ) 

Definition at line 3079 of file testint.c.

References TEST_STATUS_SIGNED, TEST_STATUS_TYPES, and TEST_STATUS_UNSIGNED.

Referenced by main().

test_bitand (  ) 

Definition at line 1213 of file testint.c.

References AR_bitand(), TEST_BINARY_BIT_OP_SIGNED, TEST_BINARY_BIT_OP_TYPES, and TEST_BINARY_BIT_OP_UNSIGNED.

Referenced by main().

Here is the call graph for this function:

test_bitcomplement (  ) 

Definition at line 1257 of file testint.c.

References AR_bitcomplement(), TEST_UNARY_BIT_OP_SIGNED, TEST_UNARY_BIT_OP_TYPES, and TEST_UNARY_BIT_OP_UNSIGNED.

Referenced by main().

Here is the call graph for this function:

test_bitor (  ) 

Definition at line 1191 of file testint.c.

References AR_bitor(), TEST_BINARY_BIT_OP_SIGNED, TEST_BINARY_BIT_OP_TYPES, and TEST_BINARY_BIT_OP_UNSIGNED.

Referenced by main().

Here is the call graph for this function:

test_bitxor (  ) 

Definition at line 1235 of file testint.c.

References AR_bitxor(), TEST_BINARY_BIT_OP_SIGNED, TEST_BINARY_BIT_OP_TYPES, and TEST_BINARY_BIT_OP_UNSIGNED.

Referenced by main().

Here is the call graph for this function:

test_compare (  ) 

Definition at line 4368 of file testint.c.

References TEST_COMPARE_OP_SIGNED, and TEST_COMPARE_OP_UNSIGNED.

Referenced by main().

test_divide (  ) 

Definition at line 4031 of file testint.c.

References TEST_DIV_OP_SIGNED, and TEST_DIV_OP_UNSIGNED.

Referenced by main().

test_dshiftl (  ) 

Definition at line 1681 of file testint.c.

References _dshiftl(), TEST_DSHIFT_OP_SIGNED, TEST_DSHIFT_OP_TYPES, and TEST_DSHIFT_OP_UNSIGNED.

Referenced by main().

Here is the call graph for this function:

test_dshiftr (  ) 

Definition at line 1703 of file testint.c.

References _dshiftr(), TEST_DSHIFT_OP_SIGNED, TEST_DSHIFT_OP_TYPES, and TEST_DSHIFT_OP_UNSIGNED.

Referenced by main().

Here is the call graph for this function:

test_ibits (  ) 

Definition at line 2628 of file testint.c.

References test_ibits_signed(), and TEST_IBITS_TYPES.

Referenced by main().

Here is the call graph for this function:

static void test_ibits_signed ( int  size  )  [static]
test_ishft (  ) 

Definition at line 1949 of file testint.c.

References test_ishft_signed(), and TEST_ISHFT_TYPES.

Referenced by main().

Here is the call graph for this function:

static void test_ishft_signed ( int  size  )  [static]
test_ishftc (  ) 

Definition at line 2322 of file testint.c.

References test_ishftc_signed(), and TEST_ISHFTC_TYPES.

Referenced by main().

Here is the call graph for this function:

static void test_ishftc_signed ( int  size  )  [static]
test_leadz (  ) 

Definition at line 2923 of file testint.c.

References _leadz(), AR_leadz(), TEST_LP_OP_SIGNED, TEST_LP_OP_TYPES, and TEST_LP_OP_UNSIGNED.

Referenced by main().

Here is the call graph for this function:

test_mask (  ) 

Definition at line 2901 of file testint.c.

References TEST_MASK_OP_SIGNED, TEST_MASK_OP_TYPES, and TEST_MASK_OP_UNSIGNED.

Referenced by main().

test_modulo (  ) 

Definition at line 4219 of file testint.c.

References TEST_MOD_OP_SIGNED, TEST_MOD_OP_TYPES, and TEST_MOD_OP_UNSIGNED.

Referenced by main().

test_multiply (  ) 

Definition at line 3804 of file testint.c.

References TEST_MUL_OP_SIGNED, and TEST_MUL_OP_UNSIGNED.

Referenced by main().

test_negate (  ) 

Definition at line 3445 of file testint.c.

References TEST_NEG_OP_SIGNED, TEST_NEG_OP_TYPES, and TEST_NEG_OP_UNSIGNED.

Referenced by main().

test_popcnt (  ) 

Definition at line 2945 of file testint.c.

References AR_popcnt(), TEST_LP_OP_SIGNED, TEST_LP_OP_TYPES, and TEST_LP_OP_UNSIGNED.

Referenced by main().

Here is the call graph for this function:

test_poppar (  ) 

Definition at line 2967 of file testint.c.

References AR_poppar(), TEST_LP_OP_SIGNED, TEST_LP_OP_TYPES, and TEST_LP_OP_UNSIGNED.

Referenced by main().

Here is the call graph for this function:

test_shiftl (  ) 

Definition at line 1454 of file testint.c.

References AR_shiftl(), TEST_SHIFT_OP_SIGNED, TEST_SHIFT_OP_TYPES, and TEST_SHIFT_OP_UNSIGNED.

Referenced by main().

Here is the call graph for this function:

test_shiftr (  ) 

Definition at line 1476 of file testint.c.

References AR_shiftr(), TEST_SHIFT_OP_SIGNED, TEST_SHIFT_OP_TYPES, and TEST_SHIFT_OP_UNSIGNED.

Referenced by main().

Here is the call graph for this function:

test_subtract (  ) 

Definition at line 3284 of file testint.c.

References AR_subtract(), TEST_ADDSUB_OP_SIGNED, TEST_ADDSUB_OP_TYPES, and TEST_ADDSUB_OP_UNSIGNED.

Referenced by main().

Here is the call graph for this function:


Variable Documentation

SINT64 act_result[sizeof(cool_ints)/sizeof(AR_INT_64)]

Definition at line 363 of file testint.c.

int act_status[sizeof(cool_ints)/sizeof(AR_INT_64)]

Definition at line 364 of file testint.c.

Definition at line 93 of file testint.c.

Initial value:
{
   {0x0000, 0x0000, 0x0000, 0x0000},  
   {0x0000, 0x0000, 0x0000, 0x0001},  
   {0x0000, 0x0000, 0x0000, 0x000a},  
   {0x0000, 0x0000, 0x0000, 0x0010},  
   {0x0000, 0x0000, 0x0000, 0x0015},  
   {0x0000, 0x0000, 0x0000, 0x001f},  
   {0x0000, 0x0000, 0x0000, 0x0020},  
   {0x0000, 0x0000, 0x0000, 0x0021},  
   {0x0000, 0x0000, 0x0000, 0x002b},  
   {0x0000, 0x0000, 0x0000, 0x003f},  
   {0x0000, 0x0000, 0x0000, 0x0040},  
   {0x0000, 0x0000, 0x0000, 0x0041},  
   {0xffff, 0xffff, 0xffff, 0xffff}   
}

Definition at line 309 of file testint.c.

int num_ar_types = sizeof(ar_types) / sizeof(AR_TYPE)

Definition at line 342 of file testint.c.

int num_cool_ints = sizeof(cool_ints)/sizeof(AR_INT_64)

Definition at line 306 of file testint.c.

int num_dshift_vals = sizeof(dshift_vals)/sizeof(AR_INT_64)

Definition at line 325 of file testint.c.

char rcsid[] = "$Id: testint.c,v 1.1.1.1 2002-05-22 20:06:19 dsystem Exp $" [static]

Definition at line 4391 of file testint.c.

AR_TYPE sint16_artype = AR_Int_16_S

Definition at line 353 of file testint.c.

AR_TYPE sint24_artype = AR_Int_24_S

Definition at line 355 of file testint.c.

AR_TYPE sint32_artype = AR_Int_32_S

Definition at line 357 of file testint.c.

AR_TYPE sint46_artype = AR_Int_46_S

Definition at line 359 of file testint.c.

AR_TYPE sint64_artype = AR_Int_64_S

Definition at line 360 of file testint.c.

Referenced by AR_compare().

AR_TYPE sint8_artype = AR_Int_8_S

Definition at line 351 of file testint.c.

Definition at line 366 of file testint.c.

int test_status[sizeof(cool_ints)/sizeof(AR_INT_64)]

Definition at line 367 of file testint.c.

AR_TYPE uint16_artype = AR_Int_16_U

Definition at line 354 of file testint.c.

AR_TYPE uint24_artype = AR_Int_24_U

Definition at line 356 of file testint.c.

AR_TYPE uint32_artype = AR_Int_32_U

Definition at line 358 of file testint.c.

Referenced by ar_multiply_integer().

AR_TYPE uint64_artype = AR_Int_64_U

Definition at line 361 of file testint.c.

Referenced by ar_multiply_integer().

AR_TYPE uint8_artype = AR_Int_8_U

Definition at line 352 of file testint.c.

char USMID[] = "\n%Z%%M% %I% %G% %U%\n" [static]

Definition at line 4390 of file testint.c.


Generated on Tue Nov 17 05:56:24 2009 for Open64 (mfef90, whirl2f, and IR tools) by  doxygen 1.6.1