[libc-commits] [libc] [libc][docs] codify Policy on Assembler Sources (PR #88185)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Thu Apr 11 10:53:20 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 Assembler sources
+===========================
+
+Coding in high level languages such as C++ provides benefits relative to low
+level languages like Assembler, such as:
+
+* Improved safety
+* Instrumentation
+
+  * Code coverage
+  * Profile collection
+* Sanitization
+* Debug info
+
+While its not impossible to have Assembler code that correctly provides all of
+the above, we do not wish to maintain such Assembler 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 Assembler. We do use inline or out-of-line
+Assembler 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 Assembler for performance are not welcome. Contributors
----------------
nickdesaulniers wrote:

Ah! I didn't realize we _did_ have inline asm for these kind of optimizations.  @gchatelet is attending EuroLLVM this week, but maybe next week he can catch up on this thread and help us draw the distinction of precisely where we want to draw the line.

https://github.com/llvm/llvm-project/pull/88185


More information about the libc-commits mailing list