[libc-commits] [libc] [libc][stdfix] Implement `countlsfx` functions (PR #114318)
via libc-commits
libc-commits at lists.llvm.org
Mon Nov 4 12:20:52 PST 2024
================
@@ -45,6 +45,7 @@ template <> struct FXRep<short fract> {
LIBC_INLINE_VAR static constexpr int FRACTION_LEN = SFRACT_FBIT;
LIBC_INLINE_VAR static constexpr int TOTAL_LEN =
SIGN_LEN + INTEGRAL_LEN + FRACTION_LEN;
+ LIBC_INLINE_VAR static constexpr int VALUE_LEN = INTEGRAL_LEN + FRACTION_LEN;
----------------
PiJoules wrote:
nit: Perhaps to reduce copying `VALUE_LEN` N times in each specialization, you could have a free function
```
template <typename T>
constexpr int GetValueLen() { return T::INTEGRAL_LEN + T::FRACTIONAL_LEN; }
```
https://github.com/llvm/llvm-project/pull/114318
More information about the libc-commits
mailing list