[clang] [llvm] [HexFloat] add HexFloat to APFloat (PR #179771)

Hubert Tong via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 6 08:57:58 PST 2026


================
@@ -5865,257 +5933,2297 @@ DoubleAPFloat frexp(const DoubleAPFloat &Arg, int &Exp,
                        std::move(Second));
 }
 
-} // namespace detail
-
-APFloat::Storage::Storage(IEEEFloat F, const fltSemantics &Semantics) {
-  if (usesLayout<IEEEFloat>(Semantics)) {
-    new (&IEEE) IEEEFloat(std::move(F));
-    return;
-  }
-  if (usesLayout<DoubleAPFloat>(Semantics)) {
-    const fltSemantics& S = F.getSemantics();
-    new (&Double) DoubleAPFloat(Semantics, APFloat(std::move(F), S),
-                                APFloat(APFloatBase::IEEEdouble()));
-    return;
-  }
-  llvm_unreachable("Unexpected semantics");
-}
+// class HexFloatArith implements HFP arithemtic using the conventions
+// and approaches of the arith library, and matches the behaviour
----------------
hubert-reinterpretcast wrote:

Can you expand the comment. For example, elaborate by saying:
> the "arith" library used by the IBM XL compiler

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


More information about the cfe-commits mailing list