blob: 855c6072dbecb6b182bade7796a73d7d97c6dad5 [file] [log] [blame]
Matt Wala89a7c2b2014-07-22 10:55:30 -07001//===- 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
Jim Stichnoth5bc2b1d2014-05-22 13:38:48 -070015#include <stdint.h>
16#include "test_arith.def"
17
Matt Wala89a7c2b2014-07-22 10:55:30 -070018#include "vectors.h"
Matt Wala7fa22d82014-07-17 12:41:31 -070019
Matt Walaafeaee42014-08-07 13:47:30 -070020#define X(inst, op, isdiv, isshift) \
Jim Stichnoth5bc2b1d2014-05-22 13:38:48 -070021 bool test##inst(bool a, bool b); \
22 uint8_t test##inst(uint8_t a, uint8_t b); \
23 uint16_t test##inst(uint16_t a, uint16_t b); \
24 uint32_t test##inst(uint32_t a, uint32_t b); \
Matt Wala7fa22d82014-07-17 12:41:31 -070025 uint64_t test##inst(uint64_t a, uint64_t b); \
26 v4ui32 test##inst(v4ui32 a, v4ui32 b); \
27 v8ui16 test##inst(v8ui16 a, v8ui16 b); \
28 v16ui8 test##inst(v16ui8 a, v16ui8 b);
Jim Stichnoth5bc2b1d2014-05-22 13:38:48 -070029UINTOP_TABLE
30#undef X
31
Matt Walaafeaee42014-08-07 13:47:30 -070032#define X(inst, op, isdiv, isshift) \
Jim Stichnoth5bc2b1d2014-05-22 13:38:48 -070033 bool test##inst(bool a, bool b); \
Jim Stichnoth7da431b2014-08-05 11:22:37 -070034 myint8_t test##inst(myint8_t a, myint8_t b); \
Jim Stichnoth5bc2b1d2014-05-22 13:38:48 -070035 int16_t test##inst(int16_t a, int16_t b); \
36 int32_t test##inst(int32_t a, int32_t b); \
Matt Wala7fa22d82014-07-17 12:41:31 -070037 int64_t test##inst(int64_t a, int64_t b); \
38 v4si32 test##inst(v4si32 a, v4si32 b); \
39 v8si16 test##inst(v8si16 a, v8si16 b); \
40 v16si8 test##inst(v16si8 a, v16si8 b);
Jim Stichnoth5bc2b1d2014-05-22 13:38:48 -070041SINTOP_TABLE
42#undef X
43
44float myFrem(float a, float b);
45double myFrem(double a, double b);
Matt Wala7fa22d82014-07-17 12:41:31 -070046v4f32 myFrem(v4f32 a, v4f32 b);
Jim Stichnoth5bc2b1d2014-05-22 13:38:48 -070047
48#define X(inst, op, func) \
49 float test##inst(float a, float b); \
Matt Wala7fa22d82014-07-17 12:41:31 -070050 double test##inst(double a, double b); \
51 v4f32 test##inst(v4f32 a, v4f32 b);
Jim Stichnoth5bc2b1d2014-05-22 13:38:48 -070052FPOP_TABLE
53#undef X
Jan Voungf37fbbe2014-07-09 16:13:13 -070054
55float mySqrt(float a);
56double mySqrt(double a);
Matt Wala7fa22d82014-07-17 12:41:31 -070057// mySqrt for v4f32 is currently unsupported.