[libc-commits] [libc] [libc][NFC] Simplify FloatProperties implementation (PR #74481)

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Wed Dec 6 07:32:29 PST 2023


================
@@ -27,22 +27,98 @@ enum class FPType {
   X86_Binary80,
 };
 
-template <FPType> struct FPProperties {};
-template <> struct FPProperties<FPType::IEEE754_Binary32> {
-  typedef uint32_t BitsType;
+// For now 'FPEncoding', 'FPBaseProperties' and 'FPCommonProperties' are
+// implementation details.
+namespace internal {
+
+// The type of encoding for supported floating point types.
+enum class FPEncoding {
+  IEEE754,
+  X86_ExtendedPrecision,
+};
+
+template <FPType> struct FPBaseProperties {};
+
+template <> struct FPBaseProperties<FPType::IEEE754_Binary16> {
+  LIBC_INLINE_VAR static constexpr int FP_BITS = 16;
----------------
gchatelet wrote:

Good point. Let's go with `TOTAL_BITS`.

https://github.com/llvm/llvm-project/pull/74481


More information about the libc-commits mailing list