Commit Graph

222 Commits

Author SHA1 Message Date
Pavel Labath 9cb222e749 [cmake] Make gtest include directories a part of the library interface
This applies the same fix that D84748 did for macro definitions.
Appropriate include path is now automatically set for all libraries
which link against gtest targets, which avoids the need to set
include_directories in various parts of the project.

Differential Revision: https://reviews.llvm.org/D86616
2020-08-27 15:35:57 +02:00
Tue Ly 5078825aa9 [libc] Add implementations for sqrt, sqrtf, and sqrtl.
Differential Revision: https://reviews.llvm.org/D84726
2020-08-26 09:46:18 -04:00
Siva Chandra Reddy fe44992b79 [libc][NFC] For remquo quotient, compare only 3 bits of MPFR and libc results. 2020-08-25 23:42:06 -07:00
Siva Chandra Reddy 1948acb61b [libc][obvious] Add back the accidentally removed MPFRNumber destructor. 2020-08-25 21:57:46 -07:00
Siva Chandra Reddy 3f4674a557 [libc] Extend MPFRMatcher to handle multiple-input-multiple-output functions.
Tests for frexp[f|l] now use the new capability. Not all input-output
combinations have been addressed by this change. Support for newer combinations
can be added in future as needed.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D86506
2020-08-25 21:42:49 -07:00
Siva Chandra Reddy 87bf0b0ee9 [libc] Add a class called NormalFloat which represents normalized floats.
This class helps in dealing with normal and subnormal numbers uniformly.
Moreover, since this class has been designed to handle all floating
formats across platforms, it helps implement floating point functions in
a uniform manner.

The implementations of frexp and logb have been switched to use this new
class as it allows us to use just one implementation across all
different floating point formats.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D86241
2020-08-20 09:00:35 -07:00
Siva Chandra Reddy ed8982da3e [libc][NFC] Switch math tests to the new ULP based tolerance.
Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D86267
2020-08-20 08:31:31 -07:00
Siva Chandra Reddy e2645488ca [libc][obvious] Fix x86 long double conversion to integer.
Fixes incorrectly constructed ceill tests.
2020-08-19 14:48:55 -07:00
Siva Chandra Reddy f768eb216f [libc][obvious] Fix link order of math tests. 2020-08-18 11:04:58 -07:00
Tue Ly 9887a70e7a [libc] Add ULP function to MPFRNumber class to test correctly rounded functions such as SQRT, FMA.
Add ULP function to MPFRNumber class to test correctly rounded functions.

Differential Revision: https://reviews.llvm.org/D84725
2020-08-18 13:51:58 -04:00
Anthony Steinhauser 25d759c143 [libc] Make benchmark boxplots transparent.
So that the configuration box does not make a part of the plot invisible.

Reviewers: sivachandra

Differential Revision: https://reviews.llvm.org/D85953
2020-08-17 07:34:26 -07:00
cgyurgyik 79ce64ea08 [libc] Add restrict qualifiers to string library; give consistent naming scheme to TableGen files.
Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D85945
2020-08-14 15:41:02 -04:00
Chris Gyurgyik d28f67292e
[libc] [obvious] Fix typographical error. 2020-08-14 08:34:42 -04:00
parallels bc45bab7eb [libc] Add strtok_r implementation.
Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D85779
2020-08-13 15:51:38 -04:00
Siva Chandra 578ac8bfa5 [libc][obvious] Remove the unused file utils/CPP/StringRef.h. 2020-08-12 12:19:11 -07:00
Siva Chandra a87576592c [libc][obvious] Switch copysign[f|l] and fabs[f|l] to the new test matchers. 2020-08-12 00:20:58 -07:00
Siva Chandra 01b99c6e1d [libc][obvious] Switch nearest integer function tests to the new matchers. 2020-08-11 23:33:15 -07:00
Siva Chandra df79e18796 [libc][obvious] Remove a commented out block. 2020-08-11 13:31:17 -07:00
cgyurgyik 667843cc07 [libc] Add strtok implementation.
Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D85615
2020-08-11 13:44:53 -04:00
Siva Chandra Reddy f6d74b29d6 [libc][NFC] Disable a loader test as ld.gold fails to link.
Will be reenabled after investigating and fixing the problem.
2020-08-07 23:45:18 -07:00
Siva Chandra Reddy db936e0e91 [libc][NFC] Add library of floating point test matchers.
This eliminates UnitTest's dependency on FPUtil and hence prevents
non-math tests from depending indirectly on FPUtil. The patch
essentially moves some of the existing pieces into a library of its own.

Along the way, renamed add_math_unittest to add_fp_unittest.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D85486
2020-08-07 23:34:15 -07:00
Siva Chandra Reddy 5d59385ba6 [libc] Setup TLS in x86_64 loader.
The new code added is still very x86_64 specific. AArch64 support will
be added very soon and refactoring of the loader code will be done as
part of the patches adding it.

Reviewed By: asteinhauser

Differential Revision: https://reviews.llvm.org/D82700
2020-08-07 23:19:03 -07:00
cgyurgyik dc13a9a781 [libc] Add strcpsn and strpbrk implementation.
Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D85386
2020-08-07 16:14:32 -04:00
cgyurgyik 128bf458ab [libc] Add tolower, toupper implementation.
Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D85326
2020-08-06 15:21:38 -04:00
cgyurgyik f3b4150255 [libc] Add strspn implementation and std::bitset
Reviewed By: sivachandra, abrachet

