Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
fp-counters.h
Go to the documentation of this file.
1#ifndef _FP_COUNTERS_H
2#define _FP_COUNTERS_H
3
4#if GLOBAL_COUNTERS != 0
5
6#include <stdint.h>
7#include "../namespace.h"
8
9#define fpadd COMMON(fpadd)
10extern __thread uint64_t fpadd; // counter of fp-additions
11#define fpsqr COMMON(fpsqr)
12extern __thread uint64_t fpsqr; // counter of fp-squarings
13#define fpmul COMMON(fpmul)
14extern __thread uint64_t fpmul;
15
16#define CNT_FP_ADD_INC() fpadd++
17#define CNT_FP_MUL_INC() fpmul++
18#define CNT_FP_MUL_DEC() fpmul--
19#define CNT_FP_SQR_INC() fpsqr++
20
21static inline void init_counters(void)
22{
23 fpadd = 0;
24 fpsqr = 0;
25 fpmul = 0;
26}
27#else
28
29#define CNT_FP_ADD_INC()
30#define CNT_FP_MUL_INC()
31#define CNT_FP_MUL_DEC()
32#define CNT_FP_SQR_INC()
33
34static inline void init_counters(void)
35{
36 ; // NOOP
37}
38#endif
39
40#endif /* !defined(_FP_COUNTERS_H) */