aboutsummaryrefslogtreecommitdiff
path: root/libc
AgeCommit message (Collapse)AuthorFilesLines
2020-07-13[libc][benchmark] Add display option to render.py3Andre Vieira1-5/+24
Differential Revision: https://reviews.llvm.org/D83380
2020-07-10[libc] [Obvious] Remove unneeded header in strchr.cgyurgyik2-3/+0
Reviewers: sivachandra Reviewed By: sivachandra Subscribers: mgorny, tschuett, ecnelises, libc-commits Tags: #libc-project Differential Revision: https://reviews.llvm.org/D83589
2020-07-10[libc] Add strchr implementation. Fixes bug in memchr.cgyurgyik9-1/+163
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-08[libc] Fix typographical error in math_utils.h.Chris Gyurgyik1-1/+1
2020-07-07[libc] Add memchr implementation.cgyurgyik8-2/+178
2020-07-06[libc] Add documentation for clang-tidy checks.Paula Toth1-0/+86
Reviewers: sivachandra Reviewed By: sivachandra Subscribers: tschuett, ecnelises, libc-commits Tags: #libc-project Differential Revision: https://reviews.llvm.org/D82846
2020-07-06[libc] Add documentation for integration tests.Paula Toth1-0/+19
Reviewers: sivachandra Reviewed By: sivachandra Subscribers: MaskRay, tschuett, ecnelises, libc-commits Tags: #libc-project Differential Revision: https://reviews.llvm.org/D82907
2020-06-28[libc] This commit fixes the strcmp fuzzing test. It uses a single input andcgyurgyik2-24/+53
splits it into two by using the value of the first byte to determine the length of the first string. Reviewed-by: PaulkaToast, Differential Revision: https://reviews.llvm.org/D82427 Summary: [libc] Since only one input is given, it is necessary to split the string into two containers so that they can be compared for the purposes of this fuzz test. This is done in the following manner: 1. Take the value of the first byte; this is size1. (Credits to @PaulkaToast for this idea). 2. size2 is the value of size - size1. 3. Copy the characters to new containers, data1 and data2 with corresponding sizes. 4. Add a null terminator to the first container, and verify the second container has a null terminator. 5. Verify output of strcmp. A simpler alternative considered was simply splitting the input data into two, but this means the two strings are always within +- 1 character of each other. This above implementation avoids this. ninja check-libc was run; no issues. Reviewers: PaulkaToast, sivachandra Reviewed By: PaulkaToast Subscribers: mgorny, tschuett, ecnelises, libc-commits, PaulkaToast Tags: #libc-project Differential Revision: https://reviews.llvm.org/D82427
2020-06-25[libc] Add the remaining long double flavors of nearest integer functions.Siva Chandra Reddy16-38/+443
Specifically: ceill, floorl and roundl have been added. Reviewers: asteinhauser Differential Revision: https://reviews.llvm.org/D82591
2020-06-24[libc] Enable copysignl, frexpl, logbl and modfl on aarch64.Siva Chandra1-0/+4
2020-06-24[libc][Obvious] Remove a debug #include of iostream.Siva Chandra Reddy1-2/+0
2020-06-23[libc] Add long double flavors of the floating point manipulation functions.Siva Chandra Reddy19-42/+707
Specifically: copysignl, frexpl, logbl and modfl have been added. Reviewers: asteinhauser Differential Revision: https://reviews.llvm.org/D82357
2020-06-23[libc][Obvious] Fix few typos in tests.Siva Chandra Reddy6-12/+10
2020-06-23Remove strcmp fuzz from CMakeList since it breaks build.cgyurgyik1-8/+0
2020-06-23Add stddef.h to fix missing size_t type build errors.Simon Pilgrim1-0/+1
2020-06-23[libc] Add fuzz test for strcmp.cgyurgyik1-4/+5
Summary: Adds a fuzz test for string comparison. This takes in two strings with associated lengths. Verifies each string contains at least one character, and that the last character is the null terminator. Then, finds the first instance where one of the following does not hold: 1. i < min(size1, size2) 2. s1[i] == s2[i] 3. s1[i] != '\0' The result of strcmp is then compared to the value of the difference between s1[i] and s2[i]. For thoroughness, the operands are reversed and also checked. Reviewers: sivachandra, PaulkaToast Reviewed By: sivachandra, PaulkaToast Subscribers: mgorny, tschuett, ecnelises, libc-commits Tags: #libc-project Differential Revision: https://reviews.llvm.org/D82247
2020-06-23Add strcmp fuzz test.cgyurgyik2-0/+63
Reviewed-by: todo Differential Revision: https://reviews.llvm.org/D82247
2020-06-22[libc] Match x86 long double NaN classification with that of the compiler.Siva Chandra Reddy5-2/+108
Reviewers: asteinhauser Differential Revision: https://reviews.llvm.org/D82330
2020-06-19[libc] This adds the strcmp (string compare) implementation.cgyurgyik6-0/+159
Reviewed-by: sivachandra Differential Revision: https://reviews.llvm.org/D82134
2020-06-18[libc] Migrate the libc benchmark instruction to ninja.Anthony Steinhauser1-2/+2
Reviewers: sivachandra Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D82143
2020-06-18[libc] Add implementations long double fabsl and truncl functions.Siva Chandra Reddy19-24/+589
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-17[libc][benchmarks] Link the memory benchmark exes to functions from LLVM libc.Siva Chandra Reddy22-8/+18
Summary: To get the target order correct, the benchmarks directory has been moved one level higher. Previously, it was living in the utils directory. The utils directory is a collection of utils which are to be used by the tests and implementations. However, benchmarks *use* the implementations. So, moving it out of utils helps us setup proper target level dependencies. Reviewers: gchatelet Differential Revision: https://reviews.llvm.org/D81910
2020-06-15[lib][NFC] Split the floating point util functions into multiple files.Siva Chandra Reddy24-227/+301
The grouping now reflects the grouping on cppreference.com.
2020-06-15[libc] Enable string functions for aarch64.Siva Chandra1-0/+5
2020-06-15[libc] Extract an architecture independent copy of memcpy implementation.Siva Chandra Reddy2-5/+88
Along that way, platform specific options to memcpy, memset and bzero builds have been enclosed in conditionals. Also, the optimization level has been set to -O2 for the memory function builds to actually see the static functions inlined. Reviewers: gchatelet Differential Revision: https://reviews.llvm.org/D81621
2020-06-11[libc] Add implementation of few floating point manipulation functions.Siva Chandra Reddy34-10/+1503
Implementations of copysign[f], frexp[f], logb[f], and modf[f] are added. Reviewers: asteinhauser Differential Revision: https://reviews.llvm.org/D81134
2020-06-10[libc] Fix integration test header dependency.Paula Toth1-1/+1
2020-06-10[libc][Obvious] Use full path with cmake's if(EXISTS ...).Siva Chandra Reddy2-2/+2
That if(EXISTS ...) works only with full paths was missed in couple of places a in recent cleanup.
2020-06-10[libc] Add a simple linux aarch64 config.Siva Chandra2-0/+31
Summary: With this change, "ninja check-libc" on linux/aarch64 succeeds. However, all entrypoints with machine dependent implementations have been skipped. A good number of these skipped entrypoints can be enabled once we have aarch64 syscall support available. Reviewers: abrachet, asteinhauser Differential Revision: https://reviews.llvm.org/D81533
2020-06-10[libc][NFC] Make cpu feature check tolerate non-x86 architectures.Siva Chandra1-3/+9
The feature check should probably be enhanced for non-x86 architectures, but this change shields them from x86 specific pieces until then. This patch has been split out from https://reviews.llvm.org/D81533.
2020-06-09[libc] Add implementations of round and roundf.Siva Chandra Reddy12-36/+299
Reviewers: asteinhauser Differential Revision: https://reviews.llvm.org/D80779
2020-06-09[libc] Skip fuzzer as well if its dependent entrypoints are skipped.Siva Chandra Reddy1-2/+18
Reviewers: asteinhauser Subscribers: mgorny, tschuett, ecnelises, libc-commits Tags: #libc-project Differential Revision: https://reviews.llvm.org/D81519
2020-06-09[libc][NFC] Adjust sinf and cosf around -infinity inputs.Siva Chandra Reddy2-4/+4
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[libc][NFC][Obvious] Tidy up some CMake files.Siva Chandra Reddy4-4/+6
Conditionally adding subdirectories was missed in a few places previously. This change adds the conditionals. A sub-directory was being added needlessly in another place. That has been removed.
2020-06-09[libc] Skip entrypoints not present in the entrypoints list.Siva Chandra Reddy10-19/+106
Summary: If a test depends on a skipped entrypoint, then the test is also skipped. This setup will be useful as we gradually add support for more operating systems and target architectures. Reviewers: asteinhauser Differential Revision: https://reviews.llvm.org/D81489
2020-06-08[libc][NFC] Add few more missing entrypoints to the entrypoint list.Siva Chandra Reddy1-0/+4
They were likely missed while rebasing.
2020-06-08[libc][NFC] Add bzero to list of entrypoints.Siva Chandra Reddy3-0/+23
A new LLVM libc specific extension standard spec has been added.
2020-06-08[libc][NFC][Obvious] Add names to various string entrypoints.Siva Chandra Reddy1-0/+1
2020-06-03[libc][NFC] Add ceil[f], floor[f] and trunc[f] to the spec and config files.Siva Chandra Reddy3-1/+24
2020-06-02[libc] Remove integration test target from check libc.Paula Toth1-9/+8
Summary: This is failing on the asan build because we use `-nostdlib`. I also took this opportunity to make the target name match the naming structure we've been using. Reviewers: sivachandra Reviewed By: sivachandra Subscribers: mgorny, tschuett, ecnelises, libc-commits Tags: #libc-project Differential Revision: https://reviews.llvm.org/D81029
2020-06-02[libc] Add integration tests.Paula Toth9-63/+241
Summary: This patch aims to add integration tests to check the following: 1) Header files are generated as expected. 2) Libc functions have the correct public name. 3) Libc functions have the correct return type and parameter types. 4) Symbols are exposed in the public lib.a files. Reviewers: sivachandra, abrachet Reviewed By: sivachandra Subscribers: aheejin, ecnelises, dxf, mgorny, jfb, tschuett, libc-commits Tags: #libc-project Differential Revision: https://reviews.llvm.org/D79192
2020-06-01[libc] Expose APIGenerator.Paula Toth2-185/+218
Summary: This is split off from D79192 and exposes APIGenerator (renames to APIIndexer) for use in generating the integrations tests. Reviewers: sivachandra Reviewed By: sivachandra Subscribers: tschuett, ecnelises, libc-commits Tags: #libc-project Differential Revision: https://reviews.llvm.org/D80832
2020-06-01[libc] Add implementations of ceil[f], floor[f] and trunc[f] from math.h.Siva Chandra Reddy25-8/+948
Reviewers: abrachet Differential Revision: https://reviews.llvm.org/D80612
2020-05-28[libc] Add implementation of call_once from threads.h.Siva Chandra Reddy9-1/+263
Reviewers: abrachet, maskray Differential Revision: https://reviews.llvm.org/D79828
2020-05-28[libc][NFC][Obvious] Fix few header guards in src/threads.Siva Chandra Reddy5-15/+15
2020-05-28[libc][NFC][Obvious] Remove line break from a CMake message.Siva Chandra Reddy1-2/+2
The line break was giving an impression of something going wrong.
2020-05-28[libc] Fixing the build command for benchmarks.Anthony Steinhauser1-1/+1
Building libc without clang fails with: CMake Error at /home/asteinhauser/llvm-project/libc/CMakeLists.txt:49 (message): 'clang' and 'clang-tools-extra' are required in LLVM_ENABLE_PROJECTS to lint llvm-libc. The linting step performs important checks to help prevent the introduction of subtle bugs, but it may increase build times. Reviewers: sivachandra Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D80495
2020-05-26[libc][NFC][Obvious] Convert the MPFR operations enum to an enum class.Siva Chandra Reddy9-41/+43
This was suggested in https://reviews.llvm.org/D79149.
2020-05-26[libc][NFC] Simplify memcpy implementationGuillaume Chatelet7-166/+125
Summary: This is a NFC, it aims at simplifying both the code and build files. Reviewers: abrachet, sivachandra Subscribers: mgorny, tschuett, ecnelises, libc-commits, courbet Tags: #libc-project Differential Revision: https://reviews.llvm.org/D80291
2020-05-21[libc] Make clang-tidy use host compiler's resource dir.Paula Toth3-9/+48
Summary: When building llvm-libc with linting enabled, clang-tidy would use the resource dir of the monorepo rather then the host compiler's resource dir. This presented issues when including headers from the host compiler e.g. for sanitizers. Therefore this patch explicitly tells clang-tidy to use the host compiler's resource dir. Reviewers: sivachandra Reviewed By: sivachandra Subscribers: mgorny, tschuett, ecnelises, libc-commits Tags: #libc-project Differential Revision: https://reviews.llvm.org/D80265