Commit Graph

16 Commits

Author SHA1 Message Date
Jorge Gorbe Moya ac1235dda6 Fix bazel rule for __support_fputil_fma when using header modules.
Putting __support/FPUtil/x86_64/FMA.h in `hdrs` will trigger a
compilation action for that header, and it will always `#error` out for
non-FMA targets. Move these platform-specific headers that are
conditionally included to `textual_hdrs` instead.
2022-04-08 16:28:31 -07:00
Tue Ly c5f8a0a1e9 [libc] Add support for x86-64 targets that do not have FMA instructions.
Make FMA flag checks more accurate for x86-64 targets, and refactor
polyeval to use multiply and add instead when FMA instructions are not
available.

Reviewed By: michaelrj, sivachandra

Differential Revision: https://reviews.llvm.org/D123335
2022-04-08 14:12:24 -04:00
Sterling Augustine 07998f6d75 Correct and complete dependency sets after 74b411d38c
Prior to this change the __support_cpp_array_ref target's only dependency was libc_root.
but it #includes "TypeTraits.h" and Array.h for that matter.

These dependencies matter when building in distributed build systems and the relevant
files must be know for the distributed build to ship them to the executor.

Differential Revision: https://reviews.llvm.org/D121974
2022-03-17 19:52:49 -07:00
Michael Jones 74b411d38c [libc][bazel] split support_standalone_cpp target
previously the support_standalone_cpp target contained all of the files
in the __support/cpp folder. This change splits these out so that only
what is needed is included. In addition, this change adds the new
support files that previously didn't have targets.

Reviewed By: lntue, gchatelet

Differential Revision: https://reviews.llvm.org/D121314
2022-03-15 16:40:43 -07:00
Benjamin Kramer 317e6a8077 [bazel] Port 76ec69a911 2022-03-04 20:18:00 +01:00
Alina Sbirlea 21aaa1fb22 [bazel] Add libc dependency. 2022-02-16 17:15:45 -08:00
Guillaume Chatelet 7e7ecef980 [libc] Replace type punning with bit_cast
Although type punning is defined for union in C, it is UB in C++.
This patch introduces a bit_cast function to convert between types in a safe way.

This is necessary to get llvm-libc compile with GCC.
This patch is extracted from D119002.

Differential Revision: https://reviews.llvm.org/D119145
2022-02-08 20:45:59 +00:00
Siva Chandra Reddy e07100002e [libc][bazel overlay] Add a target for strncpy. 2022-02-02 20:19:32 +00:00
Jordan Rupprecht 282c83c323 [libc] Add missing sqrt deps for layering checks 2022-01-28 12:11:27 -08:00
Tue Ly ad4ee2d778 [libc] Refactor sqrt implementations and add tests for generic sqrt implementations.
Re-apply https://reviews.llvm.org/D118173 with fix for aarch64.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D118433
2022-01-28 13:39:03 -05:00
Siva Chandra Reddy 4beba3a32a [libc] Revert "Refactor sqrt implementations and add tests for generic sqrt implementations."
This reverts commit 21c4c82c20.
2022-01-27 21:06:14 +00:00
Tue Ly 21c4c82c20 [libc] Refactor sqrt implementations and add tests for generic sqrt implementations.
Refactor sqrt implementations:
- Move architecture specific instructions from `src/math/<arch>` to `src/__support/FPUtil/<arch>` folder.
- Move generic implementation of `sqrt` to `src/__support/FPUtil/generic` folder and add it as a header library.
- Use `src/__support/FPUtil/sqrt.h` for architecture/generic selections.
- Add unit tests for generic implementation of `sqrt`.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D118173
2022-01-27 11:54:54 -05:00
Clint Caywood 57eb5033cd [libc] Add bazel definition for hypot/hypotf.
Patch by Clint Caywood.

Differential Revision: https://reviews.llvm.org/D118053
2022-01-24 09:54:23 -08:00
Guillaume Chatelet 0dc339c870 [libc][NFC][bazel] remove unneeded bzl_library 2021-12-15 17:50:32 +00:00
Guillaume Chatelet 354e5cf776
Embed licence into package 2021-12-15 15:17:24 +01:00
Guillaume Chatelet 8ed70d0189 [libc] Bazel overlay for libc
This patch provides a draft overlay to support compilation of llvm libc with Bazel.

Tested on linux x86-64 with
```
cd git/llvm-project/utils/bazel
bazelisk-linux-amd64 build --sandbox_base=/dev/shm --config=generic_clang @llvm-project//libc:all
```

Differential Revision: https://reviews.llvm.org/D114712
2021-12-13 19:14:22 +00:00