aboutsummaryrefslogtreecommitdiff
path: root/libc/config
AgeCommit message (Collapse)AuthorFilesLines
2024-07-02[libc][math][c23] Add f16{add,sub}{,l,f128} C23 math functions (#97072)OverMighty2-0/+8
Part of #93566.
2024-07-02[libc][math][c23] Add f16{add,sub}f C23 math functions (#96787)OverMighty2-0/+4
Part of #93566.
2024-07-01[libc][math][c23] Implemented sinpif function correctly rounded for all ↵Hendrik Hübner4-0/+4
rounding modes. (#97149) This implements the sinpif function. An exhaustive test shows it's correct for all rounding modes. Issue: #94895
2024-07-01[libc] Implement the 'remove' function on the GPU (#97096)Joseph Huber1-0/+1
Summary: Straightforward RPC implementation of the `remove` function for the GPU. Copies over the string and calls `remove` on it, passing the result back. This is required for building some `libc++` functionality.
2024-06-30[libc][math][c23] Add f16sqrt{,l,f128} C23 math functions (#96642)OverMighty2-1/+5
Part of #95250.
2024-06-29[libc][math][c23] Temporarily disable f16div{l,f128} on AArch64 (#97182)OverMighty1-8/+0
Due to Clang 11 backend error ("Unsupported library call operation!"). See Buildbot failures: - https://lab.llvm.org/buildbot/#/builders/104/builds/1105 - https://lab.llvm.org/buildbot/#/builders/71/builds/1100
2024-06-29[libc][math][c23] Add f16div{,l,f128} C23 math functions (#97054)OverMighty2-0/+12
Part of #93566.
2024-06-28[libc] remove include_file headergen usage (#96970)Michael Jones3-2375/+0
Previously headergen had a mechanism to copy the contents of one file inot another. This wasn't ever used properly, and isn't supported by the new headergen design. We will investigate better ways to support different syscall definitions in future.
2024-06-27[libc] Sort entrypoints alphabetically (#96955)Petr Hosek7-776/+774
This makes it easier to diff the different configurations.
2024-06-27[libc][math][c23] Temporarily disable f16fma{,l,f128} on AArch64 (#96952)OverMighty1-9/+0
See Buildbot failures: - https://lab.llvm.org/buildbot/#/builders/104/builds/936 - https://lab.llvm.org/buildbot/#/builders/71/builds/932 - https://lab.llvm.org/buildbot/#/builders/131/builds/913
2024-06-27[libc][math][c23] Add f16fma{,l,f128} C23 math function (#96711)OverMighty2-0/+18
Part of #93566.
2024-06-27[libc] Include additional math functions in baremetal config (#96926)Petr Hosek2-0/+108
These are all supported on arm32 and riscv32.
2024-06-27[libc][math] Implement double precision sincos correctly rounded to all ↵lntue6-0/+6
rounding modes. (#96719) Sharing the same algorithm as double precision sin: https://github.com/llvm/llvm-project/pull/95736 and cos: https://github.com/llvm/llvm-project/pull/96591
2024-06-25[libc][arm] move setjmp+longjmp to fullbuild-only entrypoints (#96708)Nick Desaulniers (paternity leave)1-4/+8
The opaque type jmp_buf should only be tested in fullbuild mode.
2024-06-25[libc][math] Implement double precision cos correctly rounded to all ↵lntue4-0/+4
rounding modes. (#96591) Sharing the same algorithm as double precision sin: https://github.com/llvm/llvm-project/pull/95736
2024-06-25[libc][arm32] define argc type and stack alignment (#96367)Nick Desaulniers (paternity leave)1-21/+3
https://github.com/ARM-software/abi-aa/blob/main/aapcs32/aapcs32.rst#6212stack-constraints-at-a-public-interface mentions that the stack on ARM32 is double word aligned. Remove confused comments around ArgcType. argc is always an int, passed on the stack, so we need to store a pointer to it (regardless of ILP32 or LP64).
2024-06-25[libc][math][c23] Add f16divf C23 math function (#96131)OverMighty2-0/+2
Part of #93566.
2024-06-24[libc][math] Implement double precision sin correctly rounded to all ↵lntue4-0/+4
rounding modes. (#95736) - Algorithm: - Step 1 - Range reduction: for a double precision input `x`, return `k` and `u` such that - k is an integer - u = x - k * pi / 128, and |u| < pi/256 - Step 2 - Calculate `sin(u)` and `cos(u)` in double-double using Taylor polynomials with errors < 2^-70 with FMA or < 2^-66 w/o FMA. - Step 3 - Calculate `sin(x) = sin(k*pi/128) * cos(u) + cos(k*pi/128) * sin(u)` using look-up table for `sin(k*pi/128)` and `cos(k*pi/128)`. - Step 4 - Use Ziv's rounding test to decide if the result is correctly rounded. - Step 4' - If the Ziv's rounding test failed, redo step 1-3 using 128-bit precision. - Currently, without FMA instructions, the large range reduction only works correctly for the default rounding mode (FE_TONEAREST). - Provide `LIBC_MATH` flag so that users can set `LIBC_MATH = LIBC_MATH_SKIP_ACCURATE_PASS` to build the `sin` function without step 4 and 4'.
2024-06-24[libc][arm] add malloc/free/aligned_alloc to entrypoints (#96516)Nick Desaulniers (paternity leave)1-0/+5
Necessary for arm32 cross full build.
2024-06-21[libc][stdlib] Fix skipped libc.src.stdlib.freelist_malloc target for ↵lntue2-0/+2
baremetal. (#96372) Downstream build issue reported: https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8744479865106393873/overview
2024-06-21[libc][math][c23] Add {ldexp,scalbn,scalbln}f16 C23 math functions (#94797)OverMighty2-0/+6
Part of #93566.
2024-06-20[libc] Control freelist malloc buffer size with a config (#96248)PiJoules2-0/+11
Rather than propgating a compile define, add an explicit cmake flag for controlling the size. The default for baremetal is 100KB and the default for others is 1GB.
2024-06-20[libc][config] Add malloc as baremetal arm entrypoint (#95827)PiJoules2-0/+8
2024-06-20[libc][math][c23] Add {getpayload,setpayload,setpayloadsig}f16 C23 math ↵OverMighty2-0/+6
functions (#95159) Part of #93566.
2024-06-20[libc][arm] implement a basic setjmp/longjmp (#93220)Nick Desaulniers (paternity leave)4-7/+17
Note: our baremetal arm configuration compiles this as `--target=arm-none-eabi`, so this code is built in -marm mode. It could be smaller with `--target=armv7-none-eabi -mthumb`. The assembler is valid ARMv5, or THUMB2, but not THUMB(1).
2024-06-14[libc] Add the implementation of the fdopen function (#94186)Xu Zhang3-0/+3
Fixes #93711 . This patch implements the ``fdopen`` function. Given that ``fdopen`` internally calls ``fcntl``, the implementation of ``fcntl`` has been moved to the ``__support/OSUtil``, where it serves as an internal public function.
2024-06-14Reapply "[libc] printf, putchar and vprintf in bareemetal entrypoints… ↵Haowei2-0/+6
(#95619) This reverts commit eca988aa4420f33810f9830c80ff9f149b7928ff. The underlying libc issue was fixed by PR#95576. The original PR is #95436 , which adds printf, putchar and vprintf in bareemetal entrypoints
2024-06-14[libc] add rwlock (#94156)Schrodinger ZHU Yifan4-0/+24
2024-06-14Revert "[libc] printf, putchar and vprintf in bareemetal entrypoints (#95436)"Haowei Wu2-6/+0
This reverts commit b1de42a81d838bb0c6dea7d2436820a2456c730b, which breaks libc build for baremetal targets.
2024-06-14[libc][math][c23] Add f16fmaf C23 math function (#95483)OverMighty2-0/+2
Part of #93566.
2024-06-13[libc] printf, putchar and vprintf in bareemetal entrypoints (#95436)Petr Hosek2-0/+6
We now have baremetal implementations of these entrypoints.
2024-06-13Reland "[libc] fix aarch64 linux full build (#95358)" (#95423)Schrodinger ZHU Yifan1-0/+7
Reverts llvm/llvm-project#95419 and Reland #95358. This PR is full of temporal fixes. After a discussion with @lntue, it is better to avoid further changes to the cmake infrastructure for now as a rework to the cmake utilities will be landed in the future.
2024-06-13[libc][math][c23] Add f16sqrtf C23 math function (#95251)OverMighty2-0/+2
Part of #95250.
2024-06-13Revert "[libc] fix aarch64 linux full build (#95358)" (#95419)Schrodinger ZHU Yifan1-7/+0
2024-06-13[libc] fix aarch64 linux full build (#95358)Schrodinger ZHU Yifan1-0/+7
2024-06-11[libc][math][c23] Add {totalorder,totalordermag}f16 C23 math functions (#95014)OverMighty2-0/+4
Part of #93566.
2024-06-10[libc][math][c23] Add {remainder,remquo}f16 C23 math functions (#94773)OverMighty2-0/+4
Part of #93566.
2024-06-10[libc][math][c23] Temporarily disable modff16 on AArch64 (#94972)OverMighty1-1/+1
See Buildbot failure: https://lab.llvm.org/buildbot/#/builders/138/builds/67428.
2024-06-10[libc][math][c23] Add {frexp,ilogb,llogb,logb,modf}f16 C23 math functions ↵OverMighty2-0/+10
(#94758) Part of #93566.
2024-06-10[libc][math][c23] Add nanf16 C23 math function (#94767)OverMighty2-0/+2
Part of #93566.
2024-06-08[libc][math][C23] Implemented remquof128 function (#94809)Hendrik Hübner2-0/+2
Added remquof128 function. Closes #94312
2024-06-08[libc][math][c23] fmul correcly rounded to all rounding modes (#91537)Job Henandez Lara5-0/+5
This is an implementation of floating point multiplication: It will consist of - `double x double -> float`
2024-06-07[libc][math][c23] Temporarily disable fmodf16 on AArch64 (#94813)OverMighty1-1/+0
See Buildbot failure: https://lab.llvm.org/buildbot/#/builders/138/builds/67337.
2024-06-07[libc][math][c23] Add fmodf16 C23 math function (#94629)OverMighty2-0/+2
Part of #93566.
2024-06-06[libc] at_quick_exit function implemented (#94317)aaryanshukla1-1/+2
- added at_quick_exit function - used helper file exit_handler which reuses code from atexit - atexit now calls helper functions from exit_handler - test cases and dependencies are added --------- Co-authored-by: Aaryan Shukla <aaryanshukla@google.com>
2024-06-06[libc][math][c23] Add {fmaximum,fminimum}{,_mag,_mag_num,_num} C23 math ↵OverMighty2-0/+16
functions (#94510) #93566
2024-06-06[libc] Enable varargs tests for AMDGPU targetsJoseph Huber1-0/+11
Summary: This reverts commit 574ab7e7b759a400ecf54c1141b1433bb2415e93.
2024-06-06[libc][math] Temporarily disable nexttowardf16 on aarch64 due to clang-11 ↵lntue1-1/+4
bug. (#94569) The conversion between _Float16 and long double will crash clang-11 on aarch64. This is fixed in clang-12: https://godbolt.org/z/8ceT9454c
2024-06-06[libc] Disable varargs tests on gpu, nvptx can't build them yetJon Chesterfield1-4/+0
2024-06-06[AMDGPU] Implement variadic functions by IR lowering (#93362)Jon Chesterfield1-0/+4
This is a mostly-target-independent variadic function optimisation and lowering pass. It is only enabled for AMDGPU in this initial commit. The purpose is to make C style variadic functions a zero cost abstraction. They are lowered to equivalent IR which is then amenable to other optimisations. This is inherently slightly target specific but much less so than one might expect - the C varargs interface heavily constrains the ABI design divergence. The pass is primarily tested from webassembly. This is because wasm has a straightforward variadic lowering strategy which coincides exactly with what this pass transforms code into and a struct passing convention with few cases to check. Adding further targets conventions is straightforward and elided from this patch primarily to simplify the review. Implemented in other branches are Linux X86, AMD64, AArch64 and NVPTX. Testing for targets that have existing lowering for va_arg from clang is most efficiently done by checking that clang | opt completely elides the variadic syntax from test cases. The lowering produces a struct for each call site which can be inspected to check the various alignment and indirections are correct. AMDGPU presently has no variadic support other than some ad hoc printf handling. Combined with the pass being inactive on all other targets landing this represents strict increase in capability with zero risk. Testing and refining will continue post commit. In addition to the compiler tests included here, a self contained x64 clang/musl toolchain was constructed using the "lowering" instead of the systemv ABI and used to build various C programs like lua and libxml2.