Software APIs
float.h
Go to the documentation of this file.
1 // Copyright lowRISC contributors (OpenTitan project).
2 // Licensed under the Apache License, Version 2.0, see LICENSE for details.
3 // SPDX-License-Identifier: Apache-2.0
4 
5 #ifndef OPENTITAN_SW_DEVICE_LIB_BASE_FREESTANDING_FLOAT_H_
6 #define OPENTITAN_SW_DEVICE_LIB_BASE_FREESTANDING_FLOAT_H_
7 
8 /**
9  * @file
10  * @brief C library Floating-point environment (Freestanding)
11  *
12  * This header implements the float.h standard header, as required by C11 S4p6.
13  * This header is specified in detail in S7.7 and S5.2.4.2.2 of the same.
14  *
15  * The compiler-defined names below are cribbed from
16  * https://clang.llvm.org/doxygen/float_8h_source.html
17  */
18 
19 #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ /**< @hideinitializer */
20 #define FLT_ROUNDS (-1) /**< @hideinitializer */
21 #define FLT_RADIX __FLT_RADIX__ /**< @hideinitializer */
22 
23 #define FLT_MANT_DIG __FLT_MANT_DIG__ /**< @hideinitializer */
24 #define DBL_MANT_DIG __DBL_MANT_DIG__ /**< @hideinitializer */
25 #define LDBL_MANT_DIG __LDBL_MANT_DIG__ /**< @hideinitializer */
26 
27 #define DECIMAL_DIG __DECIMAL_DIG__ /**< @hideinitializer */
28 
29 #define FLT_DIG __FLT_DIG__ /**< @hideinitializer */
30 #define DBL_DIG __DBL_DIG__ /**< @hideinitializer */
31 #define LDBL_DIG __LDBL_DIG__ /**< @hideinitializer */
32 
33 #define FLT_MIN_EXP __FLT_MIN_EXP__ /**< @hideinitializer */
34 #define DBL_MIN_EXP __DBL_MIN_EXP__ /**< @hideinitializer */
35 #define LDBL_MIN_EXP __LDBL_MIN_EXP__ /**< @hideinitializer */
36 
37 #define FLT_MIN_10_EXP __FLT_MIN_10_EXP__ /**< @hideinitializer */
38 #define DBL_MIN_10_EXP __DBL_MIN_10_EXP__ /**< @hideinitializer */
39 #define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__ /**< @hideinitializer */
40 
41 #define FLT_MAX_EXP __FLT_MAX_EXP__ /**< @hideinitializer */
42 #define DBL_MAX_EXP __DBL_MAX_EXP__ /**< @hideinitializer */
43 #define LDBL_MAX_EXP __LDBL_MAX_EXP__ /**< @hideinitializer */
44 
45 #define FLT_MAX_10_EXP __FLT_MAX_10_EXP__ /**< @hideinitializer */
46 #define DBL_MAX_10_EXP __DBL_MAX_10_EXP__ /**< @hideinitializer */
47 #define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__ /**< @hideinitializer */
48 
49 #define FLT_MAX __FLT_MAX__ /**< @hideinitializer */
50 #define DBL_MAX __DBL_MAX__ /**< @hideinitializer */
51 #define LDBL_MAX __LDBL_MAX__ /**< @hideinitializer */
52 
53 #define FLT_EPSILON __FLT_EPSILON__ /**< @hideinitializer */
54 #define DBL_EPSILON __DBL_EPSILON__ /**< @hideinitializer */
55 #define LDBL_EPSILON __LDBL_EPSILON__ /**< @hideinitializer */
56 
57 #define FLT_MIN __FLT_MIN__ /**< @hideinitializer */
58 #define DBL_MIN __DBL_MIN__ /**< @hideinitializer */
59 #define LDBL_MIN __LDBL_MIN__ /**< @hideinitializer */
60 
61 #define FLT_TRUE_MIN __FLT_DENORM_MIN__ /**< @hideinitializer */
62 #define DBL_TRUE_MIN __DBL_DENORM_MIN__ /**< @hideinitializer */
63 #define LDBL_TRUE_MIN __LDBL_DENORM_MIN__ /**< @hideinitializer */
64 
65 #define FLT_DECIMAL_DIG __FLT_DECIMAL_DIG__ /**< @hideinitializer */
66 #define DBL_DECIMAL_DIG __DBL_DECIMAL_DIG__ /**< @hideinitializer */
67 #define LDBL_DECIMAL_DIG __LDBL_DECIMAL_DIG__ /**< @hideinitializer */
68 
69 #define FLT_HAS_SUBNORM __FLT_HAS_DENORM__ /**< @hideinitializer */
70 #define DBL_HAS_SUBNORM __DBL_HAS_DENORM__ /**< @hideinitializer */
71 #define LDBL_HAS_SUBNORM __LDBL_HAS_DENORM__ /**< @hideinitializer */
72 
73 #endif // OPENTITAN_SW_DEVICE_LIB_BASE_FREESTANDING_FLOAT_H_