forked from edf-hpc/verrou
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvr_interp_operator_template_2args.h
63 lines (51 loc) · 1.94 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
static VG_REGPARM(2) Long FCTNAME(64F,) (Long a, Long b) {
double *arg1 = (double*)(&a);
double *arg2 = (double*)(&b);
double res;
BACKENDFUNC(double)(*arg1, *arg2, &res, CONTEXT);
Long *c = (Long*)(&res);
return *c;
}
static VG_REGPARM(3) void FCTNAME(64Fx2,)(/*OUT*/V128* output, ULong aHi, ULong aLo, ULong bHi,ULong bLo) {
double arg1[2] = {*((double*)(&aLo)),*((double*)(&aHi))} ;
double arg2[2] = {*((double*)(&bLo)),*((double*)(&bHi))} ;
double* res=(double*) output;
BACKENDFUNC(double)(arg1[0], arg2[0], res, CONTEXT);
BACKENDFUNC(double)(arg1[1], arg2[1], res+1, CONTEXT);
}
static VG_REGPARM(3) void FCTNAME(64Fx4,) (/*OUT*/V256* output,
ULong b0, ULong b1, ULong b2,ULong b3) {
double arg2[4] = {*((double*)(&b0)),*((double*)(&b1)), *((double*)(&b2)),*((double*)(&b3))} ;
double* res=(double*) output;
for(int i=0; i<4; i++){
BACKENDFUNC(double)(arg1CopyAvxDouble[i], arg2[i], res+i, CONTEXT);
}
}
static VG_REGPARM(2) Int FCTNAME(32F,) (Long a, Long b) {
float *arg1 = (float*)(&a);
float *arg2 = (float*)(&b);
float res;
BACKENDFUNC(float)(*arg1, *arg2, &res, CONTEXT);
Int *c = (Int*)(&res);
return *c;
}
static VG_REGPARM(3) void FCTNAME(32Fx8,) (/*OUT*/V256* output,
ULong b0, ULong b1, ULong b2,ULong b3) {
V256 reg2; reg2.w64[0]=b0; reg2.w64[1]=b1; reg2.w64[2]=b2; reg2.w64[3]=b3;
float* res=(float*) output;
float* arg1=arg1CopyAvxFloat;
float* arg2=(float*) ®2;
for(int i=0; i<8; i++){
BACKENDFUNC(float)(arg1[i], arg2[i], res+i, CONTEXT);
}
}
static VG_REGPARM(3) void FCTNAME(32Fx4,) (/*OUT*/V128* output, ULong aHi, ULong aLo, ULong bHi,ULong bLo) {
V128 reg1; reg1.w64[0]=aLo; reg1.w64[1]=aHi;
V128 reg2; reg2.w64[0]=bLo; reg2.w64[1]=bHi;
float* res=(float*) output;
float* arg1=(float*) ®1;
float* arg2=(float*) ®2;
for(int i=0; i<4;i++){
BACKENDFUNC(float)(arg1[i], arg2[i], res+i, CONTEXT);
}
}