1 #pragma once 2 // trace_constants.hpp: definition of constants that direct intermediate result reporting 3 // 4 // Copyright (C) 2017-2021 Stillwater Supercomputing, Inc. 5 // 6 // This file is part of the universal numbers project, which is released under an MIT Open Source license. 7 8 namespace sw::universal { 9 10 # ifndef CFLOAT_VERBOSE_OUTPUT 11 // CFLOAT decode and conversion 12 constexpr bool cfloat_trace_decode = false; 13 constexpr bool cfloat_trace_conversion = false; 14 constexpr bool cfloat_trace_rounding = false; 15 16 // arithmetic operator tracing 17 constexpr bool cfloat_trace_add = false; 18 constexpr bool cfloat_trace_sub = false; 19 constexpr bool cfloat_trace_mul = false; 20 constexpr bool cfloat_trace_div = false; 21 constexpr bool cfloat_trace_reciprocate = false; 22 constexpr bool cfloat_trace_sqrt = false; 23 24 // quire update tracing 25 constexpr bool cfloat_trace_quire_add = false; 26 27 # else // !CFLOAT_VERBOSE_OUTPUT 28 29 #ifdef CFLOAT_TRACE_ALL 30 #define CFLOAT_TRACE_DECODE 31 #define CFLOAT_TRACE_CONVERSION 32 #define CFLOAT_TRACE_ROUNDING 33 #define CFLOAT_TRACE_ADD 34 #define CFLOAT_TRACE_SUB 35 #define CFLOAT_TRACE_MUL 36 #define CFLOAT_TRACE_DIV 37 #define CFLOAT_TRACE_RECIPROCATE 38 #define CFLOAT_TRACE_SQRT 39 40 // trace into the constituent components? 41 #define BLOCKTRIPLE_VERBOSE_OUTPUT 42 #define BLOCKTRIPLE_TRACE_CONVERSION 43 #define BLOCKTRIPLE_TRACE_ADD 44 #define BLOCKTRIPLE_TRACE_SUB 45 #define BLOCKTRIPLE_TRACE_MUL 46 #define BLOCKTRIPLE_TRACE_DIV 47 #endif 48 49 #ifdef CFLOAT_QUIRE_TRACE_ALL 50 #define CFLOAT_QUIRE_TRACE_ADD 51 #endif 52 53 // CFLOAT decode and conversion 54 55 #ifndef CFLOAT_TRACE_DECODE 56 constexpr bool cfloat_trace_decode = false; 57 #else 58 constexpr bool cfloat_trace_decode = true; 59 #endif 60 61 #ifndef CFLOAT_TRACE_CONVERSION 62 constexpr bool cfloat_trace_conversion = false; 63 #else 64 #define VALUE_TRACE_CONVERSION 65 constexpr bool cfloat_trace_conversion = true; 66 #endif 67 68 #ifndef CFLOAT_TRACE_ROUNDING 69 constexpr bool cfloat_trace_rounding = false; 70 #else 71 constexpr bool cfloat_trace_rounding = true; 72 #endif 73 74 // arithmetic operator tracing 75 #ifndef CFLOAT_TRACE_ADD 76 constexpr bool cfloat_trace_add = false; 77 #else 78 #define VALUE_TRACE_ADD 79 constexpr bool cfloat_trace_add = true; 80 #endif 81 82 #ifndef CFLOAT_TRACE_SUB 83 constexpr bool cfloat_trace_sub = false; 84 #else 85 #define VALUE_TRACE_SUB 86 constexpr bool cfloat_trace_sub = true; 87 #endif 88 89 #ifndef CFLOAT_TRACE_MUL 90 constexpr bool cfloat_trace_mul = false; 91 #else 92 #define VALUE_TRACE_MUL 93 constexpr bool cfloat_trace_mul = true; 94 #endif 95 96 #ifndef CFLOAT_TRACE_DIV 97 constexpr bool cfloat_trace_div = false; 98 #else 99 #define VALUE_TRACE_DIV 100 constexpr bool cfloat_trace_div = true; 101 #endif 102 103 #ifndef CFLOAT_TRACE_RECIPROCATE 104 constexpr bool cfloat_trace_reciprocate = false; 105 #else 106 constexpr bool cfloat_trace_reciprocate = true; 107 #endif 108 109 #ifndef CFLOAT_TRACE_SQRT 110 constexpr bool cfloat_trace_sqrt = false; 111 #else 112 constexpr bool cfloat_trace_sqrt = true; 113 #endif 114 115 // quire tracing 116 #ifndef CFLOAT_QUIRE_TRACE_ADD 117 constexpr bool cfloat_trace_quire_add = false; 118 #else 119 constexpr bool cfloat_trace_quire_add = true; 120 #endif 121 122 # endif 123 124 } // namespace sw::universal 125