[libc-commits] [libc] [libc][math][c23] Add hypotf16 function (PR #131991)

via libc-commits libc-commits at lists.llvm.org
Fri Mar 28 04:39:35 PDT 2025


================
@@ -51,8 +51,8 @@ LLVM_LIBC_FUNCTION(float16, hypotf16, (float16 x, float16 y)) {
                                           << FPBits::FRACTION_LEN)))
     return x_abs.get_val() + y_abs.get_val();
 
-  float af = fputil::cast<float>(a_bits.get_val());
-  float bf = fputil::cast<float>(b_bits.get_val());
+  float af = static_cast<float>(a_bits.get_val());
----------------
lntue wrote:

don't replace `fputil::cast` with `static_cast`.  It is there because there are several targets with not correctly rounded `cast` in the compiler runtime that backing up these `static_cast`.  Instead we should add specializations / optimizations for `fputil::cast` for known-good targets in the followup work.

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


More information about the libc-commits mailing list