aboutsummaryrefslogtreecommitdiff
path: root/libc/config
AgeCommit message (Collapse)AuthorFilesLines
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.
2024-06-05[libc][math][c23] Add {nextafter,nexttoward,nextup,nextdown}f16 C23 math ↵OverMighty2-0/+8
functions (#94535) #93566
2024-06-05[libc][math][c23] Implement fmaxf16 and fminf16 function (#94131)Hendrik Hübner2-0/+4
Implements fmaxf16 and fminf16, which are two missing functions listed here: #93566
2024-06-05[libc][math][c23] Add fdimf16 C23 math function (#94354)OverMighty2-0/+2
#93566
2024-06-05[libc][math][c23] Add copysignf16 C23 math function (#94351)OverMighty2-0/+2
#93566
2024-06-05[libc][math][c23] Add canonicalizef16 C23 math function (#94341)OverMighty2-0/+2
#93566
2024-06-04[libc][math][c23] Add {fromfp,fromfpx,ufromfp,ufromfpx}f16 C23 math ↵OverMighty2-0/+8
functions (#94254) https://github.com/llvm/llvm-project/issues/93566
2024-06-04[libc][math][c23] Add {nearbyint,rint,lrint,llrint,lround,llround}f16 C23 ↵OverMighty2-0/+12
math functions (#94218) https://github.com/llvm/llvm-project/issues/93566
2024-06-03[libc][math][c23] Add {ceil,floor,round,roundeven,trunc}f16 C23 math ↵OverMighty2-0/+10
functions (#94001)
2024-05-31[libc] rework mutex (#92168)Schrodinger ZHU Yifan1-0/+10
2024-05-31[libc] added quick_exit function (#93620)RoseZhang031-0/+1
- In /libc/src/__support/ OSUtil, changed quick_exit to just exit, and put in namespace LIBC_NAMESPACE::internal. - In /libc/src/stdlib added quick_exit - Added test files for quick_exit
2024-05-30[libc][math][c23] Add fabsf16 C23 math function (#93567)OverMighty2-0/+14
cc @lntue
2024-05-30Reland: [libc][POSIX][pthreads] implemented missing pthread_rwlockattr ↵Hendrik Hübner1-0/+2
functions (#93622) New pull request for https://github.com/llvm/llvm-project/issues/89443 The previous PR was reverted after breaking fullbuild due to a missing struct declaration, which I forgot to commit. Reverts revert and adds the missing pthread_rwlockattr_getkind_np / pthread_rwlockattr_setkind_np functions and tests respecitvely.
2024-05-21[libc] Provide __libc_{init,fini}_array for baremetal (#90828)Petr Hosek2-0/+8
These are provided by newlib and many baremetal projects assume they're available rather than providing their own implementation.
2024-05-13Revert "[libc][POSIX][pthreads] implemented missing pthread_rwlockattr ↵Schrodinger ZHU Yifan1-2/+0
functions" (#91966) Reverts llvm/llvm-project#90249 Fullbuild is broken: https://lab.llvm.org/buildbot/#/builders/163/builds/56501
2024-05-13[libc][POSIX][pthreads] implemented missing pthread_rwlockattr functions ↵Hendrik Hübner1-0/+2
(#90249) Closes #89443 I added the two missing functions and respective test cases. Let me know if anything needs changing.
2024-05-01[libc] Implement fcntl() function (#89507)Vinayak Dev3-0/+3
Fixes #84968. Implements the `fcntl()` function defined in the `fcntl.h` header.
2024-04-30Add basic char*_t support for libc (partial WG14 N2653) (#90360)Fabian Keßler6-1/+21
This PR implements a part of WG14 N2653: - Define C23 char8_t - Define C11 char16_t - Define C11 char32_t Missing goals are: - The type of UTF-8 character literals is changed from unsigned char to char8_t. (Since UTF-8 character literals already have type unsigned char, this is not a semantic change). - New mbrtoc8() and c8rtomb() functions declared in <uchar.h> enable conversions between multibyte characters and UTF-8. - A new ATOMIC_CHAR8_T_LOCK_FREE macro. - A new atomic_char8_t typedef name.
2024-04-29[libc][math] Adds entrypoint and tests for nearbyintf128,scalbnf128 (#88443)Michael Flanders3-0/+6
Closes #84689. Adding @lntue for review. I was curious about the implementation of `round_using_current_rounding_mode` used for the `nearbyint` functions. It has one of the rounding modes as unreachable ([here](https://github.com/llvm/llvm-project/blob/main/libc/src/__support/FPUtil/NearestIntegerOperations.h#L243)), and I was wondering if this was okay for the `nearbyint` functions. --------- Co-authored-by: Michael Flanders <mkf727@cs.washington.edu>
2024-04-23[libc] adding linux SYS_fchmodat2 syscall. (#89819)David CARLIER1-0/+4
2024-04-22[libc][POSIX][pthreads] implement pthread_rwlockattr_t functions (#89322)Nick Desaulniers2-2/+8
Implement: - pthread_rwlockattr_destroy - pthread_rwlockattr_getpshared - pthread_rwlockattr_init - pthread_rwlockattr_setpshared
2024-04-17[libc][POSIX][pthreads] implement pthread_condattr_t functions (#88987)Nick Desaulniers2-4/+31
Implement: - pthread_condattr_destroy - pthread_condattr_getclock - pthread_condattr_getpshared - pthread_condattr_init - pthread_condattr_setclock - pthread_condattr_setpshared Fixes: #88581
2024-04-17[libc][c23][fenv] Implement fetestexceptflag (#87828)Robin Caloudis9-0/+9
Provide C23 `fetestexceptflag` function according to 7.6.4.6 in the latest [revision of the C standard](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf) from 2023-04-02. Closes https://github.com/llvm/llvm-project/issues/87565.
2024-04-12Reapply "[libc][math][c23] Add remaining linux/* entrypoints for ↵OverMighty3-0/+44
{,u}fromfp{,x}* (#86692)" (#88567) This reverts commit 8a071678a9091d536eae29912ca7be6238105956. The test failure on 32-bit Arm should have been fixed by #86892. cc @nickdesaulniers @lntue