llvm-project/libc
Michael Jones 8298424cae [libc] refactor atof string parsing
Split the code for parsing hexadecimal floating point numbers from the
code for parsing the decimal floating point numbers so that the parsing
can be faster for both of them.

This decreases the time for the benchmark in release mode by about 15%,
which noticeably beats GLibc.

Old version: 2.299s
New version: 1.893s
GLibc: 2.133s

Tests run by running the following command 10 times for each version:
time ~/llvm-project/build/bin/libc_str_to_float_comparison_test ~/parse-number-fxx-test-data/data/*

the parse-number-fxx-test-data-repository is here:
fe94de252c

It's important to build llvm-libc in Release mode for accurate
performance comparisons against glibc (set -DCMAKE_BUILD_TYPE=Release in
your cmake).
You also have to build the libc_str_to_float_comparison_test target.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D113036
2021-11-09 10:12:18 -08:00
..
AOR_v20.02 Harmonize Python shebang 2020-07-16 21:53:45 +02:00
benchmarks [libc] automemcpy 2021-10-28 11:10:15 +00:00
cmake/modules [libc] add malloc funcs as external entrypoints 2021-10-27 10:21:01 -07:00
config [libc] add stpcpy and stpncpy 2021-11-04 11:39:26 -07:00
docs [libc] Add documentation for clang-tidy checks. 2020-07-06 18:15:35 -07:00
fuzzing [libc][NFC] Move utils/CPP to src/__support/CPP. 2021-10-28 15:50:00 +00:00
include [libc] add inttypes header 2021-08-26 18:04:21 +00:00
lib [libc] add malloc funcs as external entrypoints 2021-10-27 10:21:01 -07:00
loader [libc] Normalize LIBC_TARGET_MACHINE 2021-05-05 15:52:42 +00:00
spec [libc] add stpcpy and stpncpy 2021-11-04 11:39:26 -07:00
src [libc] refactor atof string parsing 2021-11-09 10:12:18 -08:00
test [libc] refactor atof string parsing 2021-11-09 10:12:18 -08:00
utils [libc] Add more robust compile time architecture detection 2021-11-02 11:00:33 +00:00
CMakeLists.txt [libc][NFC] Remove extra space in libc/CMakeLists.txt 2021-10-25 16:29:14 -04:00
LICENSE.TXT Rename top-level LICENSE.txt files to LICENSE.TXT 2021-03-10 21:26:24 -08:00
README.txt

README.txt

LLVM libc
=========

This directory and its subdirectories contain source code for llvm-libc,
a retargetable implementation of the C standard library.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.