Home | History | Annotate | Download | only in crosstest
      1 //===- subzero/crosstest/test_arith.h - Test prototypes ---------*- C++ -*-===//
      2 //
      3 //                        The Subzero Code Generator
      4 //
      5 // This file is distributed under the University of Illinois Open Source
      6 // License. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 //
     10 // This file declares the function prototypes used for crosstesting arithmetic
     11 // operations.
     12 //
     13 //===----------------------------------------------------------------------===//
     14 
     15 #include <stdint.h>
     16 #include "test_arith.def"
     17 #include "xdefs.h"
     18 
     19 #include "vectors.h"
     20 
     21 #define X(inst, op, isdiv, isshift)                                            \
     22   bool test##inst(bool a, bool b);                                             \
     23   uint8_t test##inst(uint8_t a, uint8_t b);                                    \
     24   uint16_t test##inst(uint16_t a, uint16_t b);                                 \
     25   uint32_t test##inst(uint32_t a, uint32_t b);                                 \
     26   uint64 test##inst(uint64 a, uint64 b);                                       \
     27   v4ui32 test##inst(v4ui32 a, v4ui32 b);                                       \
     28   v8ui16 test##inst(v8ui16 a, v8ui16 b);                                       \
     29   v16ui8 test##inst(v16ui8 a, v16ui8 b);
     30 UINTOP_TABLE
     31 #undef X
     32 
     33 #define X(inst, op, isdiv, isshift)                                            \
     34   bool test##inst(bool a, bool b);                                             \
     35   myint8_t test##inst(myint8_t a, myint8_t b);                                 \
     36   int16_t test##inst(int16_t a, int16_t b);                                    \
     37   int32_t test##inst(int32_t a, int32_t b);                                    \
     38   int64 test##inst(int64 a, int64 b);                                          \
     39   v4si32 test##inst(v4si32 a, v4si32 b);                                       \
     40   v8si16 test##inst(v8si16 a, v8si16 b);                                       \
     41   v16si8 test##inst(v16si8 a, v16si8 b);
     42 SINTOP_TABLE
     43 #undef X
     44 
     45 float myFrem(float a, float b);
     46 double myFrem(double a, double b);
     47 v4f32 myFrem(v4f32 a, v4f32 b);
     48 
     49 #define X(inst, op, func)                                                      \
     50   float test##inst(float a, float b);                                          \
     51   double test##inst(double a, double b);                                       \
     52   v4f32 test##inst(v4f32 a, v4f32 b);
     53 FPOP_TABLE
     54 #undef X
     55 
     56 float mySqrt(float a);
     57 double mySqrt(double a);
     58 // mySqrt for v4f32 is currently unsupported.
     59 
     60 float myFabs(float a);
     61 double myFabs(double a);
     62 v4f32 myFabs(v4f32 a);
     63 
     64 #define X(mult_by)                                                             \
     65   bool testMultiplyBy##mult_by(bool a, bool);                                  \
     66   bool testMultiplyByNeg##mult_by(bool a, bool);                               \
     67   uint8_t testMultiplyBy##mult_by(uint8_t a, uint8_t);                         \
     68   uint8_t testMultiplyByNeg##mult_by(uint8_t a, uint8_t);                      \
     69   uint16_t testMultiplyBy##mult_by(uint16_t a, uint16_t);                      \
     70   uint16_t testMultiplyByNeg##mult_by(uint16_t a, uint16_t);                   \
     71   uint32_t testMultiplyBy##mult_by(uint32_t a, uint32_t);                      \
     72   uint32_t testMultiplyByNeg##mult_by(uint32_t a, uint32_t);                   \
     73   uint64_t testMultiplyBy##mult_by(uint64_t a, uint64_t);                      \
     74   uint64_t testMultiplyByNeg##mult_by(uint64_t a, uint64_t);
     75 MULIMM_TABLE
     76 #undef X
     77