KSeExpr  4.0.4.0
Utils.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2020 L. E. Segovia <amy@amyspark.me>
2 // SPDX-License-Identifier: GPL-3.0-or-later
3 
4 #include <cfloat>
5 #include <cmath>
6 #include <cstdint>
7 #include <stdexcept>
8 #include <string>
9 
10 #include "ExprConfig.h"
11 
12 #if defined(KSeExpr_HAVE_DYNAMIC_DISPATCH)
13 // Enable SSE4.1 functions only with automagic dynamic dispatch available.
14 #include <smmintrin.h>
15 #define KSeExpr_DEFAULT [[gnu::target("default")]]
16 #define KSeExpr_SSE41 [[gnu::target("sse4.1")]]
17 #else
18 #define KSeExpr_DEFAULT
19 #endif
20 
21 namespace KSeExpr
22 {
23 namespace Utils
24 {
25 double_t atof(const char *num);
26 double_t atof(const std::string &num);
27 int32_t strtol(const char *num);
28 int32_t strtol(const std::string &num);
29 KSeExpr_DEFAULT double_t round(double_t val);
30 KSeExpr_DEFAULT double_t floor(double_t val);
31 
32 #if defined(KSeExpr_HAVE_DYNAMIC_DISPATCH)
33 KSeExpr_SSE41 double_t round(double_t val);
34 KSeExpr_SSE41 double_t floor(double_t val);
35 #endif
36 } // namespace Utils
37 } // namespace KSeExpr
#define KSeExpr_DEFAULT
Definition: Utils.h:18
KSeExpr_DEFAULT double_t round(double_t val)
Definition: Utils.cpp:163
KSeExpr_DEFAULT double_t floor(double_t val)
Definition: Utils.cpp:168
int32_t strtol(const char *num)
double_t atof(const char *num)
Definition: Utils.cpp:51