Differential Revision: https://reviews.llvm.org/D85103
2020-08-05 16:48:38 -04:00
Chris Gyurgyik 049f6ad4f6
[libc] [obvious] Add ctype functions to linux api.
Adds isspace, isprint, and isxdigit to Linux API to fix failed integration test.
2020-08-05 11:05:50 -04:00
cgyurgyik 1fdab96130 [libc] Add isspace, isprint, isxdigit implementations.
Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D85270
2020-08-05 10:51:43 -04:00
cgyurgyik 6cd50e7b75 [libc] Add implementations for isblank, iscntrl, isgraph, ispunct.
Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D85059
2020-08-04 15:16:58 -04:00
cgyurgyik 1b35c4fed2 [libc] [obvious] In strrchr, remove cast to unsigned char before
comparison.
2020-07-31 20:14:34 -04:00
cgyurgyik 5954755939 [libc] [obvious] Fix strchr and strrchr tests so that constness is
actually verified.
2020-07-31 20:00:59 -04:00
Chris Gyurgyik 7212ad067e
[libc] [obvious] Add rest of strrchr test. 2020-07-31 14:57:46 -04:00
cgyurgyik e8a2af28af [libc] Adds strrchr implementation.
Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D84875
2020-07-31 14:38:34 -04:00
cgyurgyik e2d4bf6cec [libc] Add islower and isupper implementation.
Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D84960
2020-07-31 14:05:27 -04:00
Siva Chandra Reddy a32af8252f [libc] Add a tool called WrapperGen.
This tool will be used to generate C wrappers for the C++ LLVM libc
implementations. This change does not hook this tool up to anything yet.
However, it can be useful for cases where one does not want to run the
objcopy step (to insert the C symbol in the object file) but can make use
of LTO to eliminate the cost of the additional wrapper call. This can be
relevant for certain downstream platforms. If this tool can benefit other
libc platforms in general, then it can be integrated into the build system
with options to use or not use the wrappers. An example of such a
platform is CUDA.

Reviewed By: abrachet

Differential Revision: https://reviews.llvm.org/D84848
2020-07-30 16:07:26 -07:00
cgyurgyik e263dcc3ef [libc] Implements isdigit and isalnum. Adds a utility header to inline
functions to avoid overhead of function calls.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D84893
2020-07-30 12:37:30 -04:00
cgyurgyik e14a7ff762 [libc] Adds fuzz test for strstr and alphabetizes string fuzz CMakeList.
Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D84611
2020-07-29 16:35:59 -04:00
Chris Gyurgyik 33abb7292e
[libc] [obvious] Fix typo in binary header. 2020-07-29 08:18:07 -04:00
Siva Chandra Reddy cd7a5c3cd9 [libc][obvious] Add license headers to APIIndexer.[cpp|h]. 2020-07-28 17:04:03 -07:00
Siva Chandra Reddy 462b3564f1 [libc][obvious] Add the new ctype.h target to the list of x86_64 headers.
This will fix the integration test which is failing currently.
2020-07-28 16:42:25 -07:00
Siva Chandra Reddy 59f17a7d4f [libc][NFC] Move tablegen indexer class into a util library of its own.
This class is currently used by two tools: HdrGen and PrototypeTestGen.
We will be adding more tools based on this class so it is convenient to
keep it in a util library of its own.
2020-07-28 16:35:19 -07:00
cgyurgyik 75f222b476 [libc] [Obvious] Delete ctype.h, since ctype.h.def is used. 2020-07-28 19:20:14 -04:00
cgyurgyik 686c82b974 [libc] Add scaffolding for ctype and implementation of isalpha
Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D84575
2020-07-28 19:17:31 -04:00
Siva Chandra Reddy 9cc70e047c [libc][NFC] Zero out padding bits in the uint form of x86 FPBits<long double>. 2020-07-28 11:59:04 -07:00
Siva Chandra Reddy acca2980a3 [libc][obvious] Move ErrnoSetterMatcher to test/ErrnoSetterMetcher.h. 2020-07-28 11:05:52 -07:00
cgyurgyik 51eeeb477f [libc] [Obvious] Place entrypoints, specs alphabetically. 2020-07-24 15:52:35 -04:00
cgyurgyik 5a9630b777 [libc] Adds implementation for memrchr.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D84469
2020-07-24 14:40:12 -04:00
Tue Ly 1404d9d68a [libc] Remove unused #include <vector> in fmin_test, fminf_test, and fminl_test. 2020-07-23 15:26:05 -04:00
Tue Ly 4096088e19 [libc] Add implementations of fmax, fmaxf, and fmaxl.
Summary: Add implementations of fmax, fmaxf, and fmaxl.

Reviewers: sivachandra

Subscribers: mgorny, tschuett, libc-commits, ecnelises

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D84385
2020-07-23 15:23:08 -04:00
cgyurgyik f773d37ee1 [libc] Implements strnlen.
Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D84247
2020-07-22 18:28:35 -04:00
Tue Ly 7ce32f87f9 Add implementations for fmin, fminf, and fminl. Testing infrastructure update is splitted to https://reviews.llvm.org/D83931. 2020-07-21 17:24:15 -04:00