<div dir="ltr"><div dir="ltr">To describe in maybe some better way, for example this is all I need to get ceilf floorf etc in a .wasm module being built by -nostdlib -nostdinc<div><div><br></div><div>#define ceilf __builtin_ceilf</div><div>#define floorf __builtin_floorf</div><div>#define abs __builtin_abs</div><div>#define fabs __builtin_fabs</div></div><div><br></div><div>so I wondered if I could get more of libc this way (parts make sense ofc) or at least to know what will be the relation between those builtin implementations and the upcoming libc.</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 30, 2021 at 9:30 PM Ebrahim Byagowi <<a href="mailto:ebraminio@gmail.com">ebraminio@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>There is e.g. __builtin_memcpy and even a __builtin_memcpy_inline in clang, and <a href="https://github.com/llvm/llvm-project/blob/6ca54e0/libc/src/string/memory_utils/memset_utils.h#L20-L23" target="_blank">__builtin_memset_inline</a> apparently is just a TODO right now.</div><div dir="ltr"><br></div><div>As __builtin_memcpy for example already has <a href="https://github.com/llvm/llvm-project/blob/0da15ea/llvm/lib/IR/IRBuilder.cpp#L187-L209" target="_blank">an implementation on llvm</a> but llvm-libc hasn't reused it and implemented it separately, maybe perhaps in order to not make llvm-libc a clang buildable only project as maybe some builtins aren't present in other compilers.</div><div><br></div><div>My question is what is the plan about the two, accepting the duplication of implementations or removing non libc implementation in favor of llvm libc provided ones or the reverse way.</div><div><br></div><div>I wonder if is there a future that all or most of the libc entries will also be provided by compiler's __builtin_* and maybe __builin_*_inline also thus resolving the TODO __builin_memset_inline by just reusing llvm-libc implementations somehow on IRBuilder.</div><div><br></div><div>Thanks!</div></div></div></div></div>
</blockquote></div>