-
Notifications
You must be signed in to change notification settings - Fork 13
/
vr_main.h
229 lines (176 loc) · 5.47 KB
/
vr_main.h
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
/*--------------------------------------------------------------------*/
/*--- Verrou: a FPU instrumentation tool. ---*/
/*--- Header file for core valgrind-based features. ---*/
/*--- vr_main.h ---*/
/*--------------------------------------------------------------------*/
/*
This file is part of Verrou, a FPU instrumentation tool.
Copyright (C) 2014-2021 EDF
F. Févotte <[email protected]>
B. Lathuilière <[email protected]>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307, USA.
The GNU General Public License is contained in the file COPYING.
*/
#ifndef __VR_MAIN_H
#define __VR_MAIN_H
#include "pub_tool_basics.h"
#include "pub_tool_vki.h"
#include "pub_tool_debuginfo.h"
#include "pub_tool_libcbase.h"
#include "pub_tool_libcassert.h"
#include "pub_tool_libcfile.h"
#include "pub_tool_libcprint.h"
#include "pub_tool_libcproc.h"
#include "pub_tool_machine.h"
#include "pub_tool_mallocfree.h"
#include "pub_tool_options.h"
#include "pub_tool_oset.h"
#include "pub_tool_tooliface.h"
#include "pub_tool_xarray.h"
#include "pub_tool_clientstate.h"
#include "pub_tool_machine.h"
#include "pub_tool_stacktrace.h"
#include "pub_tool_threadstate.h"
#include "pub_tool_gdbserver.h"
#include "verrou.h"
#include "interflop_backends/statically_integrated_backends.h"
#include "vr_exclude.h"
#include "vr_error.h"
#include "vr_include_trace.h"
#define VR_FNNAME_BUFSIZE 4096
typedef enum vr_backend_name{vr_verrou,vr_mcaquad, vr_checkdenorm} vr_backend_name_t;
typedef enum vr_backendpost_name{vr_nopost,vr_checkcancellation, vr_check_float_max} vr_backendpost_name_t;
// * Type declarations
typedef enum {
VR_INSTR_OFF,
VR_INSTR_ON,
VR_INSTR
} Vr_Instr;
typedef enum {
VR_OP_ADD, // Addition
VR_OP_SUB, // Subtraction
VR_OP_MUL, // Multiplication
VR_OP_DIV, // Division
VR_OP_MADD, // FMA ADD
VR_OP_MSUB, // FMA SUB
VR_OP_SQRT, // Sqrt
VR_OP_CMP, // Comparison
VR_OP_CONV, // Conversion
VR_OP_MAX, // Maximum
VR_OP_MIN, // Minimum
VR_OP
} Vr_Op; //Warning : Operation after VR_OP_CMP are not instrumented
// *** Vector operations
typedef enum {
VR_VEC_SCAL, // Scalar operation
VR_VEC_LLO, // Vector operation, lowest lane only
VR_VEC_FULL2, // Vector operation
VR_VEC_FULL4, // Vector operation
VR_VEC_FULL8, // Vector operation
VR_VEC_UNK,
VR_VEC
} Vr_Vec;
// *** Operation precision
typedef enum {
VR_PREC_FLT, // Single
VR_PREC_DBL, // Double
VR_PREC_LDBL, // LDouble
VR_PREC_DBL_TO_FLT,
VR_PREC_FLT_TO_DBL,
VR_PREC_DBL_TO_INT,
VR_PREC_DBL_TO_SHT,
VR_PREC_FLT_TO_INT,
VR_PREC_FLT_TO_SHT,
VR_PREC
} Vr_Prec;
typedef enum {
VR_PRANDOM_UPDATE_NONE,
VR_PRANDOM_UPDATE_FUNC,
} Vr_Prandom_update;
typedef struct {
vr_backend_name_t backend;
enum vr_RoundingMode roundingMode;
enum vr_RoundingMode roundingModeNoInst;
Vr_Prandom_update prandomUpdate;
double prandomFixedInitialValue;
Bool count;
Bool instr_op[VR_OP];
Bool instr_vec[VR_VEC];
Bool instr_prec[VR_PREC];
Bool float_conv;
// Vr_Instr instrument;
Vr_Instr instrument_hard;
Vr_Instr instrument_soft;
Bool instrument_soft_used;
Bool verbose;
Bool unsafe_llo_optim;
ULong firstSeed;
Bool genExcludeBool;
HChar * excludeFile;
// HChar * genAbove;
Vr_Exclude * exclude;
Vr_Exclude * gen_exclude;
Bool excludeDetect;
Bool loadInterLibm;
Bool genIncludeSource;
HChar* includeSourceFile;
Bool sourceActivated;
Vr_IncludeSource *includeSource;
Vr_IncludeSource *gen_includeSource;
Bool sourceExcludeActivated;
Vr_IncludeSource *excludeSourceRead;
UInt mca_precision_double;
UInt mca_precision_float;
UInt mca_mode;
Bool checknan;
Bool checkinf;
Bool checkCancellation;
UInt cc_threshold_double;
UInt cc_threshold_float;
Bool dumpCancellation;
HChar* cancellationDumpFile;
Vr_IncludeSource * cancellationSource;
Bool checkDenorm;
Bool ftz;
Bool dumpDenorm ;
HChar* denormDumpFile;
Vr_IncludeSource * denormSource;
Bool checkFloatMax;
Bool genTrace;
Vr_Include_Trace* includeTrace;
Bool useIOMatchCLR;
HChar* IOMatchScript;
Int IOMatchCLRFileInput;
HChar* outputIOMatchFilePattern;
Int IOMatchFileDescriptor;
HChar* outputIOMatchRep;
HChar* outputTraceRep;
} Vr_State;
extern Vr_State vr;
#include "vr_clreq.h"
// Functions declarations
UInt vr_count_fp_instrumented (void);
UInt vr_count_fp_not_instrumented (void);
void vr_ppOpCount (void);
void vr_resetCount(void);
void vr_register_cache(unsigned int*, unsigned int);
void vr_clean_cache(void);
void vr_register_cache_seed(unsigned int*);
void vr_clean_cache_seed(void);
/* Implem in vr_traceBB_impl.h*/
void vr_traceBB_resetCov(void);
UInt vr_traceBB_dumpCov(void);
#include "vr_clo.h"
#include "vr_IOMatch_clr.h"
#endif /*ndef __VR_MAIN_H*/