C23 defines new floating-point types, such as _Float16, which corresponds tothe binary16 format from IEEE Std 754, also known as “half-precision,” or FP16.C23 also defines new variants of the C standard library’s math functionsaccordingly, such as fabsf16 to get the absolute value of a _Float16.The “Half-precision in LLVM libc” Google Summer of Code 2024 project aimed toimplement these new _Float16 math functions in LLVM libc, making it the firstknown C standard library implementation to implement these C23 functions.We split math functions into two categories: basic operations and higher mathfunctions. The current implementation status of math functions in LLVM libc canbe viewed at https://libc.llvm.org/math/index.html#implementation-status.The exact goals of this project were to:Setup generated headers properly so that the _Float16 type and _Float16functions can be used with various compilers and architectures.Add generic implementations of _Float16 basic operations for supportedarchitectures.Add optimized implementations of _Float16 basic operations for specificarchitectures using special hardware instructions and compiler builtinswhenever possible.Add generic implementations of as many _Float16 higher math functions aspossible. We knew we would not have enough time to implement all of them.Work doneThe _Float16 type can now be used in generated headers, and declarations of_Float16 math functions are generated with #ifdef guards to enable themwhen they are supported.https://github.com/llvm/llvm-project/pull/93567All 70 planned _Float16 basic operations have been merged.https://github.com/llvm/llvm-project/issues/93566The _Float16, float and double variants of various basic operationshave been optimized on certain architectures.https://github.com/llvm/llvm-project/pull/98376https://github.com/llvm/llvm-project/pull/99037https://github.com/llvm/llvm-project/pull/100002Out of the 54 planned _Float16 higher math functions, 8 have been mergedand 9 have an open pull request.https://github.com/llvm/llvm-project/issues/95250We ran into unexpected issues, such as:Bugs in Clang 11, which is currently still supported by LLVM libc and used inpost-commit CI.Some post-commit CI workers having old versions of compiler runtimes that aremissing some floating-point conversion functions on certain architectures.Inconsistent behavior of floating-point conversion functions across compilerruntime vendors (GCC’s libgcc and LLVM’s compiler-rt) and CPU architectures.Due to these issues, LLVM libc currently only enables all _Float16 functionson x86-64 Linux. Some were disabled on AArch64 due to Clang 11 bugs, and allwere disabled on 32-bit Arm and on RISC-V due to issues with compiler runtimes.Some are not available on GPUs because they take _Float128 arguments, and the_Float128 type is not available on GPUs.There is work in progress to work around issues with compiler runtimes by usingour own floating-point conversion functions.Work left to doImplement the remaining _Float16 higher math functions.Enable the _Float16 math functions that are disabled on AArch64 once LLVMlibc bumps its minimum supported Clang version.Enable _Float16 math functions on 32-bit Arm and on RISC-V once issues withcompiler runtimes are resolved.AcknowledgementsI would like to thank my Google Summer of Code mentors, Tue Ly and Joseph Huber,as well as other LLVM maintainers I interacted with, for their help. I wouldalso like to thank Google for organizing this program.