aboutsummaryrefslogtreecommitdiff
path: root/libc/utils
diff options
context:
space:
mode:
authorJoseph Huber <huberjn@outlook.com>2024-02-23 16:34:00 -0600
committerGitHub <noreply@github.com>2024-02-23 16:34:00 -0600
commit69c0b2febe01108f50db6e8ed21cd8b2e6088caf (patch)
tree4b9d61d0c798b2871a6ce60177c55ef65d445a42 /libc/utils
parent25940956e68ec82d841e5748565e7250580e1d36 (diff)
downloadllvm-69c0b2febe01108f50db6e8ed21cd8b2e6088caf.zip
llvm-69c0b2febe01108f50db6e8ed21cd8b2e6088caf.tar.gz
llvm-69c0b2febe01108f50db6e8ed21cd8b2e6088caf.tar.bz2
[libc][NFC] Remove all trailing spaces from libc (#82831)
Summary: There are a lot of random training spaces on various lines. This patch just got rid of all of them with `sed 's/\ \+$//g'.
Diffstat (limited to 'libc/utils')
-rw-r--r--libc/utils/MPFRWrapper/CMakeLists.txt8
-rw-r--r--libc/utils/gpu/server/CMakeLists.txt2
-rw-r--r--libc/utils/mathtools/GenerateHPDConstants.py24
-rw-r--r--libc/utils/mathtools/ryu_tablegen.py2
4 files changed, 18 insertions, 18 deletions
diff --git a/libc/utils/MPFRWrapper/CMakeLists.txt b/libc/utils/MPFRWrapper/CMakeLists.txt
index 6f44ca0..2f2b0ac 100644
--- a/libc/utils/MPFRWrapper/CMakeLists.txt
+++ b/libc/utils/MPFRWrapper/CMakeLists.txt
@@ -7,14 +7,14 @@ if(LIBC_TESTS_CAN_USE_MPFR)
target_compile_options(libcMPFRWrapper PRIVATE -O3)
if (LLVM_LIBC_FULL_BUILD)
# It is not easy to make libcMPFRWrapper a standalone library because gmp.h may unconditionally
- # pull in some STL headers. As a result, targets using this library will need to link against
+ # pull in some STL headers. As a result, targets using this library will need to link against
# C++ and unwind libraries. Since we are using MPFR anyway, we directly specifies the GNU toolchain.
target_link_libraries(libcMPFRWrapper PUBLIC -lstdc++ -lgcc_s)
endif()
add_dependencies(
- libcMPFRWrapper
- libc.src.__support.CPP.string_view
- libc.src.__support.CPP.type_traits
+ libcMPFRWrapper
+ libc.src.__support.CPP.string_view
+ libc.src.__support.CPP.type_traits
libc.src.__support.FPUtil.fp_bits
libc.src.__support.FPUtil.fpbits_str
LibcTest.unit
diff --git a/libc/utils/gpu/server/CMakeLists.txt b/libc/utils/gpu/server/CMakeLists.txt
index 745a248d..8712f24 100644
--- a/libc/utils/gpu/server/CMakeLists.txt
+++ b/libc/utils/gpu/server/CMakeLists.txt
@@ -14,7 +14,7 @@ target_compile_definitions(llvmlibc_rpc_server PUBLIC
# This utility needs to be compiled for the host system when cross compiling.
if(LLVM_RUNTIMES_TARGET OR LIBC_TARGET_TRIPLE)
- target_compile_options(llvmlibc_rpc_server PUBLIC
+ target_compile_options(llvmlibc_rpc_server PUBLIC
--target=${LLVM_HOST_TRIPLE})
target_link_libraries(llvmlibc_rpc_server PUBLIC
"--target=${LLVM_HOST_TRIPLE}")
diff --git a/libc/utils/mathtools/GenerateHPDConstants.py b/libc/utils/mathtools/GenerateHPDConstants.py
index c37b35e..642c379 100644
--- a/libc/utils/mathtools/GenerateHPDConstants.py
+++ b/libc/utils/mathtools/GenerateHPDConstants.py
@@ -1,17 +1,17 @@
from math import *
"""
-This script is used to generate a table used by
+This script is used to generate a table used by
libc/src/__support/high_precision_decimal.h.
For the ith entry in the table there are two values (indexed starting at 0).
The first value is the number of digits longer the second value would be if
multiplied by 2^i.
-The second value is the smallest number that would create that number of
-additional digits (which in base ten is always 5^i). Anything less creates one
+The second value is the smallest number that would create that number of
+additional digits (which in base ten is always 5^i). Anything less creates one
fewer digit.
-As an example, the 3rd entry in the table is {1, "125"}. This means that if
+As an example, the 3rd entry in the table is {1, "125"}. This means that if
125 is multiplied by 2^3 = 8, it will have exactly one more digit.
Multiplying it out we get 125 * 8 = 1000. 125 is the smallest number that gives
that extra digit, for example 124 * 8 = 992, and all larger 3 digit numbers
@@ -19,17 +19,17 @@ also give only one extra digit when multiplied by 8, for example 8 * 999 = 7992.
This makes sense because 5^3 * 2^3 = 10^3, the smallest 4 digit number.
For numbers with more digits we can ignore the digits past what's in the second
-value, since the most significant digits determine how many extra digits there
-will be. Looking at the previous example, if we have 1000, and we look at just
-the first 3 digits (since 125 has 3 digits), we see that 100 < 125, so we get
-one fewer than 1 extra digits, which is 0.
-Multiplying it out we get 1000 * 8 = 8000, which fits the expectation.
-Another few quick examples:
+value, since the most significant digits determine how many extra digits there
+will be. Looking at the previous example, if we have 1000, and we look at just
+the first 3 digits (since 125 has 3 digits), we see that 100 < 125, so we get
+one fewer than 1 extra digits, which is 0.
+Multiplying it out we get 1000 * 8 = 8000, which fits the expectation.
+Another few quick examples:
For 1255, 125 !< 125, so 1 digit more: 1255 * 8 = 10040
For 9999, 999 !< 125, so 1 digit more: 9999 * 8 = 79992
-Now let's try an example with the 10th entry: {4, "9765625"}. This one means
-that 9765625 * 2^10 will have 4 extra digits.
+Now let's try an example with the 10th entry: {4, "9765625"}. This one means
+that 9765625 * 2^10 will have 4 extra digits.
Let's skip straight to the examples:
For 1, 1 < 9765625, so 4-1=3 extra digits: 1 * 2^10 = 1024, 1 digit to 4 digits is a difference of 3.
For 9765624, 9765624 < 9765625 so 3 extra digits: 9765624 * 1024 = 9999998976, 7 digits to 10 digits is a difference of 3.
diff --git a/libc/utils/mathtools/ryu_tablegen.py b/libc/utils/mathtools/ryu_tablegen.py
index 91e2029..0280643 100644
--- a/libc/utils/mathtools/ryu_tablegen.py
+++ b/libc/utils/mathtools/ryu_tablegen.py
@@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
-This file is used to generate the tables of values in
+This file is used to generate the tables of values in
src/__support/ryu_constants.h and ryu_long_double constants.h. To use it, set
the constants at the top of the file to the values you want to use for the Ryu
algorithm, then run this file. It will output the appropriate tables to stdout,