forked from edf-hpc/verrou
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vr_interp_operator_template_2args.h
83 lines (71 loc) · 1.97 KB
/
vr_interp_operator_template_2args.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
static VG_REGPARM(2) Long FCTNAME(64F,) (Long a, Long b) {
double *arg1 = (double*)(&a);
double *arg2 = (double*)(&b);
double res;
PREBACKEND;
BACKENDFUNC(double)(*arg1, *arg2, &res, CONTEXT);
POSTBACKEND;
Long *c = (Long*)(&res);
return *c;
}
static VG_REGPARM(0) void FCTNAME(64F,LLO) (void){
double res;
PREBACKEND;
BACKENDFUNC(double)(arg1CopyDouble[0], arg2CopyDouble[0], &res, CONTEXT);
POSTBACKEND;
arg1CopyDouble[0]=res;
}
static VG_REGPARM(1) void FCTNAME(64Fx2,)(/*OUT*/V128* output){
const double* arg1=arg1CopyDouble;
const double* arg2=arg2CopyDouble;
double* res=(double*) output;
PREBACKEND;
BACKENDFUNC(double)(arg1[0], arg2[0], res, CONTEXT);
BACKENDFUNC(double)(arg1[1], arg2[1], res+1, CONTEXT);
POSTBACKEND;
}
static VG_REGPARM(1) void FCTNAME(64Fx4,) (/*OUT*/V256* output){
double* res=(double*) output;
PREBACKEND;
for(int i=0; i<4; i++){
BACKENDFUNC(double)(arg1CopyDouble[i], arg2CopyDouble[i], res+i, CONTEXT);
}
POSTBACKEND;
}
static VG_REGPARM(2) Int FCTNAME(32F,) (Long a, Long b) {
float *arg1 = (float*)(&a);
float *arg2 = (float*)(&b);
float res;
PREBACKEND;
BACKENDFUNC(float)(*arg1, *arg2, &res, CONTEXT);
POSTBACKEND;
Int *c = (Int*)(&res);
return *c;
}
static VG_REGPARM(0) void FCTNAME(32F,LLO) (void){
float res;
PREBACKEND;
BACKENDFUNC(float)(arg1CopyFloat[0], arg2CopyFloat[0], &res, CONTEXT);
POSTBACKEND;
arg1CopyFloat[0]=res;
}
static VG_REGPARM(1) void FCTNAME(32Fx8,) (/*OUT*/V256* output){
float* res=(float*) output;
float* arg1=arg1CopyFloat;
float* arg2=arg2CopyFloat;
PREBACKEND;
for(int i=0; i<8; i++){
BACKENDFUNC(float)(arg1[i], arg2[i], res+i, CONTEXT);
}
POSTBACKEND;
}
static VG_REGPARM(1) void FCTNAME(32Fx4,) (/*OUT*/V128* output){
float* res=(float*) output;
const float* arg1=arg1CopyFloat;
const float* arg2=arg2CopyFloat;
PREBACKEND;
for(int i=0; i<4;i++){
BACKENDFUNC(float)(arg1[i], arg2[i], res+i, CONTEXT);
}
POSTBACKEND;
}