[libc] Simplify decimalStringToFloat and hexadecimalStringToFloat and improve their performance.
Combine two loops in decimalStringToFloat and hexadecimalStringToFloat that extract the digits and re-arrange them a little bit. This slightly improves the performance of strtof and strtod: Running libc_str_to_float_comparison_test parse-number-fxx-test_data/data/* on my machine (Ryzen 1700) - with glibc: ~1.92 seconds - with current implementation: ~1.78 seconds - with this change: ~1.67 seconds Differential Revision: https://reviews.llvm.org/D113681
Loading
Please sign in to comment