//===------ Pretty print function for FPBits --------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_FPBITS_STR_H #define LLVM_LIBC_SRC___SUPPORT_FPUTIL_FPBITS_STR_H #include "src/__support/CPP/string.h" #include "src/__support/CPP/type_traits.h" #include "src/__support/FPUtil/FPBits.h" #include "src/__support/integer_to_string.h" #include "src/__support/macros/attributes.h" #include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { namespace details { // Format T as uppercase hexadecimal number with leading zeros. ZeroPaddedHexFmt; } // namespace details // Converts the bits to a string in the following format: // "0x<NNN...N> = S: N, E: 0xNNNN, M:0xNNN...N" // 1. N is a hexadecimal digit. // 2. The hexadecimal number on the LHS is the raw numerical representation // of the bits. // 3. The exponent is always 16 bits wide irrespective of the type of the // floating encoding. template <typename T> LIBC_INLINE cpp::string str(fputil::FPBits<T> x) { … } } // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC___SUPPORT_FPUTIL_FPBITS_STR_H