Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: crosstest/test_arith.cpp

Issue 407543003: Factor out common vector crosstesting code. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // This aims to test all the arithmetic bitcode instructions across 1 // This aims to test all the arithmetic bitcode instructions across
2 // all PNaCl primitive data types. 2 // all PNaCl primitive data types.
3 3
4 #include <stdint.h> 4 #include <stdint.h>
5 5
6 #include "vectors.h"
jvoung (off chromium) 2014/07/18 22:50:40 Could test_arith.h just be the one to include vect
wala 2014/07/18 23:08:23 Done.
Jim Stichnoth 2014/07/18 23:45:47 There's some stuff in vectors.h that you might be
wala 2014/07/19 00:11:14 It links. vectors.h is mostly for the benefit of t
6 #include "test_arith.h" 7 #include "test_arith.h"
7 8
8 #define X(inst, op, isdiv) \ 9 #define X(inst, op, isdiv) \
9 bool test##inst(bool a, bool b) { return a op b; } \ 10 bool test##inst(bool a, bool b) { return a op b; } \
10 uint8_t test##inst(uint8_t a, uint8_t b) { return a op b; } \ 11 uint8_t test##inst(uint8_t a, uint8_t b) { return a op b; } \
11 uint16_t test##inst(uint16_t a, uint16_t b) { return a op b; } \ 12 uint16_t test##inst(uint16_t a, uint16_t b) { return a op b; } \
12 uint32_t test##inst(uint32_t a, uint32_t b) { return a op b; } \ 13 uint32_t test##inst(uint32_t a, uint32_t b) { return a op b; } \
13 uint64_t test##inst(uint64_t a, uint64_t b) { return a op b; } \ 14 uint64_t test##inst(uint64_t a, uint64_t b) { return a op b; } \
14 v4ui32 test##inst(v4ui32 a, v4ui32 b) { return a op b; } \ 15 v4ui32 test##inst(v4ui32 a, v4ui32 b) { return a op b; } \
15 v8ui16 test##inst(v8ui16 a, v8ui16 b) { return a op b; } \ 16 v8ui16 test##inst(v8ui16 a, v8ui16 b) { return a op b; } \
(...skipping 12 matching lines...) Expand all
28 v16si8 test##inst(v16si8 a, v16si8 b) { return a op b; } 29 v16si8 test##inst(v16si8 a, v16si8 b) { return a op b; }
29 SINTOP_TABLE 30 SINTOP_TABLE
30 #undef X 31 #undef X
31 32
32 #define X(inst, op, func) \ 33 #define X(inst, op, func) \
33 float test##inst(float a, float b) { return func(a op b); } \ 34 float test##inst(float a, float b) { return func(a op b); } \
34 double test##inst(double a, double b) { return func(a op b); } \ 35 double test##inst(double a, double b) { return func(a op b); } \
35 v4f32 test##inst(v4f32 a, v4f32 b) { return func(a op b); } 36 v4f32 test##inst(v4f32 a, v4f32 b) { return func(a op b); }
36 FPOP_TABLE 37 FPOP_TABLE
37 #undef X 38 #undef X
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698