-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathb-cmp.cc
90 lines (70 loc) · 1.52 KB
/
b-cmp.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#include <lvv/benchmark.h>
using lvv::sse;
using lvv::sse2;
using lvv::plain;
using lvv::mk_array;
#include <algorithm>
/////////////////// CONFIG
//#define I16
#define F32
#ifdef F32
#define TYPE float
//#define CANUSE_OMP
#define CANUSE_SSE
#define CANUSE_SSE2
//#define CANUSE_SSE3
//#define CANUSE_SSE4
// _mm_minpos_epu16
#define SSE_SIZE 4
#define MM_ADD_OP _mm_add_ps
#define MM_CMP_OP _mm_max_ps
#define CMP_OP >
#define REG_T __m128
#define MK_REG mk_m128
#define DO_PLAIN
#define DO_SIMD
#define DO_OMP
#endif
#ifdef I16
#define TYPE int16_t
#define CANUSE_SSE
#define CANUSE_SSE2
#define CANUSE_SSE3
#define CANUSE_OMP
#define SSE_SIZE 8
#define MM_CMP_OP _mm_max_epi16
#define CMP_OP >
#define REG_T __m128i
#define MK_REG mk_m128i
#define DO_PLAIN
#define DO_SIMD
//#define DO_OMP
#endif
#ifndef TYPE
#error "type (F32/I16/...) not defined"
#endif
#define dID 1
int main() {
/////////////////////////////////// CID
cout << CID //<< " << "
#ifdef CANUSE_MMX
<< " mmx "
#endif
#ifdef CANUSE_SSE
<< " sse "
#endif
#ifdef CANUSE_SSE2
<< " sse2 "
#endif
#ifdef CANUSE_OMP
<< " omp "
#endif
<< ">>" << endl;
///////////////////////////////////
timer_t t(true);
float sec, ticks;
cout << "\nValue\tSeconds\t\tTick/Cycle ... Min-Tick/Cycle \t Method\n" << setprecision(4);
// include tests
#include "b-cmp.h"
cerr << endl;
}