Siva Chandra Reddy
e4be4bcf83
[libc][NFC] Use a convenience macro to declare special floating point constants.
...
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D90262
2020-10-27 16:55:16 -07:00
Tue Ly
f55963d501
[libc] Add implementation for hypotf
...
Truncating the sum of squares, and then use shift-and-add algorithm to compute its square root.
Required MPFR testing infra is updated in https://reviews.llvm.org/D87514
Differential Revision: https://reviews.llvm.org/D87516
2020-09-17 23:28:36 -04:00
Siva Chandra Reddy
ba5b1371ec
[libc][NFC] Add spec files as dependencies of integration test.
2020-09-09 10:22:27 -07:00
Siva Chandra Reddy
17ac4543d4
[libc][obvious] Use constants of type double in remquo_test.
2020-09-03 22:26:25 -07:00
Siva Chandra Reddy
8514ecb02d
[libc] Add implementations of remquo[f|l] and remainder[f|l].
...
The implementation is not fully standards compliant in the sense that
errno is not set on error, and floating point exceptions are not raised.
Subnormal range and normal range are tested separately in the tests.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D86666
2020-09-03 22:00:17 -07: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
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
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
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
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
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
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
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
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
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
acca2980a3
[libc][obvious] Move ErrnoSetterMatcher to test/ErrnoSetterMetcher.h.
2020-07-28 11:05:52 -07: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
cgyurgyik
d080635bfc
[libc] Add strstr implementation.
...
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D83956
2020-07-21 11:39:23 -04:00
cgyurgyik
a4f0c58c6e
[libc] Add strchr implementation. Fixes bug in memchr.
...
Summary: [libc] Adds strchr implementation with unit tests. Fixes signed character bug in memchr.
Reviewers: sivachandra, PaulkaToast
Reviewed By: sivachandra
Subscribers: mgorny, tschuett, ecnelises, libc-commits
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D83353
2020-07-10 14:30:20 -04:00
cgyurgyik
b6a20a4970
[libc] Add memchr implementation.
2020-07-07 17:08:50 -04:00
Siva Chandra Reddy
d4adac4832
[libc] Add the remaining long double flavors of nearest integer functions.
...
Specifically: ceill, floorl and roundl have been added.
Reviewers: asteinhauser
Differential Revision: https://reviews.llvm.org/D82591
2020-06-25 22:45:05 -07:00
Siva Chandra Reddy
7abdb2b948
[libc][Obvious] Remove a debug #include of iostream.
2020-06-24 00:01:03 -07:00
Siva Chandra Reddy
a00fb593b4
[libc] Add long double flavors of the floating point manipulation functions.
...
Specifically: copysignl, frexpl, logbl and modfl have been added.
Reviewers: asteinhauser
Differential Revision: https://reviews.llvm.org/D82357
2020-06-23 23:46:58 -07:00
Siva Chandra Reddy
dc72be4e01
[libc][Obvious] Fix few typos in tests.
2020-06-23 13:11:41 -07:00
Siva Chandra Reddy
987fac79c9
[libc] Match x86 long double NaN classification with that of the compiler.
...
Reviewers: asteinhauser
Differential Revision: https://reviews.llvm.org/D82330
2020-06-22 23:02:05 -07:00
cgyurgyik
05e1612c43
[libc] This adds the strcmp (string compare) implementation.
...
Reviewed-by: sivachandra
Differential Revision: https://reviews.llvm.org/D82134
2020-06-19 16:09:44 -04:00
Siva Chandra Reddy
139018265b
[libc] Add implementations long double fabsl and truncl functions.
...
Current implementations of single precision and double precision
floating point operations operate on bits of the integer type of
same size. The code made use of magic masks which were listed as
literal integer values. This is not possible in the case of long
double type as the mantissa of quad-precision long double type used
on non-x86 architectures is wider that the widest integer type for
which we can list literal values. So, in this patch, to avoid
using magic masks specified with literal values, we use packed
bit-field struct types and let the compiler generate the masks.
This new scheme allows us to implement long double flavors of the
various floating point operations. To keep the size of the patch
small, only the implementations of fabs and trunc have been
switched to the new scheme. In following patches, all exisiting
implementations will be switched to the new scheme.
Reviewers: asteinhauser
Differential Revision: https://reviews.llvm.org/D82036
2020-06-18 11:08:26 -07:00
Siva Chandra Reddy
6fb7f3a3cf
[lib][NFC] Split the floating point util functions into multiple files.
...
The grouping now reflects the grouping on cppreference.com.
2020-06-15 23:12:00 -07:00
Siva Chandra Reddy
118c13c691
[libc] Add implementation of few floating point manipulation functions.
...
Implementations of copysign[f], frexp[f], logb[f], and modf[f] are added.
Reviewers: asteinhauser
Differential Revision: https://reviews.llvm.org/D81134
2020-06-11 12:23:11 -07:00
Paula Toth
0dcdc1c863
[libc] Fix integration test header dependency.
2020-06-10 21:52:27 -07:00
Siva Chandra Reddy
b622a255a3
[libc][Obvious] Use full path with cmake's if(EXISTS ...).
...
That if(EXISTS ...) works only with full paths was missed in couple of
places a in recent cleanup.
2020-06-10 15:08:00 -07:00
Siva Chandra Reddy
4be1c116ad
[libc] Add implementations of round and roundf.
...
Reviewers: asteinhauser
Differential Revision: https://reviews.llvm.org/D80779
2020-06-09 23:01:20 -07:00
Siva Chandra Reddy
ef0ea8717a
[libc][NFC] Adjust sinf and cosf around -infinity inputs.
...
The current tests verify if the result of -infinity is a quiet NaN with
sign bit set. But, that need not be the case on all platforms. So, just
checking that the result is a quiet NaN and ignoring the sign bit is
good enough.
2020-06-09 16:23:12 -07:00