[libc-commits] [libc] [libc][docs] codify Policy on Assembler Sources (PR #88185)
Nick Desaulniers via libc-commits
libc-commits at lists.llvm.org
Tue Apr 16 14:45:43 PDT 2024
================
@@ -186,3 +186,32 @@ We expect contributions to be free of warnings from the `minimum supported
compiler versions`__ (and newer).
.. __: https://libc.llvm.org/compiler_support.html#minimum-supported-versions
+
+Policy on Assembly sources
+===========================
+
+Coding in high level languages such as C++ provides benefits relative to low
+level languages like Assembly, such as:
+
+* Improved safety
+* Instrumentation
+
+ * Code coverage
+ * Profile collection
+* Sanitization
+* Debug info
+
+While it's not impossible to have Assembly code that correctly provides all of
+the above, we do not wish to maintain such Assembly sources in llvm-libc.
+
+That said, there a few functions provided by llvm-libc that are more difficult
+to implement or maintain in C++ than Assembly. We do use inline or out-of-line
+Assembly in an intentionally minimal set of places; typically places where the
+stack or individual register state must be manipulated very carefully for
+correctness.
+
+Contributions adding Assembly for performance are not welcome. Contributors
----------------
nickdesaulniers wrote:
updated the wording here in https://github.com/llvm/llvm-project/commit/0749f082f33b30fb3fdd5f8888177c4ade17dd6b
> Ideally, bugs should be filed against compiler vendors, and links to those bug reports should appear in commit messages or comments that seek to add Assembly to llvm-libc.
PTAL
https://github.com/llvm/llvm-project/pull/88185
More information about the libc-commits
mailing list