-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinterflop_ieee.h
73 lines (65 loc) · 3.56 KB
/
interflop_ieee.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
/*****************************************************************************\
* *\
* This file is part of the Verificarlo project, *\
* under the Apache License v2.0 with LLVM Exceptions. *\
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception. *\
* See https://llvm.org/LICENSE.txt for license information. *\
* *\
* Copyright (c) 2019-2023 *\
* Verificarlo Contributors *\
* *\
****************************************************************************/
#ifndef __INTERFLOP_IEEE_H__
#define __INTERFLOP_IEEE_H__
#include "interflop/interflop_stdlib.h"
#define INTERFLOP_IEEE_API(name) interflop_ieee_##name
/* Interflop context */
typedef struct {
IUint64_t mul_count;
IUint64_t div_count;
IUint64_t add_count;
IUint64_t sub_count;
IUint64_t fma_count;
IBool debug;
IBool debug_binary;
IBool no_backend_name;
IBool print_new_line;
IBool print_subnormal_normalized;
IBool count_op;
} ieee_context_t;
typedef ieee_context_t ieee_conf_t;
void INTERFLOP_IEEE_API(add_float)(const float a, const float b, float *c,
void *context);
void INTERFLOP_IEEE_API(sub_float)(const float a, const float b, float *c,
void *context);
void INTERFLOP_IEEE_API(mul_float)(const float a, const float b, float *c,
void *context);
void INTERFLOP_IEEE_API(div_float)(const float a, const float b, float *c,
void *context);
void INTERFLOP_IEEE_API(cmp_float)(const enum FCMP_PREDICATE p, const float a,
const float b, int *c, void *context);
void INTERFLOP_IEEE_API(add_double)(const double a, const double b, double *c,
void *context);
void INTERFLOP_IEEE_API(sub_double)(const double a, const double b, double *c,
void *context);
void INTERFLOP_IEEE_API(mul_double)(const double a, const double b, double *c,
void *context);
void INTERFLOP_IEEE_API(div_double)(const double a, const double b, double *c,
void *context);
void INTERFLOP_IEEE_API(cmp_double)(const enum FCMP_PREDICATE p, const double a,
const double b, int *c, void *context);
void INTERFLOP_IEEE_API(cast_double_to_float)(double a, float *b,
void *context);
void INTERFLOP_IEEE_API(fma_float)(float a, float b, float c, float *res,
void *context);
void INTERFLOP_IEEE_API(fma_double)(double a, double b, double c, double *res,
void *context);
void INTERFLOP_IEEE_API(finalize)(void *context);
const char *INTERFLOP_IEEE_API(get_backend_name)(void);
const char *INTERFLOP_IEEE_API(get_backend_version)(void);
void INTERFLOP_IEEE_API(pre_init)(interflop_panic_t panic, File *stream,
void **context);
void INTERFLOP_IEEE_API(cli)(int argc, char **argv, void *context);
void INTERFLOP_IEEE_API(configure)(void *configure, void *context);
struct interflop_backend_interface_t INTERFLOP_IEEE_API(init)(void *context);
#endif /* __INTERFLOP_IEEE_H__ */