mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[build] Get release mode optimizations working
Added a release config, and fixed a few spots where optimizations broke things: - Clang was generating incorrect code for run_ctor_list in libc's init.cpp (it ignored a check for the end of the list) - my rep movsb memcpy implementation used incorrect inline asm constraints, so it was returning a pointer to the end of the copied range instead of the start. Since this function was just inline asm anyway, I rewrote it in asm by hand in a new memutils.s file.
This commit is contained in:
@@ -7,14 +7,6 @@
|
||||
using namespace j6;
|
||||
using namespace __j6libc;
|
||||
|
||||
void *memcpy(void * restrict dst, const void * restrict src, size_t n) {
|
||||
asm volatile ("rep movsb"
|
||||
:
|
||||
: "D"(dst), "S"(src), "c"(n)
|
||||
: "memory");
|
||||
return dst;
|
||||
}
|
||||
|
||||
static void memmove_dispatch(char *s1, const char *s2, size_t n) {
|
||||
if (s1 == s2) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user